1

I have already created Bundle product in magento 1.9.2.2.

All the bundle items are of "Radio Buttons" input type having few options already defined to them. This I have created using admin-panel.

Now, I am in requirement to add a simple product in the selection for second option of each of the bundle product present in the store.

NOTE: I want to add the same simple product to each bundle product.

Can anyone help me to do this programmatically!

1

Here you have complete tutorial how to build bundle product from scratch: http://inchoo.net/magento/programmatically-create-bundle-products-in-magento/ https://gist.github.com/tim-bezhashvyly/4245048

If you have to add the same simple product to every bundle product I would do this:

  1. I would prepare collection of product, filtering by type of product (bundle of course).
  2. Then if I have such a collection I would iterate throughout it using code snippet from one of tutorials which adds desired product. If you have one option present before you add product you have to create option first and then to this option you can add product.
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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