如何从购买或购物车产品中获取分组产品ID

ayn*_*ber 2 magento magento-1.4

我正在使用分组产品来跟踪促销活动.简单的产品有时会属于多个分组产品,因此检查parentProductIds是没有用的.我想知道如何通过分组(促销)SKU购买产品时跟踪分组的产品ID.我可以看到它存储在订单中的info_buyRequest和super_product_config中,但是如何将这些信息退回?有没有办法在购物车/报价中找到它?

ayn*_*ber 7

我能够使用cart.phtml中的以下代码获取它,在foreach中($ this-> getItems()as $ _item):

$values = unserialize($_item->getOptionByCode('info_buyRequest')->getValue());
$parentId = $values['super_product_config']['product_id'];
Run Code Online (Sandbox Code Playgroud)