Friday 18 November 2011

How to show cart quantity in magento


Hello Everyone,

              Today I’m going to tell you about how to show cart quantity in magento.In simple words, This tutorial will tell to add cart quantity anywhere in page according to client requirement.For example My clients requirement was to show cart quantity in shopping cart in header as shown here 
Baba N Baby

       For this, you need to Copy paste the following code to your file where you want to show the quantity.For example i wanted to show quantity in header so i need to edit header.phtml file.Similarly you can edit left column, right column etc.

Code to show cart Quantity :


<?php 
  function getCartQuantity () {
   $cart = Mage::getModel('checkout/cart')->getQuote()->getData();
   if (isset($cart['items_qty']))
   return (int)$cart['items_qty'];
   else
    return 0;
  }
  echo getCartQuantity ();  
?> 


 So in this way you can add cart quantity to some image like 



For any magento customization contact :
Company : Parsys Media
Mumbai Office :
Mobile No : +91-8123481528(Ashish Khadpe)

Monday 24 October 2011

How to create multi store in magento



The only changes you have to do which is not given in this video is as follows
Open the index.php file that you have copied to new folder
find the below line:
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
Replace this line by
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'shoestore';
It will automatically take the MageRunCode of shoestore
Similaarly find the following line:
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : '';
Replace this line by
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
Save the changes and refresh the index.php file in browser
You are done with Multistore in magento


For any magento customization contact :
Company : Parsys Media
Mumbai Office :
Mobile No : +91-8123481528(Ashish Khadpe)

Sunday 16 October 2011

How to remove decimal price in magento

Hello Everyone,

                 Today I’m going to tell you how to remove decimal price in magento.In simple words, This tutorial will tell to change the price from Rs. 121.00 to Rs . 121 for example.
                For this, you need to edit code/core/Mage/Directory/Model/Currency.php


  • Open  code/core/Mage/Directory/Model/Currency.php
  •  Find the following :-
 public function format($price$options=array(), $includeContainer = true, $addBrackets = false)
    {
        return $this->formatPrecision($price, 2, $options$includeContainer, $addBrackets);
    }


on line no 194
change this code to:-

 public function format($price$options=array(), $includeContainer = true, $addBrackets = false)
    {
        return $this->formatPrecision($price, 0, $options$includeContainer, $addBrackets);
    }

0 - Denotes the precision point for price..

But wait, you are still not done. The most important thing is still left.
- Clear the Cache.
- Go to System –> Cache Management
- Refreh Cache.
- If you have not enabled the Cache OR if it didn’t work even after refreshing the cache, then
- delete the cache folder present inside var (var/cache)


You can also refer to the video showing how it actually works


For any magento customization contact :
Company : Parsys Media
Mumbai Office :
Mobile No : +91-8123481528(Ashish Khadpe)





Tuesday 11 October 2011

Problem while login into the Admin Panel of Magento

Hello People,
Today after installing magento on my local computer i came across a new problem. The Problem was 'i was unable to login the admin panel of magento. It was redirecting me to the same admin login page. If any one of you are facing this problem the here's the solution:

Problem:
I was entering the URL as 'loclahost/magento/admin' after entering the username and password, it was redirecting me on the same page.

Solution:
I replaced 'localhost' in the URL with '127.0.0.1' and so my URL was '127.0.0.1/magento/admin' and after entering the username and password, i was redirected to the admin panel of magento.

hope this helps you.


For any magento customization contact :
Company : Parsys Media
Mumbai Office :
Mobile No : +91-8123481528(Ashish Khadpe)

Sunday 9 October 2011

Insert rupee symbol instead of Rs in magento

Hello Everyone,

                 Today I’m going to tell you how to change Currency symbol in magento.In simple words, This tutorial will tell to change the currency symbol of rupee (from Rs to an rupee image). By default, the currency symbol for rupee is Rs.
                 For this, you need to edit app\design\frontend\base\default\template\catalog\product\new.phtml
 if you want to change rupee symbol in new arrival page
Go to line no 38
 wherever you see the following code

<?
php echo $this->getPriceHtml($_product, true, '-new'); ?>


replace it by 


<?php
$string = $this->getPriceHtml($_product, true, '-new');
$string = str_replace("Rs", "<img src='http://www.myiris.com/insurance/images/rupee_icon.gif'>", $string);
echo $string; 
?>


You can also refer to the video showing how it actually works





Alternate Solution:


We have previously posted the solution for INR symbol. But that was playing with code, finally we were able to solve that problem in easy way. Here it goes:

Step 1: Goto: lib/Zend/Locale/Data/root.xml
  Make changes in root.xml
  find <currency type=”INR”> replace next line with this <symbol>Rs. </symbol>
save the page as rupee.js and save it inside /js folder of the root.
Step 3: Goto: \app\design\frontend\default\your-theme\layout edit page.xml
After this <block type=”page/html_head” name=”head” as=”head”>
add <action method=”addJs”><script>rupee.js</script></action>
Step 4 : Clear cache by deleting all the files and folder inside /var/cache folder. Clear cache from back-end as well.
All done, u have just replaced Rs. with INR new symbol, which was designed by an IIT Graduate.  


For any magento customization contact :
Company : Parsys Media
Mumbai Office :
Mobile No : +91-8123481528(Ashish Khadpe)

Sunday 2 October 2011

Magento Installation problems

Hello Everyone,

