I am working with configurable product, I want simple product id of configurable product on cart.phtml, I am using this code
<?php foreach($this->getItems() as $_item): ?>
$_product = $_item->getProduct();
echo $_product->getId();
<?php endforeach ?>
but it always gives main product id, but I need its simple product id , any one help please.
Best Answer
In quote item table magento have sku and product id. For Configurable product's cart , 'sku' is simple product sku and product id is configurable product 'id'. SO, you need to load product by sku