ZMObject
└─ZMAttributeValue
public class ZMAttributeValue
extends ZMObject
| Fields inherited from org.zenmagick.core.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
ZMAttributeValue(mixed id, mixed name) Create new instance. |
|
| Method Summary | |
|---|---|
| ZMAttribute | Get the parent attribute. |
| protected float | getFinalOneTimePriceForQty(int quantity) Get the final one time attribute price. |
| protected float | getFinalPriceForQty(int quantity) Get the final attribute price without discount. |
| int | getId() Get the attribute value id. |
| string | getImage() Get the attribute value image (if any). |
| string | getName() Get the attribute value name. |
| double | getOneTimePrice(boolean tax) Get the final one time price. |
| double | getPrice(boolean tax, int quantity) Get the final (and discounted) value price. |
| protected float | getPriceFactorCharge(float price, float discountPrice, float priceFactor, int priceFactorOffset) Get the price factor charge. |
| string | Get the price prefix. |
| protected float | getQtyPrice(string qtyPrices, int quantity) Get one time charge (if any) for the given range and quantity. |
| int | Get the attribute value sort order. |
| ZMTaxRate | Get the tax rate. |
| double | getValuePrice(boolean tax) Get the value price. |
| double | Get the attribute weight. |
| string | Get the weight prefix. |
| boolean | hasImage() Check if this value has an associated image. |
| boolean | Check if this is the default value. |
| boolean | Check if this value is discounted. |
| boolean | Check if the attribute is 'display only'. |
| boolean | isFree() Check if the attribute is free. |
| boolean | Check if the base price is included. |
| boolean | Check if the price factor is one time. |
| void | setAttribute(ZMAttribute attribute) Set the parent attribute. |
| void | setDefault(boolean value) Set the default value flag. |
| void | setDiscounted(boolean value) Set the is discounted flag. |
| void | setDisplayOnly(boolean value) Set the attribute is 'display only' flag. |
| void | setFree(boolean value) Sheck the attribute free flag. |
| void | setId(int id) Set the attribute value id. |
| void | setImage(string image) Set the attribute value image (if any). |
| void | setIncludeInBasePrice(boolean value) Set the base price is included flag. |
| void | setName(string name) Set the attribute value name. |
| void | setOneTimePrice(double oneTimePrice) Set the values one time price. |
| void | setPriceFactorOneTime(boolean value) Set the price factor is one time flag. |
| void | setPricePrefix(string pricePrefix) Set the price prefix. |
| void | setSortOrder(int sortOrder) Set the attribute value sort order. |
| void | setTaxRate(ZMTaxRate taxRate) Set the tax rate. |
| void | setValuePrice(double price) Set the value price. |
| double | setWeight(mixed weight) Set the attribute weight. |
| void | setWeightPrefix(string weightPrefix) Set the weight prefix. |
| Methods inherited from org.zenmagick.core.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public ZMAttributeValue(mixed id, mixed name)
Create new instance.
public ZMAttribute getAttribute()
Get the parent attribute.
protected float getFinalOneTimePriceForQty(int quantity)
Get the final one time attribute price.
protected float getFinalPriceForQty(int quantity)
Get the final attribute price without discount.
public int getId()
Get the attribute value id.
public string getImage()
Get the attribute value image (if any).
public string getName()
Get the attribute value name.
public double getOneTimePrice(boolean tax)
Get the final one time price.
true to include tax (if applicable); default is true.public double getPrice(boolean tax, int quantity)
Get the final (and discounted) value price.
true to include tax (if applicable); default is true.protected float getPriceFactorCharge(float price, float discountPrice, float priceFactor, int priceFactorOffset)
Get the price factor charge.
The setting 'isDiscountAttributePriceFactor' will determine whether to use the discount or regular price.
public string getPricePrefix()
Get the price prefix.
protected float getQtyPrice(string qtyPrices, int quantity)
Get one time charge (if any) for the given range and quantity.
public int getSortOrder()
Get the attribute value sort order.
public ZMTaxRate getTaxRate()
Get the tax rate.
public double getValuePrice(boolean tax)
Get the value price.
true to include tax (if applicable); default is true.public double getWeight()
Get the attribute weight.
public string getWeightPrefix()
Get the weight prefix.
public boolean hasImage()
Check if this value has an associated image.
true if an image is available, false if not.public boolean isDefault()
Check if this is the default value.
true if this is the default value, false if not.public boolean isDiscounted()
Check if this value is discounted.
true if this value is discounted, false if not.public boolean isDisplayOnly()
Check if the attribute is 'display only'.
true if the value is display only, false if not.public boolean isFree()
Check if the attribute is free.
true if the value is free, false if not.public boolean isIncludeInBasePrice()
Check if the base price is included.
true if the base price is included, false if not.public boolean isPriceFactorOneTime()
Check if the price factor is one time.
true if the price factor is one time only, false if not.public void setAttribute(ZMAttribute attribute)
Set the parent attribute.
public void setDefault(boolean value)
Set the default value flag.
true if this is the default value, false if not.public void setDiscounted(boolean value)
Set the is discounted flag.
true if this value is discounted, false if not.public void setDisplayOnly(boolean value)
Set the attribute is 'display only' flag.
true if the value is display only, false if not.public void setFree(boolean value)
Sheck the attribute free flag.
true if the value is free, false if not.public void setId(int id)
Set the attribute value id.
public void setImage(string image)
Set the attribute value image (if any).
public void setIncludeInBasePrice(boolean value)
Set the base price is included flag.
true if the base price is included, false if not.public void setName(string name)
Set the attribute value name.
public void setOneTimePrice(double oneTimePrice)
Set the values one time price.
public void setPriceFactorOneTime(boolean value)
Set the price factor is one time flag.
true if the price factor is one time only, false if not.public void setPricePrefix(string pricePrefix)
Set the price prefix.
public void setSortOrder(int sortOrder)
Set the attribute value sort order.
public void setTaxRate(ZMTaxRate taxRate)
Set the tax rate.
public void setValuePrice(double price)
Set the value price.
public double setWeight(mixed weight)
Set the attribute weight.
public void setWeightPrefix(string weightPrefix)
Set the weight prefix.
A single attribute value.
For attributes that accept user input (text/upload), the name will be replaced with the entered data to allow handling all values the same way.