开发者

Magento : How to retrieve option information from a bundled product?

开发者 https://www.devze.com 2023-01-18 19:38 出处:网络
I have a bundled Product that contains 3 virtual products as options. I have an observer that is listening to an event when an item is added to the cart and I\'m having a hard time figuring out how t

I have a bundled Product that contains 3 virtual products as options.

I have an observer that is listening to an event when an item is added to the cart and I'm having a hard time figuring out how to get the option information that I selected when looking at the product: the start of the observer looks like this:

public function checkSubscriptionHierarchy(Varien_Event_Observer $observer) {
$event = $obse开发者_C百科rver->getEvent();
$product = $event->getProduct();

...

the call to $product->getSku() returns the sku of the bundle product. I'd love to be able to grab the sku of the option that I selected, but cannot figure out how to do that.

Thanks!


I dealt with this by listening to event: checkout_cart_product_add_after and getting the info off the QuoteItem which worked out.

0

精彩评论

暂无评论...
验证码 换一张
取 消