CouponService
This service class contains functions related to coupons in the basket.
All public functions are available in the Twig template renderer.
Namespace
IO\Services
Type | Name | Value | Description |
---|---|---|---|
|
301 |
||
|
302 |
Type | Name | Description |
---|---|---|
|
||
|
||
|
||
|
Methods
public __construct($couponCampaignRepository, $basketRepository, $variationCategoryRepository, $authHelper)
CouponService constructor.
Type |
Name |
Description |
|
||
|
||
|
||
|
public setCoupon($couponCode):Basket
Setter for couponCode
Type |
Name |
Description |
|
Code representing a coupon |
public removeCoupon($code = null):Basket
Remove the coupon code from the basket and optionally throw a notification with a code.
Type |
Name |
Description |
|
Optional: Error code for notification |
public checkCoupon($basket):array
Get a basket with applied coupon discounts
Type |
Name |
Description |
|
The basket |
public validateBasketItemDelete($basket, $basketItem)
Deprecated!
since 5.0.9. Validation is handled b the plentymarkets core from now. |
Validate the basket for the coupon, and remove the coupon if invalid
Type |
Name |
Description |
|
The basket |
|
|
Current basketItem |
public validateBasketItemUpdate($basket, $data, $basketItem)
Deprecated!
since 5.0.9. Validation is handled b the plentymarkets core from now. |
Validate the basket for the coupon, and remove the coupon if invalid
Type |
Name |
Description |
|
The Basket |
|
|
New basketItem |
|
|
Current basketItem |
public effectsOnShippingCosts($campaign):bool
Checks, if the coupon's discount changes shipping costs.
Type |
Name |
Description |
|
Contains information about the campaign |