I'm looking for ways to implement an e-commerce for an organic farmer who sells their products, he offers products and product bundles. Every product bundles has its own price. Each bundle are predefined products group. But I want that when the user buys, can unchoose at most, two products of the bundle and change them for another product in a predefined group of products.

I wonder if anyone knows how I can work this way the product bundles. I've been searching, I saw Tech Talk about commerce bundles, I tried commerce_bundle... but I can't find anything to do this.

Any idea or clue is welcome!

1 Answer 1


My solution goes here based on Drupal Commerce-

Step 1: Create Product Bundles using Commerce Bundle module. (which you already know).

Step 2: Now you have bundles. The next step is your custom functionality to swap at most two products from the bundle.

Add a new step to your checkout process to implement the custom functionality refer Add a new step in Commerce checkout, explore commerce_checkout.api to get the hold on this.

Adding a new step is nothing but adding a new pane (inside a checkout page) in a Drupal Commerce checkout process where you can list the products in the cart and process them using hook_form_alter(). Refer this link for more details hook_form_alter.

You can make use of hooks provided by Drupal Commerce such as commerce_cart.api, commerce_order.api to edit/update the cart.

Step 3: After processing the cart contents you can update the order details/status using commerce_order.api.

You can alter the checkout pane settings from Home » Administration » Store » Configuration » Checkout Settings page.

Note: You must have Drupal 7 module development knowledge to implement the above solution.

I hope this helps! Thank You.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.