Engine23
blogBannerImage
By Engine23

How to get a magento item using sku, name, ID

// Load by name $_category = Mage::getModel('catalog/category')->loadByAttribute('name', 'Ruby Ring'); $_product = Mage::getModel('catalog/product')->loadByAttribute('name', 'emerald earring'); // Load by SKU $_product = Mage::getModel('catalog/product')->loadByAttribute('sku', 'Eram18j4'); //Load by ID (just load): $_product = Mage::getModel('catalog/product')->load($productID);