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(int $basketRowId):BasketItem

Gets an existing item by ID in the shopping cart of the current customer session.

Parameters
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.

Parameters
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.

Parameters
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.

Parameters
int $basketItemId The ID of the item in the shopping cart
array $data The item's data
public removeBasketItem(int $basketItemId):void

Deletes an item from the shopping cart. The ID of the item must be specified.

Parameters
int $basketItemId The ID of the item in the shopping cart

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():Basket

Gets the shopping cart from current customer session.

public save(array $data):void
Parameters
array $data
public setCouponCode(string $couponCode):Basket
Parameters
string $couponCode
public removeCouponCode():Basket

Exceptions

BasketCheckException

Class BasketCheckException

Namespace

Plenty\Modules\Basket\Exceptions

Methods

public __construct(string $code, string $message = "", Exception
 $previous = null):void

BasketItemCheckException constructor.

Parameters
string $code
string $message
Exception $previous

BasketItemCheckException

Created by ptopczewski, 12.05.16 09:03 Class BasketItemCheckException

Namespace

Plenty\Modules\Basket\Exceptions

Methods

public __construct(int $code = 404, string $message = "", Exception
 $previous = null):void

BasketItemCheckException constructor.

Parameters
int $code
string $message
Exception $previous

BasketItemQuantityCheckException

Created by ptopczewski, 17.05.16 09:37 Class BasketItemQuantityCheckException

Namespace

Plenty\Modules\Basket\Exceptions

Methods

public __construct(int $code, int $variationId, float $requestedQuantity, string $message = "", Exception
 $previous = null):void

BasketItemQuantityCheckException constructor.

Parameters
int $code
int $variationId
float $requestedQuantity
string $message
Exception $previous
public getVariationId():int
public getRequestedQuantity():float

Models

Basket

The basket model

Namespace

Plenty\Modules\Basket\Models

Properties

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:
  • Discount scale based on net value of items = 4
  • Discount based on method of payment = 5
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

Methods

public toArray()

Returns this model as an array.

BasketItem

The basket item model

Namespace

Plenty\Modules\Basket\Models

Properties

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

Methods

public toArray()

Returns this model as an array.

BasketItemParams

The basket item params model

Namespace

Plenty\Modules\Basket\Models

Properties

Type Name Description
string type
string name
string value
int basketItemId
int propertyId

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
public setHasValidCoupon(bool $hasValidCoupon):void
Parameters
bool $hasValidCoupon Flag that indicates if a valid coupon has been used.
public getBasket():Basket
public getLocationId():int
public setLocationId(int $locationId):Basket
Parameters
int $locationId The ID of the location
public getInvoiceAddress():Address
public setInvoiceAddress(Address
 $invoiceAddress):Basket
Parameters
Address $invoiceAddress The invoice address
public getMaxFsk():int
public setMaxFsk(int $maxFsk):Basket
Parameters
int $maxFsk The highest value for age restriction of an item in the shopping cart
public getShippingCosts():float
public setShippingCosts(float $shippingCosts):Basket
Parameters
float $shippingCosts 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():Basket

BasketItem

AfterBasketItemAdd

The event is triggered after an item is added to the shopping cart.

Namespace

Plenty\Modules\Basket\Events\BasketItem

Methods

public getBasketItem():BasketItem

AfterBasketItemRemove

The event is triggered after an item is deleted from the shopping cart.

Namespace

Plenty\Modules\Basket\Events\BasketItem

AfterBasketItemUpdate

The event is triggered after an item in the shopping cart is updated.

Namespace

Plenty\Modules\Basket\Events\BasketItem

BeforeBasketItemAdd

The event is triggered before an item is created in the shopping cart.

Namespace

Plenty\Modules\Basket\Events\BasketItem

Methods

public getBasketItem():BasketItem

BeforeBasketItemRemove

The event is triggered before an item is deleted from the shopping cart.

Namespace

Plenty\Modules\Basket\Events\BasketItem

BeforeBasketItemUpdate

The event is triggered before an item in the shopping cart is updated.

Namespace

Plenty\Modules\Basket\Events\BasketItem

Methods

public getBasketItem():BasketItem