Plentymarkets interface documentation
Basket
Contracts
BasketItemRepositoryContract
The BasketItemRepositoryContract is the interface for the basket item repository. This interface allows to list, add, update and delete items from the shopping cart of the current customer session.
Namespace
Plenty\Modules\Basket\Contracts
Methods
public findOneById($basketRowId):Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
Gets an existing item by ID in the shopping cart of the current customer session.
Name |
Type |
Description |
|
The ID of the basket row |
public findExistingOneByData($data):Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
Gets an existing item by item data in the shopping cart of the current customer session.
Name |
Type |
Description |
|
The item’s data |
public findAllExistingOneByData($data):array
Gets all existing item by item data in the shopping cart of the current customer session.
Name |
Type |
Description |
|
The item’s data |
public all():array
Lists all items in the shopping cart of the current customer session.
public getBasketItemQuantity():float
Returns a sum of quantities for all basket items of the current customer session.
public addBasketItem($data, $fireEvents = true):Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
Creates an item with the specified item data in the shopping cart.
Name |
Type |
Description |
|
The item’s data |
|
|
Set to false to skip change events and calculation of basket totals. |
public updateBasketItem($basketItemId, $data, $fireEvents = true):void
Updates an existing item in the shopping cart. The ID of the item and the data to be updated must be specified.
Name |
Type |
Description |
|
The ID of the item in the shopping cart |
|
|
The item’s data |
|
|
Set to false to skip change events and calculation of basket totals. |
public removeBasketItem($basketItemId, $dispatchAfterBasketChangedEvent = true):void
Deletes an item from the shopping cart. The ID of the item must be specified.
Name |
Type |
Description |
|
The ID of the item in the shopping cart |
|
|
The information if the AfterBasketChanged event should be dispatched |
BasketRepositoryContract
The BasketRepositoryContract is the interface for the basket repository. This interface allows to get the shopping cart of the current customer session.
Namespace
Plenty\Modules\Basket\Contracts
Methods
public load($forceCreate = false):Plenty\Modules\Basket\Models\Basket
Return type: Basket
Gets the shopping cart from current customer session.
Name |
Type |
Description |
|
Flag to create a basket in database if not exist. |
public save($data):void
Save the current shopping cart data.
Name |
Type |
Description |
|
public setCouponCode($couponCode):Plenty\Modules\Basket\Models\Basket
Return type: Basket
Add a coupon code to the shopping cart.
Name |
Type |
Description |
|
public removeCouponCode():Plenty\Modules\Basket\Models\Basket
Return type: Basket
Remove a coupon code from the shopping cart.
public deleteBasket():Plenty\Modules\Basket\Models\Basket
Exceptions
BasketItemCheckException
Created by ptopczewski, 12.05.16 09:03 Class BasketItemCheckException
Namespace
Plenty\Modules\Basket\Exceptions
Methods
public __construct($code = 404, $message = "", $previous = null, $itemId, $variationId, $stockNet = 0.0, $additionalData = []):void
BasketItemCheckException constructor.
Name |
Type |
Description |
|
||
|
||
|
||
|
||
|
||
|
||
|
public getItemId():int
public getVariationId():int
public getStockNet():float
public getAdditionalData():array
BasketItemQuantityCheckException
Created by ptopczewski, 17.05.16 09:37 Class BasketItemQuantityCheckException
Namespace
Plenty\Modules\Basket\Exceptions
Methods
public __construct($code, $message = "", $previous = null, $itemId, $variationId, $requestedQuantity = 0.0, $specifiedQuantity = 0.0):void
BasketItemQuantityCheckException constructor.
Name |
Type |
Description |
|
||
|
||
|
||
|
||
|
||
|
||
|
public getRequestedQuantity():float
public getSpecifiedQuantity():float
Models
Basket
The shopping cart model
Namespace
Plenty\Modules\Basket\Models
Name | Type | Description |
---|---|---|
id |
The ID of the shopping cart. The ID increases by 1 when a new customer enters the online store and adds an item to the shopping cart. |
|
sessionId |
The ID of the current customer session |
|
orderId |
The ID of the order |
|
customerId |
The ID of the customer |
|
customerInvoiceAddressId |
The ID of the customer’s invoice address |
|
customerShippingAddressId |
The ID of the customer’s shipping address |
|
currency |
The currency |
|
referrerId |
The ID of the order referrer |
|
shippingCountryId |
The ID of the shipping country |
|
methodOfPaymentId |
The ID of the payment method |
|
shippingProviderId |
The ID of the shipping provider |
|
shippingProfileId |
The ID of the shipping profile |
|
itemSum |
The gross value of items in the shopping cart |
|
itemSumNet |
The net value of items in the shopping cart |
|
basketAmount |
The total gross value of the shopping cart |
|
basketAmountNet |
The total net value of the shopping cart |
|
shippingAmount |
The gross shipping costs |
|
shippingAmountNet |
The net shipping costs |
|
paymentAmount |
The amount of the payment |
|
couponCode |
The entered coupon code |
|
couponDiscount |
The received discount due to the coupon code |
|
shippingDeleteByCoupon |
Shows whether the shipping costs are subtracted due to a coupon code. Shopping carts that are free of shipping costs have the value true. |
|
basketRebate |
The discount to the shopping cart value. The discount can either be set as a discount scale for items, as a customer class discount or as a discount based on the payment method. |
|
basketRebateType |
The discount type. The following types are available: <ul> <li>Discount scale based on net value of items = 4</li> <li> Discount based on method of payment = 5</li> </ul> |
|
maxFsk |
The age rating |
|
orderTimestamp |
The timestamp of the order |
|
createdAt |
The date that the shopping cart was created. |
|
updatedAt |
The date that the shopping cart was updated last. |
|
basketItems |
Methods
public toArray()
Returns this model as an array.
BasketItem
The shopping cart item model
Namespace
Plenty\Modules\Basket\Models
Name | Type | Description |
---|---|---|
id |
The ID of the item in the shopping cart |
|
basketId |
The ID of the shopping cart. The ID increases by 1 when a new customer enters the online store and adds an item to the shopping cart. |
|
sessionId |
The ID of the current customer session |
|
orderRowId |
||
quantity |
The current quantity of the item |
|
quantityOriginally |
The initial quantity of the item |
|
itemId |
The ID of the item |
|
priceId |
The ID of the item price |
|
attributeValueSetId |
The ID of the attribute value set |
|
rebate |
The discount on the item |
|
vat |
The VAT |
|
price |
The item price |
|
givenPrice |
The given item price |
|
givenVatId |
The given vat id. |
|
useGivenPrice |
The flag to use the given values |
|
inputWidth |
The width of the item |
|
inputLength |
The length of the item |
|
inputHeight |
The height of the item |
|
itemType |
The item type |
|
externalItemId |
The external variation ID |
|
noEditByCustomer |
Shows whether the item was edited by the customer |
|
costCenterId |
||
giftPackageForRowId |
||
position |
The item position |
|
size |
The item size |
|
shippingProfileId |
The ID of the shipping profile |
|
referrerId |
The ID of the order referrer |
|
deliveryDate |
The delivery date |
|
categoryId |
The ID of the item category |
|
reservationDatetime |
||
variationId |
The ID of the item variation |
|
bundleVariationId |
The ID of the item bundle type |
|
createdAt |
The date that the shopping cart was created |
|
updatedAt |
The date that the shopping cart was updated last |
|
attributeTotalMarkup |
attribute total markup |
|
basketItemOrderParams |
Array of BasketItemParams |
|
basketItemVariationProperties |
Array of BasketItemVariationProperties |
Methods
public toArray()
Returns this model as an array.
Events
Basket
AfterBasketChanged
The event is triggered after the shopping cart is changed.
Namespace
Plenty\Modules\Basket\Events\Basket
Methods
public hasValidCoupon():bool
Get information if the current shopping cart has a valid coupon.
public getCouponValidationError():Plenty\Exceptions\ValidationException
Return type: ValidationException
Get the validation errors from a failed attempt to add a coupon to the shopping cart.
public setHasValidCoupon($hasValidCoupon, $couponValidationError = null):void
Set if the shopping cart has a valid coupon.
Name |
Type |
Description |
|
Flag that indicates if a valid coupon has been used. |
|
|
Validation errors indicating the reasons for an invalid coupon. |
public getBasket():Plenty\Modules\Basket\Models\Basket
Return type: Basket
Get the current shopping cart.
public getLocationId():int
Get the location ID from the current shopping cart.
public setLocationId($locationId):Plenty\Modules\Basket\Events\Basket\AfterBasketChanged
Return type: AfterBasketChanged
Set the location of the current shopping cart.
Name |
Type |
Description |
|
The ID of the location |
public getInvoiceAddress():Plenty\Modules\Account\Address\Models\Address
Return type: Address
Get the invoice address of the current shopping cart.
public setInvoiceAddress($invoiceAddress):Plenty\Modules\Basket\Events\Basket\AfterBasketChanged
Return type: AfterBasketChanged
Set the invoice address to the currrent shopping cart.
Name |
Type |
Description |
|
The invoice address |
public getMaxFsk():int
Get the highest value for age restriction of all items in the shopping cart.
public setMaxFsk($maxFsk):Plenty\Modules\Basket\Events\Basket\AfterBasketChanged
Return type: AfterBasketChanged
Set the highest value for age restriction of all items in the shopping cart.
Name |
Type |
Description |
|
The highest value for age restriction of an item in the shopping cart. |
public getShippingCosts():float
Get the shipping costs of the shopping cart.
public setShippingCosts($shippingCosts):Plenty\Modules\Basket\Events\Basket\AfterBasketChanged
Return type: AfterBasketChanged
Set the shipping costs of the shopping cart.
Name |
Type |
Description |
|
The shipping costs of the shopping cart |
AfterBasketCreate
The event is triggered after the shopping cart is created.
Namespace
Plenty\Modules\Basket\Events\Basket
Methods
public getBasket():Plenty\Modules\Basket\Models\Basket
Return type: Basket
Get the current shopping cart.
BasketItem
AfterBasketItemAdd
The event is triggered after an item is added to the shopping cart.
Namespace
Plenty\Modules\Basket\Events\BasketItem
Methods
public getBasketItem():Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
The shopping cart item that has changed.
AfterBasketItemRemove
The event is triggered after an item is deleted from the shopping cart.
Namespace
Plenty\Modules\Basket\Events\BasketItem
Methods
public getBasketItem():Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
The shopping cart item that has changed.
AfterBasketItemUpdate
The event is triggered after an item in the shopping cart is updated.
Namespace
Plenty\Modules\Basket\Events\BasketItem
Methods
public getBasketItem():Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
The shopping cart item that has changed.
BasketItemEvent
An event fired if something changes concerning the shoppping cart items
Namespace
Plenty\Modules\Basket\Events\BasketItem
Methods
public getBasketItem():Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
The shopping cart item that has changed.
BeforeBasketItemAdd
The event is triggered before an item is created in the shopping cart.
Namespace
Plenty\Modules\Basket\Events\BasketItem
Methods
public getBasketItem():Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
The shopping cart item that has changed.
BeforeBasketItemRemove
The event is triggered before an item is deleted from the shopping cart.
Namespace
Plenty\Modules\Basket\Events\BasketItem
Methods
public getBasketItem():Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
The shopping cart item that has changed.
BeforeBasketItemUpdate
The event is triggered before an item in the shopping cart is updated.
Namespace
Plenty\Modules\Basket\Events\BasketItem
Methods
public getCategoryRebateForBasketItem():void
public getBasketItem():Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
The shopping cart item that has changed.