August 25, 201315:00 Get Simple Products of a Configurable Product Magento | Uncategorized <?phpif($_product->getTypeId() == “configurable”) { $ids = $_product->getTypeInstance()->getUsedProductIds();?><ul> <?php foreach ($ids as $id) { $simpleproduct = Mage::getModel(‘catalog/product’) ->load($id); ?> <li> <?php… Read more
August 25, 201312:30 Create Catalog Price Rule Programmatically in Magento Magento | Uncategorized Here, you will see how to create Catalog Price Rule in Magento through code. Catalog Rules are applied on products… Read more
August 24, 201322:30 Get methods of an object Magento | Uncategorized First, use get_class to get the name of an object’s class. <?php $class_name = get_class($object); ?> Then, pass that get_class_methods… Read more
August 24, 201322:00 Get associated products Magento | Uncategorized In /app/design/frontend/default/site/template/catalog/product/view/type/ <?php $_helper = $this->helper(‘catalog/output’); ?><?php $_associatedProducts = $this->getAllowProducts() ?><?php //var_dump($_associatedProducts); ?><br /><br /><?php if (count($_associatedProducts)): ?> <?php foreach… Read more
August 24, 201321:30 Get the current category/product/cms page Magento | Uncategorized <?php$currentCategory = Mage::registry(‘current_category’);$currentProduct = Mage::registry(‘current_product’);$currentCmsPage = Mage::registry(‘cms_page’);?> Read more
August 24, 201316:30 Cart Data Magento | Uncategorized <?php$cart = Mage::getModel(‘checkout/cart’)->getQuote()->getData();print_r($cart);$cart = Mage::helper(‘checkout/cart’)->getCart()->getItemsCount();print_r($cart);$session = Mage::getSingleton(‘checkout/session’);foreach ($session->getQuote()->getAllItems() as $item) { echo $item->getName(); Zend_Debug::dump($item->debug());}?> Read more