I’m trying to get bundle options data. using this : $product->getBundleOptionsData I need to use this, as I’m trying to change data programmatically and I would like to do it in a way that’s as close as used in admin .
However, when I var_dump the result of the above function I get NULL while in admin side in bundle model product type I get correctly the data.
When I var_dump $product in my own file I get much shorter data than when I var_dump in bundle model product type save function.
what do I need to do to load all data of the product, so I can use getBundleOptionsData. I looked in several files and googled, but can’t find an answer.
Finally I made it work to get bundle options data so I can manipulate it. I found the main code in magento’s model bundle observer class duplicateProduct function: I needed however to add option_id (careful not to forget that)
here is the code in it’s final stage.
you can either now change on the raw data in optionsrawdata. or getBundleOptionsData. and same for the other one.