cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How can I automate the process to add products to a bundle in hybris add to cart?

Former Member
0 Likes
759

I have fixed bundles which I want to add to cart in a single shot when I add the bundle to the cart. As I understand, since Hybris supports configurable bundles only, it just add the Parent template to the cnd not the child templates. How can I automate this process to add the child templates to the cs well?

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

I am working on POC on configurableBundleAddOn, I want to add the entire bundle to be added to cart with one button Click, I checked the selection strategies like PickExactlyNBundleSelectionCriteria , PickNToMBundleSelectionCriteria works fine however the strategy I am interested in is AutoPickBundleSelectionCriteria its is not working as expected, please let me know if PickNToMBundleSelectionCriteria can work OOTB or I have to write custom logic to add the child bundle template to achieve this functionality :

###Staged

$productCatalog=electronicsProductCatalog

$productCatalogName=Electronics Product Catalog

$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]

$approved=approvalstatus(code)[default='approved']

$ruleType=ruleType(code)[default='ANY']

UPDATE BundleTemplate;id[unique=true];products(code, $catalogVersion);version[default=1.0][unique=true];$catalogVersion

;StarterLensComponent;816802

INSERT_UPDATE AutoPickBundleSelectionCriteria;id[unique=true];$catalogVersion

;StarterLensSelection_AutoPickBundleSelection

UPDATE BundleTemplate;id[unique=true];version[default=1.0];bundleSelectionCriteria(id, $catalogVersion);$catalogVersion

;StarterLensComponent;;StarterLensSelection_AutoPickBundleSelection

###Online

$productCatalog=electronicsProductCatalog

$productCatalogName=Electronics Product Catalog

$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Online'])[unique=true,default=$productCatalog:Online]

$approved=approvalstatus(code)[default='approved']

$ruleType=ruleType(code)[default='ANY']

UPDATE BundleTemplate;id[unique=true];products(code, $catalogVersion);version[default=1.0][unique=true];$catalogVersion

;StarterLensComponent;816802

INSERT_UPDATE AutoPickBundleSelectionCriteria;id[unique=true];$catalogVersion

;StarterLensSelection_AutoPickBundleSelection

UPDATE BundleTemplate;id[unique=true];version[default=1.0];bundleSelectionCriteria(id, $catalogVersion);$catalogVersion

;StarterLensComponent;;StarterLensSelection_AutoPickBundleSelection

# I tried to add AutoPickBundleSelectionCriteria however it didnot worked
Former Member
0 Likes

Bundle OOTB provides few selection strategies, you can try "AutoPickBundleSelectionCriteria" or else you need to write custom logic to fetch all child, and add them to cfter parent product added to cart.