3
我无法获得所有儿童产品及其订购捆绑产品的选项。这可能吗?Magento - 获取儿童产品及其订购捆绑产品的选项
我无法获得所有儿童产品及其订购捆绑产品的选项。这可能吗?Magento - 获取儿童产品及其订购捆绑产品的选项
这里是你如何能找到的产品都应该是附着在产品捆绑在列表中的所有其他项目的内容:
foreach ($order->getAllItems() as $item) {
//if a product has parents (simple product of configurable/bundled/grouped product) load his Parent product type
if ($item->getParentItemId()) {
$parent_product_type = Mage::getModel('sales/order_item')->load($item->getParentItemId())->getProductType();
//if Parent product type is Bundle
if ($parent_product_type == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {
// your code goes here (do whatever you need to do)
}
}
}
超级有用!我会试试这个。 – NateTheGreatt
可能复制http://stackoverflow.com/questions的/ 6145980 /如何获得捆绑产品的成功页面 –
这是捆绑选项。我需要访问捆绑产品的实际项目。 – NateTheGreatt
您是否试过$ order-> getAllItems()它应该返回所有产品 –