PHP 트레잇 LukePOLO\LaraCart\Traits\CouponTrait

상속: use trait CartOptionsMagicMethodsTrait
파일 보기 프로젝트 열기: lukepolo/laracart

공개 프로퍼티들

프로퍼티 타입 설명
$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