\Discount_Service

سرویس تخفیف‌ها را برای ماژولهای داخلی سیستم ایجاد می کند.

Summary

Methods
Properties
Constants
discountIsExist()
discountIsValid()
getPrice()
consumeDiscount()
engines()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

discountIsExist()

discountIsExist(string  $code) : boolean

Checks if discount with given code is exists.

Parameters

string $code

Returns

boolean

discountIsValid()

discountIsValid(string  $code) : boolean

Checks if discount with given code is valid.

Parameters

string $code

Returns

boolean

getPrice()

getPrice(integer  $originPrice, string  $discountCode, \Pluf_HTTP_Request  $request) : integer

Computes and returns new price after using given discount

Parameters

integer $originPrice
string $discountCode
\Pluf_HTTP_Request $request

Returns

integer

consumeDiscount()

consumeDiscount(string  $discountCode) : \Discount_Discount

Decrease one unit of given discount.

If discount is one-time-use it will be invalid after this function.

Parameters

string $discountCode

Returns

\Discount_Discount

engines()

engines() : 

فهرست موتورهای تخفیف موجود را تعیین می‌کند

Returns