Display all SKU combinations on Configurable Product page
-
11-10-2020 - |
Pregunta
how do I go about displaying all possible SKU combinations on a Configurable Product page?
Solución
<?php
$simple_collection = Mage::getModel('catalog/product_type_configurable')->setProduct(Mage::registry('current_product'))
->getUsedProductCollection()
->addAttributeToSelect('sku')
->addFilterByRequiredOptions();
$id_to_sku = array();
foreach ($simple_collection as $_item)
{
$id_to_sku[$_item->getId()] = $_item->getSku();
}
print_r($id_to_sku);
?>
Hope it helps :)
Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange