Adding products to the basket¶
To successfully add products to the basket you need to provide the required parameters.
|ses_basket[quantity]||YES||The quantity to be ordered. If empty the eZ Commerce will use 1 instead, as long as the parameter ses_basket[ses_ignore_quantity] is not set.|
|ses_basket[ses_ignore_quantity]||1||If set, eZ Commerce will not use 1 instead of empty quantity.|
|ses_basket[sku]||YES||The SKU to be ordered. A valid
|ses_basket[isVariant]||YES FOR VARIANTS||isVariant||Should be set if product is a variant.|
|ses_basket[ses_variant_code]||YES FOR VARIANTS||Variant code of the ordered variant.|
|ses_basket[updateNotPermitted]||1||Can be passed optionally, if you want to avoid updating the line with the given SKU.If set, a new basket line is created every time the user adds a product with the same SKU to the basket.|
Any other parameter that is set correctly will be passed to the basket and stored in the
The values are forwarded to the
priceRequest/ERP as well.
The form tag which is used for the basket box has to be moved to the
1 2 3 4 5 6
Data sent to the ERP¶
1 2 3 4 5
- It is not possible to use arrays in this case (e.g.
- The key (here
remark) must be a string and follow the rules for tag names, because the key is converted to a tag during a price request.
How to add one product to the basket?¶
Add to basket POST form:
1 2 3 4 5 6 7
How to add more products to the basket?¶
It is possible to add more than one product to the basket (e.g. in a product list) by using the index:
1 2 3
If you want to add more products to the basket (e.g. from the wishlist), you need one form around all lines that will add all lines to the basket at once, but you might also need to add only one single product from the list.
To add a single product to the basket, you need to define parent elements with the class
Example for using Ajax¶
You need to define one parent element with the class
One of these elements have to be placed inside a form!
.js-add-to-basket - use if you want to add one product to the basket.
.js-add-all-to-basket - use if you want to add more products to the basket at once
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Adding additional attributes to the basketline¶
Please note that an additional parameters should be a scalar value. Arrays are not supported.
Display the values in the basket template: