Create test account and useGo do Magento Dashboard: Go to System -> Configuration Select Sales -> Payment Method (in the…
Uncategorized
//To get the subtotal in shipping method (onepage checkout) $subtotal = Mage::getSingleton(‘checkout/session’)->getQuote()->getSubtotal() If cart total is less than 500 flat…
$customer = Mage::getSingleton(‘customer/session’)->getCustomer(); $email = $customer->getEmail(); // To get Email Address of a customer.$firstname = $customer->getFirstname(); // To get Firstname…
$layer = Mage::getSingleton(‘catalog/layer’);$_category = $layer->getCurrentCategory();$currentCategoryId= $_category->getId();
In PHTML<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘yourblockid’)->toHtml(); ?> IN CMS{{block type=”cms/block” block_id=”yourblockid“}}
$collection= Mage::getResourceModel(‘catalog/product_collection’)->addAttributeToSelect(‘*’)->setStoreId($storeId)->addStoreFilter($storeId)->setOrder(‘ordered_qty’, ’desc’)->setPageSize(10) ; foreach($collection as $product){$name=$product->getName();$productId=$product->getId();$price=$product->getPrice();}
Get Base Url :{{store url=””}}Get Skin Url :{{skin url=’images/imagename.jpg’}}Get Media Url :{{media url=’/imagename.jpg’}}Get Store Url : {{store url=’mypage.html’}}
For database connection$write = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’);$qry=”Select * from tablename”;$execute=$write->query($qry);$fetch=$execute->fetch() To get the Row Count $count=$execute->rowCount();
Get Base Url :Mage::getBaseUrl();Get Store Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);Get Skin Url :Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);$this->getSkinUrl(‘images/imagename.jpg’);Get Media Url :Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);Get Js Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);Get Current UrlMage::helper(‘core/url’)->getCurrentUrl();Get Home UrlMage::helper(‘core/url’)->getHomeUrl();





