<?php$currentCategory = Mage::registry(‘current_category’);$currentProduct = Mage::registry(‘current_product’);$currentCmsPage = Mage::registry(‘cms_page’);?>
Classic Blog List
Use the code below to delete a quote: <?php$quoteID = Mage::getSingleton(“checkout/session”) ->getQuote()->getId();if($quoteID){ try { $quote = Mage::getModel(“sales/quote”)->load($quoteID); $quote->setIsActive(false); $quote->delete(); return…
<?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());}?>
UPDATE`core_config_data`SET`value` = 0WHERE`path` = “dev/debug/template_hints”OR`path` = “dev/debug/template_hints_blocks”;
We can simply use the following code // To get the shipping and handling charge on shopping cart page Mage::getSingleton(‘checkout/session’)->getQuote()->getShippingAddress()->getShippingAmount();…
Requirement : Some times you may run into situation where you want to override the core functionality of Magento core…
To create the related product programmatically in Magento <?phpset_time_limit(0);ini_set(‘memory_limit’,’1024M’);require_once ‘../../app/Mage.php’;Mage::app(); $sku=’12345’; //some Sku$product = Mage::getModel(‘catalog/product’)->loadByAttribute(‘sku’,$sku); if($product){$sRelatedProducts = “123456,123”;$aRelatedProducts = explode(‘,’,…
<?php $helper = $this->helper(‘catalog/category’) ?> <?php foreach ($helper->getStoreCategories() as $_category): ?> <a href=”<?php echo Mage::getModel(‘catalog/category’) …