2013-06-27 172 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