how can i display the sku from simple products on configurable product page?
i have tried:
$_product->getSku()
$item->setSku($product->getSku())
$simpleOption->getProduct($product)->getSku()
$simple->getSku()
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityif($_product->getTypeId() == "configurable"):
$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
$simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
foreach($simple_collection as $simple_product){
echo $simple_product->getSku() . " - " . $simple_product->getName() . " - " . Mage::helper('core')->currency($simple_product->getPrice()) . "<br>";
}
endif;
inspire from this. here
/**
* Get child products id (only ids)
$childIds = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($product->getId());
/**
* Get children products (all associated children products data)
*/
$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$product);
foreach($childProducts as $childproduct ) {
$childproduct->getSku();
}
above function is just sketch you can look for perfect function.
hope this will work for you.