Month: July 2010

  • Calling a static block in phtml template file

    First create a static block from admin >> CMS >> static blocks and write this code in your phtml file : Tweet This Post

  • Javascript Event based on Firefox and IE

    In this post I simply showing how to find the cursor position in the window screen. When user click on this button an event fired and it shows the position of the cursor. This code is running is both Firefox and IE.. Tweet This Post

  • Remember me box on login page in magento

    Steps for Remember me functionality in login.phtml Step 1: Please find the following path http:\\yourdomain\app\code\core\Mage\Customer\controllers\AccountController.php Step2: Find following function: public function loginPostAction() and Replace with: public function loginPostAction() { if ($this->_getSession()->isLoggedIn()) { $this->_redirect(’*/*/’); return; } $session = $this->_getSession(); if ($this->getRequest()->isPost()) { $login = $this->getRequest()->getPost(’login’); if (!empty($login[’username’]) && !empty($login[’password’])) { try { $_SESSION[’user_name’] = $login[’username’]; $_SESSION[’user_password’]…

  • Get the current currency code and symbol in magento

    I have tried many times but I didn’t got success . But today I got the solution to show the currency symbol of product price: Currency Code : <?php echo $currency_code = Mage::app()->getStore()->getCurrentCurrencyCode(); ?> Currency Symbol : <?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?> Tweet This Post

  • Product Thumbnail sizes in Magento

    If you want to show product thumbnail on any page in your requirement size then At the showing page : <img src=”<?php echo $this->helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(100, 100) ?>” border=”0″ alt=”<?php echo $this->htmlEscape($_product->getName()) ?>” /> Change 100, 100 to your X, Y Where X : your requirement width and Y : Requirement height. Tweet This Post