Thursday, June 23, 2016

How to change Rs to Indian rupee symbol (Devanagari letter “र”) at product display page?

Don't change code at all. In the admin panel, go to System > Manage Currency > Symbols.
There you should see all currencies used by your store and you can change their symbol.
But you should use the Unicode character “र” instead of a GIF.
Indian Currency symbol unicode : ₹

Below character encode should work in magento to display Indian Rupee sign.
&#8377 = र
₨ = ₨

i.e. &#8377 1,300 displays र 1,300.

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). 

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)

live server magento site redirecting to localhost.

I migrated my magento project (magento version 1.9.1 ) to live server. But when I try to access the live site, it gets redirected to localhost. 
Everything seemed to work fine but when I point a browser at the staging site it redirects to the localhost.
So Plz try mention below points.
  1. changed the secure/insecure base_url values in core_config_data table.
  2. deleted all the contents of /var/ folder
  3. cleared browser cache & cookies
  4. modified the permission of /var/ folder to 777
  5. changed the database name, username and password in local.xml file.
  6. Changing the .htaccess file to include RewriteBase /live server/
The Redirect problem was due to Magento cache. I Simply deleted everything from the /varfolder of my Magento site. After that I cleared my browser's cache/cookies for good measure & it worked!

Still the problem is not solve then try also.

Look in the /tmp/ folder (the one on the root of the server, not the one in your vhosts document root) and see if there is a magento folder. If there is, delete it, your cache is stored here if your webserver didn't have write access to var/cache on first request.
If that doesn't work, try running the query SELECT * FROM core_config_data WHERE value LIKE 'http%'; incase you missed one of the URL settings.

How to fix the 10 most common Magento problems?

How to configure Magento to work with a new domain

There are two things you should do in order to configure Magento to work with a new domain:
  • Edit the Magento database
Go to your cPanel > phpMyAdmin. Select your Magento database from the  left menu, find the table called core_config_data and click on it. Click the Browse tab and edit the first two fields:
web/unsecure/base_url
by clicking the pen icon in front of each of them. Replace your old domain name with your new one and click the Go button to save the change.
  • Clear the Magento cache.
The Magento cache folder is located in your Magento installation directory > /var/cache. To clear the cache, simply delete the folder. 
Many Magento issues can be fixed just by deleting the cache.

How to reset Magento Admin Password

To change your Magento admin password, go to your cPanel > phpMyAdmin, select your Magento database, click the SQL tab and paste this query:
UPDATE admin_user SET password=CONCAT(MD5('sGnewpass'), ':sG') WHERE username='AdminUsername';
Note: You have to change newpass in the MD5('sGnewpass') with your new password, and change *AdminUsername* to your Magento admin username.
Execute the query by clicking the Go button and your password will be changed.

How to enable Search Engine Friendly URLs in Magento

To enable Search Engine Friendly URLs in Magento, you have to log in to the Magento administration area and click on the Configuration button. Under the System navigation menu, switch to Web page from the sub-navigation panel on the left.
When the page loads, you will see blue lines which represent closed options tablets. Click on the Search Engines Optimization tab and turn on the Use Web Server Rewrites (mark as Yes). Click on the Save Config button and your Magento SEF URLs will be enabled.

How to speed up Magento

Many Magento issues are caused by slow performance. The recommended way to speed up Magento's performance is to enable its Compilation function.  The performance increase is between 25%-50% on page loads.
You can enable Magento Compilation from your Magento admin panel > System > Tools > Compilation.

How to redirect Magento to open through www

For SEO and usability purposes you may want to redirect your visitors to open your site only through www (http://www.yourdomain.com).
To do this in Magento, you should open the .htaccess file in the folder where your Magento is installed. In it locate the RewriteEngine on line and right after it add the following lines:
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]
Once you do this, save the .htaccess file and log in to the Magento admin area > System > Configuration menu and from the left panel click the Web button.
Unfold the Unsecured set of options and change the Base URL option from http://yourdomain.com to http://www.yourdomain.com.
Save the changes and your Magento will start working through www.yourdomain.com only! 

How to disable the Compare products functionality

You can disable the Compare products functionality in Magento by following these steps:
  • Edit app/code/core/Mage/Catalog/Helper/Product/Compare.php and change the following code: 
public function getAddUrl($product){return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product));}
to
public function getAddUrl($product){//return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product)); return false;}
  • Edit ./app/design/frontend/base/default/layout/catalog.xml (if you are using a different Magento theme, enter its name instead of default) and change the following code:
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
to
<!-- <block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/> -->
  • Flush the Magento cache from your Magento admin area > System > Cache Management.

How to set up a blog in Magento

It is not difficult to set up a blog in Magento. However, note that this functionality is not included by default and you will have to use a custom extension to add it.
You can search Magento Connect for an extension that will fully suit your needs. One of the popular free extensions that you can use is the Magento Blog – Community Edition.
All Magento extensions are installed in a similar way that is thoroughly explained in our Magento Connect Tutorial.
Once the extension is installed, you will have one additional section in the top menu of your Magento admin area called Blog. From there you can adjust the newly-installed Blog settings, add posts etc.

How to add a Contact Us form in Magento

Magento includes contact form functionality by default. A link to a contact form can usually be found in the footer of your Magento installation.
Of course, you can add a contact form on any page. All you need to do is:
  • Log in to the administrator area.
  • Go to CMS > Pages.
  • Select the page you want to edit or create a new page.
Paste the following code using the HTML option of the WYSIWYG editor:
<!– CONTACT FORM CODE BEGIN–>{{block type='core/template' name='contactForm' template='contacts/form.phtml'}}<!– CONTACT FORM CODE END–>
Save the changes and the contact form will appear on the desired page.

"Access denied" issue

As a solution to the "Access denied" issue, you should log out from the Magento admin area and then log in again.
If the above does not help, you should reset the admin privileges. This can be done through the Magento admin area > System > Permissions > Roles > Administrators.
Click on the Role Resources option from the left menu and make sure that Resource Access is set to All.
Click on the Save Role button and the permissions will be reset.

How to set a custom group of users

You can add a new group from the Magento admin area > Customers > Customer Groups > Add New Customer Group.
Once a customer registers, you can change the group he/she belongs to from the Magento admin area > Customers > Manage Customers. Click on the Edit link next to the customer and change the group from the Account Information > Customer Group. Click Save Customer.
Set the discount from Promotions > Catalog Price Rules > Add New Rule.
In the Customer Groups select the customers' groups for which the promotion is valid. Enter the other details, set the rule actions and conditions.  Finally, click Save Rule.

The above ten tips will hopefully help you resolve at least some of the Magento issues you have faced or are about to face.

Magento 2 Useful Commands List

Setup Upgrade Using Command Line php bin/magento setup:upgrade Cache Clean Using Command Line php bin/magento cache:clean ...