Add a Dynamic Bundle to Cart
A Dynamic Bundle is a product bundle that has the bundle constituent selection rule set to "Select 1" or "Select n". This means that the shopper is allowed to select from a subset of the available bundle constituents when adding the bundle to the cart. This contrasts with a Fixed Bundle, which has the "Select All" bundle constituent selection rule set. If a shopper adds a Dynamic Bundle to their cart, they will be blocked from checking out until the constituent selections are made. The following message will appear on the purchaseform
resource:
"messages": [
{
"type": "needinfo",
"id": "bundle.does.not.contain.min.constituents",
"debug-message": "Bundle does not contain the minimum number of required bundle constituents.",
"linked-to": {
"uri": "/carts/mobee/gqztsmlemzrwmljymiytiljugbrdillbgu2tkllcgizgmyjxgm4tcmtemy=/lineitems/mnsdmylemqzgkljqmuztcljugnsdqljzge3tmljrgu4wkojymizggmjsmq=",
"href": "http://localhost:9080/cortex/carts/mobee/gqztsmlemzrwmljymiytiljugbrdillbgu2tkllcgizgmyjxgm4tcmtemy=/lineitems/mnsdmylemqzgkljqmuztcljugnsdqljzge3tmljrgu4wkojymizggmjsmq=",
"type": "carts.line-item"
},
"blocks": {
"rel": "submitorderaction"
},
"data": {
"current-quantity": "0",
"min-quantity": "1",
"item-code": "bundleWithPhysicalAndDigitalComponents_sku"
}
}
]
The shopping cart line item resource for the Dynamic Bundle will contain a dependentoptions
link, which contains element
links to each of the supported bundle constituent items. Those items will also have a addtobundleitemform
link, which allows the shopper to add the constituent to the bundle in the shopping cart.
Workflow
GET
a Dynamic Bundle itemGET
the item’saddtocartform
linkPOST
to theaddtodefaultcartaction
linkGET
thedependentoptions
link, with a zoom into theelement
linksGET
the selected item’saddtobundleitemform
linkPOST
to theaddtobundleitemaction
link