BasketService

Namespace

IO\Services

Properties
Type Name Description

BasketItemRepositoryContract

$basketItemRepository

BasketRepositoryContract

$basketRepository

Checkout

$checkout

VatService

$vatService

CustomerService

$customerService

CouponService

$couponService

WebstoreConfigurationService

$webstoreConfigurationService

``

$basketItems

``

$template

string

$pluginNamespace

Methods
public __construct($basketItemRepository, $checkout, $vatService, $customerService, $basketRepository, $vatInitService, $couponService, $webstoreConfigurationService)

BasketService constructor.

Parameters

Type

Name

Description

BasketItemRepositoryContract

$basketItemRepository

Checkout

$checkout

VatService

$vatService

CustomerService

$customerService

BasketRepositoryContract

$basketRepository

VatInitContract

$vatInitService

CouponService

$couponService

WebstoreConfigurationService

$webstoreConfigurationService

public setTemplate($template)
Parameters

Type

Name

Description

``

$template

public getBasketForTemplate()
public getBasket():Basket

Return the basket as an array

public getTotalVats():array
public getBasketQuantity()
public getBasketItems():array

List the basket items

public getBasketItemsForOrder():array

List the basket items for order

public getBasketItemsForTemplate()
public checkBasketItemsLang($template = "")
Parameters

Type

Name

Description

``

$template

public getBasketItem($basketItemId, $appendVariation = true):array

Get a basket item

Parameters

Type

Name

Description

int | BasketItem

$basketItemId

bool

$appendVariation

public addBasketItem($data):array

Add an item to the basket or update the basket

Parameters

Type

Name

Description

array

$data

public updateBasketItem($basketItemId, $data):array

Update a basket item

Parameters

Type

Name

Description

int

$basketItemId

array

$data

public deleteBasketItem($basketItemId)

Delete an item from the basket

Parameters

Type

Name

Description

int

$basketItemId

public findExistingOneByData($data):BasketItem

Check whether the item is already in the basket

Parameters

Type

Name

Description

array

$data

public resetBasket()
public setBillingAddressId($billingAddressId)

Set the billing address id

Parameters

Type

Name

Description

int

$billingAddressId

public getBillingAddressId():int

Return the billing address id

public setDeliveryAddressId($deliveryAddressId)

Set the delivery address id

Parameters

Type

Name

Description

int

$deliveryAddressId

public getDeliveryAddressId():int

Return the delivery address id

public getMaxVatValue():float

Get the maximum vat value in basket.