0
votes

Following problem: You've got a Configurable product with one random attribute. The customer chooses, for example, a size "XXL", and puts this into the cart. In the cart, I am showing the SKU with:

$_item = $this->getItem();
$item_ID = $_item->getProduct()->getId();
$_product = Mage::getModel('catalog/product')->load($item_ID);

echo $_product->getSku();

Now it shows the SKU of the Configurable Product. But I want to show the SKU of the chosen product (Simple Prodcut with the size XXL e.x.). How is that possible? I print_r'ed all those item-data, product-data and so on, but the only thing, which is getable is a Collection of associated Products.

1

1 Answers

1
votes

You can do this with:

    // check whether there are childrens for this product
    $_product->getHasChildren(); 
    // get the simple products behind the configurable product
    $_product->getChildren(); 

Good Luck!