BasketService
This service class contains various methods used for manipulating the customers basket.
All public functions are available in the Twig template renderer.
Namespace
IO\Services
Type | Name | Description |
---|---|---|
|
This repository is used to manipulate basketItems |
|
|
This repository is used to manipulate the customers basket |
|
|
This service is used to manipulate the checkout |
|
|
This service provides methods for VAT related tasks |
|
|
This repository is used to manipulate Contacts |
|
|
This service provides functionality related to coupons |
|
|
This repository is used to read webstore configuration |
|
|
This repository is used to read and write data of the session |
|
|
Contains all current BasketItems |
|
|
Unused property Deprecated |
|
|
Methods
public __construct($basketItemRepository, $checkout, $vatService, $contactRepository, $basketRepository, $vatInitService, $couponService, $webstoreConfigurationRepository, $sessionStorageRepository)
BasketService constructor.
Type |
Name |
Description |
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
public setTemplate($template)
Deprecated!
This method will not be supported in the future. Please refrain from using it as soon as possible. |
Set the template property. Different templates need different data.
Type |
Name |
Description |
|
public getBasketForTemplate():array
Gets the basket object with relevant data for the template renderer
public getBasket():Basket
Return the basket model
public getTotalVats():array
Gets all VATs applied to the basket
Gets the total quantity of all basket items.
public getBasketItems():array
List the basket items
public getBasketItemsForOrder():array
List the basket items for order
public getBasketItemsForTemplate($template = "", $appendItemData = true):array
Get basket items with all relevant data for the template renderer.
Type |
Name |
Description |
|
Unused parameter (legacy purposes) |
|
|
Flag for adding item data to the basket items |
public checkBasketItemsLang($language = "")
Remove basket items not having a valid language for the current basket configuration.
Type |
Name |
Description |
|
The language in format ISO-639-1 |
public checkBasketItemsCurrency()
Deprecated!
Use checkBasketItemsByPrice instead |
Remove basket items not having a valid price for the current basket configuration (referrer, currency,.
public checkBasketItemsByPrice():int
Remove basket items not having a valid price for the current basket configuration (referrer, currency,.
public getBasketItem($basketItemId, $appendVariation = true):array
Get a basket item
Type |
Name |
Description |
|
The unique id of the basketItem |
|
|
Flag for appending itemData to the BasketItem |
public addBasketItem($data):array
Add an item to the basket or update the basket
Type |
Name |
Description |
|
Contains the basket item |
public updateBasketItem($basketItemId, $data):array
Update a basket item
Type |
Name |
Description |
|
The unique id of the basket item |
|
|
Contains the updated basket item |
public deleteBasketItem($basketItemId)
Delete an item from the basket
Type |
Name |
Description |
|
The unique id of the basketItem |
public findExistingOneByData($data):BasketItem
Check whether the item is already in the basket
Type |
Name |
Description |
|
Contains the basket item to search for |
public resetBasket()
Reset basket after execute payment / order created
public setBillingAddressId($billingAddressId)
Set the billing address id
Type |
Name |
Description |
|
public getBillingAddressId():int
Return the billing address id
public setDeliveryAddressId($deliveryAddressId)
Set the delivery address id
Type |
Name |
Description |
|
public getDeliveryAddressId():int
Return the delivery address id
public getMaxVatValue():float
Get the maximum vat value in basket.