Skip to content

Magento – Configurable Products, get children, get children’s attributes

  • by

//Clear cache first! Mage::getModel(‘catalog/product_type_configurable’)-> getProduct($product)->unsetData(‘_cache_instance_products’); $_product = Mage::getModel(‘catalog/product’)->load(5525); $childProducts = Mage::getModel(‘catalog/product_type_configurable’)->getUsedProducts(null, $product);

Load Product by SKU or ID

  • by

<?php $_product = Mage::getModel(‘catalog/product’)->load(5525); $_product = Mage::getModel(‘catalog/product’)->loadByAttribute(‘sku’,’hypnotherapy-cd-weightloss’);

Reindex via Php script (Magento)

  • by

<?php // clear cache Mage::app()->removeCache(‘catalog_rules_dirty’); // Reindex prices Mage::getModel(‘index/process’)->load(2)->reindexEverything(); /* You can reindex specific items as below: 1 = Product Attributes 2 = Product Attributes 3 = Catalog URL Rewrites 4 = Product Flat Data… Reindex via Php script (Magento)

s2Member®