PHP Трейт LukePOLO\LaraCart\Traits\CouponTrait

Наследование: use trait CartOptionsMagicMethodsTrait
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$appliedToCart boolean

Открытые методы

Метод Описание
canApply ( ) : boolean Checks to see if we can apply the coupon.
checkMinAmount ( $minAmount, $throwErrors = true ) : boolean Checks the minimum subtotal needed to apply the coupon.
checkValidTimes ( Carbon\Carbon $startDate, Carbon\Carbon $endDate, $throwErrors = true ) : boolean Checks to see if the times are valid for the coupon.
getFailedMessage ( ) : null | string Gets the failed message for a coupon.
getMessage ( ) : string Get the reason why a coupon has failed to apply.
maxDiscount ( $maxDiscount, $discount, $throwErrors = true ) : mixed Returns either the max discount or the discount applied based on what is passed through.
setDiscountOnItem ( CartItem $item, $discountAmount ) Sets a discount to an item with what code was used and the discount amount.
setOptions ( $options ) Sets all the options for the coupon.

Описание методов

canApply() публичный Метод

Checks to see if we can apply the coupon.
public canApply ( ) : boolean
Результат boolean

checkMinAmount() публичный Метод

Checks the minimum subtotal needed to apply the coupon.
public checkMinAmount ( $minAmount, $throwErrors = true ) : boolean
$minAmount
$throwErrors
Результат boolean

checkValidTimes() публичный Метод

Checks to see if the times are valid for the coupon.
public checkValidTimes ( Carbon\Carbon $startDate, Carbon\Carbon $endDate, $throwErrors = true ) : boolean
$startDate Carbon\Carbon
$endDate Carbon\Carbon
$throwErrors
Результат boolean

getFailedMessage() публичный Метод

Gets the failed message for a coupon.
public getFailedMessage ( ) : null | string
Результат null | string

getMessage() публичный Метод

Get the reason why a coupon has failed to apply.
Устаревший: 1.3
public getMessage ( ) : string
Результат string

maxDiscount() публичный Метод

Returns either the max discount or the discount applied based on what is passed through.
public maxDiscount ( $maxDiscount, $discount, $throwErrors = true ) : mixed
$maxDiscount
$discount
$throwErrors
Результат mixed

setDiscountOnItem() публичный Метод

Sets a discount to an item with what code was used and the discount amount.
public setDiscountOnItem ( CartItem $item, $discountAmount )
$item LukePOLO\LaraCart\CartItem
$discountAmount

setOptions() публичный Метод

Sets all the options for the coupon.
public setOptions ( $options )
$options

Описание свойств

$appliedToCart публичное свойство

public bool $appliedToCart
Результат boolean