2013-06-27 119 views

回答

3

这里是你如何能找到的产品都应该是附着在产品捆绑在列表中的所有其他项目的内容:

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) 
      } 
     } 
} 
+1

超级有用!我会试试这个。 – NateTheGreatt