ZMObject
|
+--ZMOffers
public class ZMOffers
extends ZMObject
| Field Summary | |
|---|---|
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| final mixed | |
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
Create new instance. |
|
| Method Summary | |
|---|---|
| float | calculateDiscount(float amount) Calculate discount for either product or the given amount (for example to calculate discounts on attributes). |
| protected void | Calculate the (best) price. |
| protected void | Calculate the base price. |
| protected void | Calculate the discount price. |
| float | getBasePrice(boolean tax) Get the base price; this is the lowest possible product price. |
| float | getCalculatedPrice(boolean tax) Get the calculated price. |
| float | Get the discount amount. |
| float | Get the discount as percent value. |
| float | getProductPrice(boolean tax) Get the product price. |
| array | getQuantityDiscounts(boolean tax) Get quantity discounts, if any. |
| float | getSalePrice(boolean tax) Get the discount price. |
| float | getSpecialPrice(boolean tax) Get the special price. |
| float | Get the tax rate for the product. |
| boolean | Checks if there are attribute prices that will affect the final price. |
| boolean | isSale() Checks if a sale price is available. |
| boolean | Checks if a special price is available. |
| void | setProduct(ZMProduct product) Set the product. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public final mixed $DISCOUNT_FROM_BASE_PRICE
public final mixed DISCOUNT_FROM_SPECIAL_PRICE = 1
public final mixed DISCOUNT_TYPE_AMOUNT = 3
public final mixed $DISCOUNT_TYPE_NONE
public final mixed DISCOUNT_TYPE_PERCENT = 1
public final mixed DISCOUNT_TYPE_PRICE = 2
public final mixed $SALE_TYPE_AMOUNT
public final mixed SALE_TYPE_PERCENT = 1
public final mixed SALE_TYPE_PRICE = 2
public ZMOffers(ZMProduct product)
Create new instance.
public float calculateDiscount(float amount)
Calculate discount for either product or the given amount (for example to calculate discounts on attributes).
null to calculate the discount
* of the product price.protected void calculatePrice()
Calculate the (best) price. /
protected void doGetBasePrice()
Calculate the base price. /
protected void doGetSalePrice()
Calculate the discount price. /
public float getBasePrice(boolean tax)
Get the base price; this is the lowest possible product price.
The base price consists of the product price plus the lowest attribute price (if any).
true to include tax (if applicable); default is true.public float getCalculatedPrice(boolean tax)
Get the calculated price.
This is the actual price, taking into account if sale or discount are available.
true to include tax (if applicable); default is true.public float getDiscountAmount()
Get the discount amount.
public float getDiscountPercent()
Get the discount as percent value.
public float getProductPrice(boolean tax)
Get the product price.
This is the price as configured in the database.
true to include tax (if applicable); default is true.public array getQuantityDiscounts(boolean tax)
Get quantity discounts, if any.
true to include tax (if applicable); default is true.ZMQuantityDiscount instances.public float getSalePrice(boolean tax)
Get the discount price.
This price is the price as set up with the sales maker in the admin interface.
true to include tax (if applicable); default is true.public float getSpecialPrice(boolean tax)
Get the special price.
Special price as configured.
true to include tax (if applicable); default is true.public float getTaxRate()
Get the tax rate for the product.
public boolean isAttributePrice()
Checks if there are attribute prices that will affect the final price.
true if attribute prices exist.public boolean isSale()
Checks if a sale price is available.
true if a sale price is available.public boolean isSpecial()
Checks if a special price is available.
true if a special price is available.public void setProduct(ZMProduct product)
Set the product.
All stuff related to product prices and offers.