in /app/design/frontend/base/default/template/email/order/items/order/default.phtml
my new order email lists the configurable products the customer has ordered
I want to output the product id of the product that was selected, however:
$_item->getProductId()
gives me the configurable product ID and not the child (simple) product that was chosen by the customer.
in the basket, I did this:
$product = Mage::getModel('catalog/product')->load($_item->getProduct()->getId());
if($product->getTypeId() == "configurable")
{
$product = Mage::getModel('catalog/product')->load($_item->getOptionByCode('simple_product')->getProductId());
}
echo $product->getId() ;
but on this page i get:
Fatal error: Call to a member function getProductId() on a non-object