Display all SKU combinations on Configurable Product page
-
11-10-2020 - |
Frage
how do I go about displaying all possible SKU combinations on a Configurable Product page?
Lösung
<?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 :)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit magento.stackexchange