Author: naveenos

  • 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

  • How to Import Products into Magento

    There’s a little confusion among some on how to import products into a Magento ecommerce store. I spent some time today researching and trying to find the best method on doing this. The reason for my research is because there was no simple documentation anywhere that I could find on how to import products. Magento…

  • Changing window.location in IE 6

    window.location and window.location.href will support to all browsers but it will not support to IE6. For this I have a solution: Suppose you code is : window.location = “http://naveenos.com/”; // Not working??? // Also this does not working?? window.location.href =”http://naveenos.com/”; Then do this, setTimeout(function() { window.location = “http://naveenos.com/”; }, 0); Tweet This Post

  • Create multilanguage site

    To create a site in multiple languages you should do two main things : Write this code after connection created in database file : mysql_query ( ‘SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary;’, $connectionID ); And write below code in common file which use in complete site : header(‘Content-Type: text/html; charset=ISO-8859-1’); Tweet This Post

  • Jquery : Benefits, Examples and Free Ebook

    What is jQuery? Directly taken from the website of jQuery -” jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages”.It is basically a JavaScript framework for writing huge task of JavaScript with few lines of code. What are…

  • WordPress Widgets vs Plugins, what’s the difference?

    What is the difference between plugins and widgets? Plugins are functions that do something to your website. They could serve a back-end purpose and never be visible to you or the public. In the other hand, a widget usually is the representation of a plugin in the form of an object that can be placed…

  • Joining two fields into one

    I want to get two fields value in a single value and I searched on net many times but today I try to solve at my behalf and I got the solution. Here you will get the solution to get the two fields value as single value: For example: Database :  db_bank Table :  tbl_customer…

  • Change dropdown list (options) values from database with ajax and php

    I’m going to show you a example in php and ajax to change the values of the dropdown’s options without refreshing the page. The values (options) of the dropdown are fetched from the database and the certain portion of the web pages is only refreshed without need to refresh the whole page. Let’s start with…

  • How to control the case of characters using CSS?

    How are you controlling the case of the characters in your project. Talking about me, I was using ucwords() function of PHP to control the case of the characters when required. Today, I come to know two new property of CSS which controls the output of the case of the characters of the words. You…

  • 301 redirect in PHP and .htaccess

    What is 301 redirect ? You have a website and its all pages are ranked in the search engine. And now you’ve moved these files to a new domain. What will happen in this scenario!!. You are sending the visitor to “Error 404 – File not found” page when they follow your website in the…

  • Hiding PHP file extension

    Do you want to hide your web site’s server script identity ? If you don’t want to reveal the programming language ( server side script ) of your website to visitors of website so that any hacker or spammer will not be able to intrude or inject any code in your website. Here is a…

  • Uploading large(big) files in PHP using .htaccess

    I’ve seen that many of my friends are struggling with the uploads of the bigger or larger files in PHP. After looking at their struggle, i’m here to solve the problem of uploading larger or bigger files in PHP. Most of the web servers are configured such a way that a user can only upload…