Confirm delivery bag selection
Accepts the delivery bag product SKU and (optionally) a quantity. Calculates the final number of bags based on the DELIVERY_BAGS_CONF settings and stores the result in pre_order.data. This is an independent page — submitting it does not advance the checkout flow.
Fields:
product: SKU of the bag product. Must matchDELIVERY_BAGS_CONF.sku. Must be an active product withproduct_type = miscellaneous.quantity: Number of bags requested by the user. Only applicable whenDELIVERY_BAGS_CONF.is_quantity_changeableistrue. Must be>= DELIVERY_BAGS_CONF.min_quantity. Defaults to0if omitted (falls back tomin_quantity).
Quantity Calculation:
When
is_quantity_changeableisfalse: quantity is auto-calculated asceil(total_amount / per_amount), floored atmin_quantity. Items with theexclude_bag_attribute_nameattribute are excluded from the total amount.When
is_quantity_changeableistrue: the submittedquantityvalue is used directly.
State Update:
pre_order.data['bags']: list of the bag product repeatedbags_counttimes.pre_order.data['bags_fee']: calculated delivery bags fee.
Backward Navigation:
When navigating backward,
bagsandbags_feeare removed frompre_order.data.
Next Pages:
No further checkout page (
EmptyPage)
Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.
XMLHttpRequestPossible values: Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)
SKU of the delivery bag product. Must match the SKU configured in
DELIVERY_BAGS_CONF.sku. The product must be active and have
product_type = miscellaneous.
DELIVERY-BAG-001Number of bags requested by the user. Only used when
DELIVERY_BAGS_CONF.is_quantity_changeable is true. Must be greater than
or equal to DELIVERY_BAGS_CONF.min_quantity. Defaults to 0 if omitted,
which falls back to min_quantity. Raises a validation error if
is_quantity_changeable is false and a non-zero value is submitted.
3Delivery bag selection confirmed or validation error
POST /orders/checkout/?page=DeliveryBagsPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 30
"product='DELIVERY-BAG-001'"Delivery bag selection confirmed or validation error
{
"context_list": [
{
"page_name": "DeliveryBagsPage",
"page_slug": "deliverybagspage",
"page_context": {
"bags_fee": "5.99"
}
}
],
"pre_order": {
"user_email": "user@akinon.com"
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

