CouponService

Namespace

IO\Services

Constants
Type Name Value Description

int

BELOW_MINIMAL_ORDER_VALUE

301

int

NO_VALID_ITEM_IN_BASKET

302

Properties
Type Name Description

CouponCampaignRepositoryContract

$couponCampaignRepository

BasketRepositoryContract

$basketRepository

VariationCategoryRepositoryContract

$variationCategoryRepository

AuthHelper

$authHelper

Methods
public __construct($couponCampaignRepository, $basketRepository, $variationCategoryRepository, $authHelper)

CouponService constructor.

Parameters

Type

Name

Description

CouponCampaignRepositoryContract

$couponCampaignRepository

BasketRepositoryContract

$basketRepository

VariationCategoryRepositoryContract

$variationCategoryRepository

AuthHelper

$authHelper

public setCoupon($couponCode)
Parameters

Type

Name

Description

``

$couponCode

public removeCoupon($code = null)
Parameters

Type

Name

Description

``

$code

public validateBasketItemDelete($basket, $basketItem)

Validate the basket for the coupon, and remove the coupon if invalid

Parameters

Type

Name

Description

Basket

$basket

array

$basketItem

Current basketItem

public validateBasketItemUpdate($basket, $data, $basketItem)

Validate the basket for the coupon, and remove the coupon if invalid

Parameters

Type

Name

Description

Basket

$basket

array

$data

New basketItem

array

$basketItem

Current basketItem