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.
Plenty\Modules\Basket\Contracts
public findOneById(int $basketRowId):BasketItem
Gets an existing item by ID in the shopping cart of the current customer session.
int | $basketRowId | The ID of the basket row |
public findExistingOneByData(array $data):BasketItem
Gets an existing item by item data in the shopping cart of the current customer session.
array | $data | The item's data |
public all():array
Lists all items in the shopping cart of the current customer session.
public addBasketItem(array $data):BasketItem
Creates an item with the specified item data in the shopping cart.
array | $data | The item's data |
public updateBasketItem(int $basketItemId, array $data):void
Updates an existing item in the shopping cart. The ID of the item and the data to be updated must be specified.
int | $basketItemId | The ID of the item in the shopping cart |
array | $data | The item's data |
public removeBasketItem(int $basketItemId, bool $dispatchAfterBasketChangedEvent = true):void
Deletes an item from the shopping cart. The ID of the item must be specified.
int | $basketItemId | The ID of the item in the shopping cart |
bool | $dispatchAfterBasketChangedEvent | The information if the AfterBasketChanged event should be dispatched |
The BasketRepositoryContract is the interface for the basket repository. This interface allows to get the shopping cart of the current customer session.
Plenty\Modules\Basket\Contracts
public load():Basket
Gets the shopping cart from current customer session.
public save(array $data):void
array | $data |
public setCouponCode(string $couponCode):Basket
string | $couponCode |
public removeCouponCode():Basket
Class BasketCheckException
Plenty\Modules\Basket\Exceptions
public __construct(string $code, string $message = "", Exception $previous = null):void
BasketCheckException constructor.
string | $code | |
string | $message | |
Exception | $previous |
Created by ptopczewski, 12.05.16 09:03 Class BasketItemCheckException
Plenty\Modules\Basket\Exceptions
public __construct(int $code = 404, string $message = "", Exception $previous = null, int $itemId, int $variationId, float $stockNet = 0.0, array $additionalData = []):void
BasketItemCheckException constructor.
int | $code | |
string | $message | |
Exception | $previous | |
int | $itemId | |
int | $variationId | |
float | $stockNet | |
array | $additionalData |
public getItemId():int
public getVariationId():int
public getStockNet():float
public getAdditionalData():array
Created by ptopczewski, 17.05.16 09:37 Class BasketItemQuantityCheckException
Plenty\Modules\Basket\Exceptions
public __construct(int $code, string $message = "", Exception $previous = null, int $itemId, int $variationId, float $requestedQuantity = 0.0, float $specifiedQuantity = 0.0):void
BasketItemQuantityCheckException constructor.
int | $code | |
string | $message | |
Exception | $previous | |
int | $itemId | |
int | $variationId | |
float | $requestedQuantity | |
float | $specifiedQuantity |
public getRequestedQuantity():float
public getSpecifiedQuantity():float
The basket model
Plenty\Modules\Basket\Models
Type | Name | Description |
---|---|---|
int | 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. |
string | sessionId | The ID of the current customer session |
int | orderId | The ID of the order |
int | customerId | The ID of the customer |
int | customerInvoiceAddressId | The ID of the customer's invoice address |
int | customerShippingAddressId | The ID of the customer's shipping address |
string | currency | The currency |
float | referrerId | The ID of the order referrer |
int | shippingCountryId | The ID of the shipping country |
int | methodOfPaymentId | The ID of the payment method |
int | shippingProviderId | The ID of the shipping provider |
int | shippingProfileId | The ID of the shipping profile |
float | itemSum | The gross value of items in the shopping cart |
float | itemSumNet | The net value of items in the shopping cart |
float | basketAmount | The total gross value of the shopping cart |
float | basketAmountNet | The total net value of the shopping cart |
float | shippingAmount | The gross shipping costs |
float | shippingAmountNet | The net shipping costs |
float | paymentAmount | The amount of the payment |
string | couponCode | The entered coupon code |
float | couponDiscount | The received discount due to the coupon code |
bool | 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. |
float | 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. |
int | basketRebateType | The discount type. The following types are available:
|
int | maxFsk | The age rating |
int | orderTimestamp | The timestamp of the order |
string | createdAt | The date that the shopping cart was created. |
string | updatedAt | The date that the shopping cart was updated last. |
basketItems |
public toArray()
Returns this model as an array.
The basket item model
Plenty\Modules\Basket\Models
Type | Name | Description |
---|---|---|
int | id | The ID of the item in the shopping cart |
int | 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. |
string | sessionId | The ID of the current customer session |
int | orderRowId | |
float | quantity | The current quantity of the item |
float | quantityOriginally | The initial quantity of the item |
int | itemId | The ID of the item |
int | priceId | The ID of the item price |
int | attributeValueSetId | The ID of the attribute value set |
int | rebate | The discount on the item |
float | vat | The VAT |
float | price | The item price |
float | givenPrice | |
bool | useGivenPrice | |
int | inputWidth | The width of the item |
int | inputLength | The length of the item |
int | inputHeight | The height of the item |
int | itemType | The item type |
string | externalItemId | The external variation ID |
bool | noEditByCustomer | Shows whether the item was edited by the customer |
int | costCenterId | |
int | giftPackageForRowId | |
int | position | The item position |
string | size | The item size |
int | shippingProfileId | The ID of the shipping profile |
float | referrerId | The ID of the order referrer |
string | deliveryDate | The delivery date |
int | categoryId | The ID of the item category |
int | reservationDatetime | |
int | variationId | The ID of the item variation |
int | bundleVariationId | The ID of the item bundle type |
string | createdAt | The date that the shopping cart was created |
string | updatedAt | The date that the shopping cart was updated last |
float | attributeTotalMarkup | attribute total markup |
array | basketItemOrderParams | Array of BasketItemParams |
public toArray()
Returns this model as an array.
The basket item params model
Plenty\Modules\Basket\Models
Type | Name | Description |
---|---|---|
string | type | |
string | name | |
string | value | |
int | basketItemId | |
int | propertyId |
public toArray()
Returns this model as an array.
The event is triggered after the shopping cart is changed.
Plenty\Modules\Basket\Events\Basket
public hasValidCoupon():bool
public getCouponValidationError():void
public setHasValidCoupon(bool $hasValidCoupon, ValidationException $couponValidationError = null):void
bool | $hasValidCoupon | Flag that indicates if a valid coupon has been used. |
ValidationException | $couponValidationError | Validation errors indicating the reasons for an invalid coupon. |
public getBasket():Basket
public getLocationId():int
public setLocationId(int $locationId):Basket
int | $locationId | The ID of the location |
public getInvoiceAddress():Address
public setInvoiceAddress(Address $invoiceAddress):Basket
Address | $invoiceAddress | The invoice address |
public getMaxFsk():int
public setMaxFsk(int $maxFsk):Basket
int | $maxFsk | The highest value for age restriction of an item in the shopping cart |
public getShippingCosts():float
public setShippingCosts(float $shippingCosts):Basket
float | $shippingCosts | The shipping costs of the shopping cart |
The event is triggered after the shopping cart is created.
Plenty\Modules\Basket\Events\Basket
public getBasket():Basket
The event is triggered after an item is added to the shopping cart.
Plenty\Modules\Basket\Events\BasketItem
public getBasketItem():BasketItem
The event is triggered after an item is deleted from the shopping cart.
Plenty\Modules\Basket\Events\BasketItem
public getBasketItem():BasketItem
The event is triggered after an item in the shopping cart is updated.
Plenty\Modules\Basket\Events\BasketItem
public getBasketItem():BasketItem
BasketItemEvent
Plenty\Modules\Basket\Events\BasketItem
public getBasketItem():BasketItem
The event is triggered before an item is created in the shopping cart.
Plenty\Modules\Basket\Events\BasketItem
public getBasketItem():BasketItem
The event is triggered before an item is deleted from the shopping cart.
Plenty\Modules\Basket\Events\BasketItem
public getBasketItem():BasketItem
The event is triggered before an item in the shopping cart is updated.
Plenty\Modules\Basket\Events\BasketItem
public getBasketItem():BasketItem