BuyXGetY
class BuyXGetY extends AbstractDiscountType (View source)
Properties
$discount | The instance of the discount. |
from AbstractDiscountType |
Methods
from
AbstractDiscountType
Collection
from
AbstractDiscountType
bool
from
AbstractDiscountType
from
AbstractDiscountType
int
usesByUser(Authenticatable $user)
Check how many times this discount has been used by the logged in user's customers
from
AbstractDiscountType
string
getName()
Return the name of the discount.
int
getRewardQuantity(int $linesQuantity, int $minQty, int $rewardQty, int $maxRewardQty = null)
Return the reward quantity for the discount
Details
AbstractDiscountType
with(Discount $discount)
Set the data for the discount to user.
AbstractDiscountType
markAsUsed(Cart $cart)
Mark a discount as used
protected Collection
getEligibleLines(Cart $cart)
Return the eligible lines for the discount.
protected bool
checkDiscountConditions(Cart $cart)
Check if discount's conditions met.
protected AbstractDiscountType
addDiscountBreakdown(Cart $cart, DiscountBreakdown $breakdown)
Check if discount's conditions met.
protected int
usesByUser(Authenticatable $user)
Check how many times this discount has been used by the logged in user's customers
string
getName()
Return the name of the discount.
int
getRewardQuantity(int $linesQuantity, int $minQty, int $rewardQty, int $maxRewardQty = null)
Return the reward quantity for the discount