BasketService extends Service
in package
Uses ServiceTrait

This is the basket service class.

This class will retrieve the baskets from LogiCommerce API and transform them to objects. All the needed baskets operations previous to Framework must be done here.

Tags
see
BasketService::addBundle()
see
BasketService::addProduct()
see
BasketService::addVoucherCode()
see
BasketService::clear()
see
BasketService::comment()
see
BasketService::deleteRow()
see
BasketService::deleteVoucherCode()
see
BasketService::editBundle()
see
BasketService::editProduct()
see
BasketService::getBasket()
see
BasketService::getCustomTags()
see
BasketService::getDeliveries()
see
BasketService::getLinkedProducts()
see
BasketService::getPaymentSystems()
see
BasketService::getPickingDeliveries()
see
BasketService::getRelatedItems()
see
BasketService::getShippingDeliveries()
see
BasketService::recalculate()
see
BasketService::redeemRewardPoints()
see
BasketService::setCustomTags()
see
BasketService::setPaymentSystem()
see
BasketService::setShippings()
see
Basket
see
BasketService::addGetBasket()
see
BasketService::addGetPaymentSystems()
see
BasketService::addGetDeliveries()
see
BasketService::addGetPickingDeliveries()
see
BasketService::addGetShippingDeliveries()
see
BasketService::addGetRelatedItems()
see
BasketService::addGetCustomTags()
see
BasketService::addGetLinkedProducts()
see
BatchRequests
see
Service
see
ServiceTrait
uses
ServiceTrait

Table of Contents

DELETE  = \SDK\Core\Enums\MethodType::DELETE
GET  = \SDK\Core\Enums\MethodType::GET
ITEMS  = 'items'
POST  = \SDK\Core\Enums\MethodType::POST
PUT  = \SDK\Core\Enums\MethodType::PUT
addBundle() Add bundle to basket  : Basket|null
addGetBasket() Add the request to get the user basket  : void
addGetCustomTags() Add the request to get the basket available custom tags and their values  : void
addGetDeliveries() Add the request to get the basket available deliveries  : void
addGetLinkedProducts() Add the request to get products linked to the cart  : ElementCollection|null
addGetPaymentSystems() Add the request to get the basket available payment systems  : void
addGetPickingDeliveries() Add the request to get the basket available physical locations  : void
addGetRelatedItems() Add the request to get the basket related items  : void
addGetShippingDeliveries() Add the request to get the basket available shippings  : void
addLinked() Add linked product to the cart.  : Basket|null
addProduct() Add product to basket  : Basket|null
addProducts() Add products to basket  : ResponseAddFillProductCollection|null
addVoucherCode() Add voucher code to basket  : Basket|null
clear() Clear basket  : Basket|null
comment() Put a comment on the current user's basket  : Basket|null
deleteRow() Delete basket row  : Basket|null
deleteRows() Delete basket rows  : Basket|null
deleteVoucherCode() Delete voucher code from basket  : Basket|null
editBundle() Edit basket bundle  : Basket|null
editLinked() Edit linked product to the cart.  : Basket|null
editProduct() Edit basket product  : Basket|null
getBasket() Returns the user basket  : Basket|null
getCustomTags() Returns the custom tags filtered with the given parameters for the current basket  : ElementCollection|null
getDeliveries() Returns the basket available deliveries  : ElementCollection|null
getInstance() Returns the requested model instance.  : Service
getLinkedProducts() Returns the product linked to the cart  : ElementCollection|null
getPaymentSystems() Returns the basket available payment systems  : ElementCollection|null
getPickingDeliveries() Returns the basket available physical locations  : ElementCollection|null
getRelatedItems() Returns the basket related items  : ElementCollection|null
getShippingDeliveries() Returns the basket available shippings  : ElementCollection|null
recalculate() Recalculate and returns the user basket  : Basket|null
redeemRewardPoints() redeem reward points to basket  : Basket|null
setAddressesBook() Sets the basket addresses  : Basket|null
setCustomTags() Sets the basket custom tags  : Basket|null
setPaymentSystem() Sets the basket payment system  : Basket|null
setShippings() Sets the basket shipping methods  : Basket|null
__construct()  : mixed
call()  : array<string|int, mixed>
extractParameters()  : array<string|int, mixed>
getCollection()  : mixed
getConnection()  : Connection
getElement()  : Element|null
getElements()  : ElementCollection|null
getResourceElement()  : Element|null
getResponse()  : ElementCollection|null
prepareElement()  : Element|null
prepareElements()  : array<string|int, mixed>
replaceWildcards()  : string

Constants

DELETE

protected mixed DELETE = \SDK\Core\Enums\MethodType::DELETE

GET

protected mixed GET = \SDK\Core\Enums\MethodType::GET

ITEMS

protected mixed ITEMS = 'items'

POST

protected mixed POST = \SDK\Core\Enums\MethodType::POST

PUT

protected mixed PUT = \SDK\Core\Enums\MethodType::PUT

Methods

addGetBasket()

Add the request to get the user basket

public addGetBasket(BatchRequests $batchRequests, string $batchName) : void
Parameters
$batchRequests : BatchRequests
$batchName : string

the name that will identify the request on the batch return.

Return values
void