Today I’m going to tell you how to tackle different problems faced by the developer during the installation of magento.Magento Installation process is different for localhost & for online web hosting.In this article we are going to tackle basic problems as follows:

  1. Internal server error  - 500 
  2. Some extensions are missing like mcrypt,curl,PDO_MySQL.
  3. No input file specified (mostly projects hosted on GoDaddy domain) 
Problem No 1 : Internal server error  - 500
Solution : This problem generally occurs when we don't have correct permission on files during installation Magento Expects that Each and Every folder and File  with permissions 755. So to avoid this problem you need to change permission of Magento Folder and index.php to 755. Sometimes it is also required to change the permission of .htaccess to 755.






    Problem No 3 : No input file specified (mostly projects hosted on GoDaddy domain)
    Solution : A common error which usually comes up if you’re hosted by GoDaddy, is the no input file specified error.
    If you do not have Magento setup in the root of your server, make sure to add the following to your .htaccess file.

    RewriteBase /yourbasepath/
    Once that is verified, there are a couple things you can do to fix this, but we’ll start with the one that usually works.
    In your web root directory, there should be a file called php.ini. Rename this to php5.ini.
    If there is no php5.ini file. Create the file and upload it to your root directory.
    If that doesn’t work, add the following to the end of your newly renamed php5.ini file:

    cgi.fix_pathinfo = 1
    And if you’re still getting the error, add the following to the top of your .htaccess file:

    Options -MultiViews
    The first one usually does the trick. If you don’t see this file in there, then create a blank php5.ini file add add the line listed on the second suggestion.
    If all of the above has not worked, KEEP your changes, wait exactly 24 hours. Go back to youraddress.tld/downloader and try again. You may just be cached and for some reason it takes a bit longer then I was used to. Keep your chin up!
    If nothing above worked, call GoDaddy up and have them either rename this for you, or make sure you’re on PHP 5.


    For any magento customization contact :
    Company : Parsys Media
    Mumbai Office :
    Mobile No : +91-8123481528(Ashish Khadpe)

    Thursday 29 September 2011

    How to Change Regular Price & Special Price text in magento

    Hello Everyone,

    Today I’m going to tell you how to change 'Regular Price' and 'Special Price' text in magento. Though there are many ways to do it, But i'l tell you one simple method as it worked for me.I wanted to change 'Regular Price' with 'Actual Price' and 'Special Price' with 'Our Price'.

    First you need to navigate to the file mage_catalog.csv by following path:

    app/locale/en_US/Mage_catalog.csv

    Now just check for translations 'Regular Price' and just

    Replace

    "Regular Price:","Regular price:"

    With

    "Regular Price:","Actual Price:"

    Replace

    "Special Price:","Special Price:"

    with

    "Special Price:","Our Price:"


    Well now the most important step.
    - Clear the Cache.
    - Go to System –> Cache Management
    - Refreh Cache.
    - If you have not enabled the Cache OR if it didn’t work even after refreshing the cache, then
    - delete the cache folder present inside var (var/cache)

    You can also refer to the video showing how it actually works



    If you are not able to change the label through CSV files, you can use following method :

    • Go to
      Admin Panel –> System –> Configuration –> ADVANCED –> Developer –> Magento Developer –> Translate Inline
    • Change "Enabled for Frontend" from 'No' to 'Yes'.
    • Press Save Config
    • Refreh Cache.
    -> Now go to frontend and refresh page
    ->


    For any magento customization contact :
    Company : Parsys Media
    Mumbai Office :
    Mobile No : +91-8123481528(Ashish Khadpe)

    Wednesday 28 September 2011

    How to change Currency symbol in magento



    Hello Everyone,

                     Today I’m going to tell you how to change Currency symbol in magento.In simple words, This tutorial will tell to change the currency symbol of dollar (from $ to Rs). By default, the currency symbol for dollar is $.But if you want to insert rupee symbol  instead of "Rs" follow this tutorial.

    For this, you need to edit lib/Zend/Locale/Data/en.xml
    Well, the xml file to edit depends upon your locale settings. My locale is set to English (United States). So, I will have to change en.xml file.

    You can change your locale setting from
    Admin Panel –> System –> Configuration –> GENERAL –> General –> Locale options –> Locale

    If your locale is Japanese (Japan), you need to change lib/Zend/Locale/Data/ja.xml
    If your locale is Hindi (India), you need to change lib/Zend/Locale/Data/ne.xml
    It’s similar for other locale settings. I have locale setting as English, so I will be editing en.xml file.
    - Open lib/Zend/Locale/Data/en.xml
    - Find the following :-


    <currency type="USD">
        <displayName>US Dollar</displayName>
        <displayName count="one">US dollar</displayName>
        <displayName count="other">US dollars</displayName>
        <symbol>$</symbol>
    </currency>

    - Change

    <symbol>$</symbol>

    -to

    <symbol>Rs</symbol>

    But wait, you are still not done. The most important thing is still left.
    - Clear the Cache.
    - Go to System –> Cache Management
    - Refreh Cache.
    - If you have not enabled the Cache OR if it didn’t work even after refreshing the cache, then
    - delete the cache folder present inside var (var/cache)


    You can also refer to the video showing how it actually works



    But sometimes you want to insert an image instead of text
    for e.g. if you want insert rupee symbol  instead of "Rs" follow this tutorial.

    For any magento customization contact :
    Company : Parsys Media
    Mumbai Office :
    Mobile No : +91-8123481528(Ashish Khadpe)