ZMObject
|
+--ZMCoupon
public class ZMCoupon
extends ZMObject
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
ZMCoupon(int id, string code, string type) Create new instance |
|
| Method Summary | |
|---|---|
| float | Get the amount. |
| string | getCode() Get the coupon code. |
| string | Get the coupon description. |
| string | Get the coupon expiry date. |
| int | getId() Get the coupon id. |
| float | Get the minimum order amount. |
| string | getName() Get the coupon name. |
| array | Get coupon restrictions. |
| string | Get the coupon start date. |
| string | getType() Get the coupon type. |
| int | Get the uses per coupon. |
| int | Get the uses per coupon. |
| boolean | isActive() Check if this coupon is active. |
| boolean | Check if this a fixed amount coupon. |
| boolean | Check if this coupon qualifies for free shipping. |
| boolean | Check if this a percentage amount coupon. |
| void | setActive(string active) Set the active flag. |
| void | setAmount(float amount) Set the amount. |
| void | setCode(string code) Set the coupon code. |
| void | setDescription(string description) Set the coupon description. |
| void | setExpiryDate(string date) Set the coupon expiry date. |
| void | setId(int id) Set the coupon id. |
| void | setMinOrderAmount(float amount) Set the minimum order amount. |
| void | setName(string name) Set the coupon name. |
| void | setStartDate(string date) Set the coupon start date. |
| void | setType(string type) Set the coupon type. |
| void | setUsesPerCoupon(int uses) Set the uses per coupon. |
| void | setUsesPerUser(int uses) Set the uses per user. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public ZMCoupon(int id, string code, string type)
Create new instance
public float getAmount()
Get the amount.
public string getCode()
Get the coupon code.
public string getDescription()
Get the coupon description.
public string getExpiryDate()
Get the coupon expiry date.
public int getId()
Get the coupon id.
public float getMinOrderAmount()
Get the minimum order amount.
public string getName()
Get the coupon name.
public array getRestrictions()
Get coupon restrictions.
ZMCouponRestriction instances.public string getStartDate()
Get the coupon start date.
public string getType()
Get the coupon type.
public int getUsesPerCoupon()
Get the uses per coupon.
public int getUsesPerUser()
Get the uses per coupon.
public boolean isActive()
Check if this coupon is active.
true if this coupon is active.public boolean isFixedAmount()
Check if this a fixed amount coupon.
true if this coupon has a fixed amount assigned, false if not.public boolean isFreeShipping()
Check if this coupon qualifies for free shipping.
true if this coupon qualifies for free shipping, false if not.public boolean isPercentage()
Check if this a percentage amount coupon.
true if this coupon has a percentage amount assigned, false if not.public void setActive(string active)
Set the active flag.
public void setAmount(float amount)
Set the amount.
public void setCode(string code)
Set the coupon code.
public void setDescription(string description)
Set the coupon description.
public void setExpiryDate(string date)
Set the coupon expiry date.
public void setId(int id)
Set the coupon id.
public void setMinOrderAmount(float amount)
Set the minimum order amount.
public void setName(string name)
Set the coupon name.
public void setStartDate(string date)
Set the coupon start date.
public void setType(string type)
Set the coupon type.
public void setUsesPerCoupon(int uses)
Set the uses per coupon.
public void setUsesPerUser(int uses)
Set the uses per user.
A single coupon.
NOTE: Depending on the coupon type, not all values might be set.
For example, gift vouchers do only have a code and amount.