addGetCustomTags()

Add the request to get the basket available custom tags and their values

public addGetCustomTags(BatchRequests $batchRequests, string $batchName[, BasketCustomTagsParametersGroup $params = null ]) : void
Parameters
$batchRequests : BatchRequests
$batchName : string

the name that will identify the request on the batch return.

$params : BasketCustomTagsParametersGroup = null

object with the needed filters to send to the API basket resource

Return values
void

addGetDeliveries()

Add the request to get the basket available deliveries

public addGetDeliveries(BatchRequests $batchRequests, string $batchName[, DeliveriesParametersGroup $params = null ]) : void
Parameters
$batchRequests : BatchRequests
$batchName : string

the name that will identify the request on the batch return.

$params : DeliveriesParametersGroup = null

object with the needed data to send to the API basket resource

Return values
void

addGetPaymentSystems()

Add the request to get the basket available payment systems

public addGetPaymentSystems(BatchRequests $batchRequests, string $batchName) : void
Parameters
$batchRequests : BatchRequests
$batchName : string

the name that will identify the request on the batch return.

Return values
void

addGetPickingDeliveries()

Add the request to get the basket available physical locations

public addGetPickingDeliveries(BatchRequests $batchRequests, string $batchName[, DeliveriesParametersGroup $params = null ]) : void
Parameters
$batchRequests : BatchRequests
$batchName : string

the name that will identify the request on the batch return.

$params : DeliveriesParametersGroup = null

object with the needed data to send to the API basket resource

Return values
void

addGetRelatedItems()

Add the request to get the basket related items

public addGetRelatedItems(BatchRequests $batchRequests, string $batchName[, string $type = '' ][, RelatedItemsParametersGroup $params = null ]) : void
Parameters
$batchRequests : BatchRequests
$batchName : string

the name that will identify the request on the batch return.

$type : string = ''

Optional. This param will set the kind of related we want to retrieve. Valid values are inside RelatedItemsType class. If not given all the related items will be returned inside the RelatedItems object.

$params : RelatedItemsParametersGroup = null
Return values
void

addGetShippingDeliveries()

Add the request to get the basket available shippings

public addGetShippingDeliveries(BatchRequests $batchRequests, string $batchName) : void
Parameters
$batchRequests : BatchRequests
$batchName : string

the name that will identify the request on the batch return.

Return values
void

addVoucherCode()

Add voucher code to basket

public addVoucherCode(string $code) : Basket|null
Parameters
$code : string
Return values
Basket|null

comment()

Put a comment on the current user's basket

public comment(string $comment) : Basket|null
Parameters
$comment : string
Return values
Basket|null

deleteRow()

Delete basket row

public deleteRow(string $hash) : Basket|null
Parameters
$hash : string
Return values
Basket|null

deleteVoucherCode()

Delete voucher code from basket

public deleteVoucherCode(string $code) : Basket|null
Parameters
$code : string
Return values
Basket|null

getInstance()

Returns the requested model instance.

public static getInstance() : Service

If is not setted, this method will set it.

Return values
Service

getRelatedItems()

Returns the basket related items

public getRelatedItems([string $type = '' ][, RelatedItemsParametersGroup $params = null ]) : ElementCollection|null
Parameters
$type : string = ''

Optional. This param will set the kind of related we want to retrieve. Valid values are inside RelatedItemsType class. If not given all the related items will be returned inside the RelatedItems object.

$params : RelatedItemsParametersGroup = null
Return values
ElementCollection|null

__construct()

protected __construct() : mixed
Return values
mixed

call()

protected call(Request $request[, string $apiUrl = null ]) : array<string|int, mixed>
Parameters
$request : Request
$apiUrl : string = null
Return values
array<string|int, mixed>

extractParameters()

protected extractParameters([ParametersGroup|null $parametersGroup = null ]) : array<string|int, mixed>
Parameters
$parametersGroup : ParametersGroup|null = null
Return values
array<string|int, mixed>

getCollection()

protected getCollection(array<string|int, mixed> $data, string $class) : mixed
Parameters
$data : array<string|int, mixed>
$class : string
Return values
mixed

getElement()

protected getElement(string $class, string $resource[, int $id = null ][, mixed $params = null ]) : Element|null
Parameters
$class : string
$resource : string
$id : int = null
$params : mixed = null
Return values
Element|null

getResourceElement()

protected getResourceElement(string $class, string $resource[, mixed $params = [] ]) : Element|null
Parameters
$class : string
$resource : string
$params : mixed = []
Return values
Element|null

getResponse()

protected getResponse(array<string|int, mixed> $data, string $class) : ElementCollection|null
Parameters
$data : array<string|int, mixed>
$class : string
Return values
ElementCollection|null

prepareElement()

protected prepareElement(array<string|int, mixed> $data, string $class) : Element|null
Parameters
$data : array<string|int, mixed>
$class : string
Return values
Element|null

prepareElements()

protected prepareElements(array<string|int, mixed> $data, string $class) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
$class : string
Return values
array<string|int, mixed>

replaceWildcards()

protected replaceWildcards(string $resource, array<string|int, mixed> $wildcards) : string
Parameters
$resource : string
$wildcards : array<string|int, mixed>
Return values
string

Search results