Add code

Tuesday 5 January 2016

Custom Options Set Price to "0" in Magento 1.7 – The Fix

I’m working on a side project with Magento… There is a bug in 1.7 where when you use custom options, and your theme doesn’t include it’s own options.phtml file, the price will set to $0 (zero) when a user selects the price.

A bunch of forum posts have people talking about the problem. Basically it’s a silly bug in the javascript in options.phtml.

Basically, if your theme doesn’t have that options file in it’s theme directory, then magento looks like it defaults to the base‘s folder and includes the “default” options.phtml.
Here is the fix. I hope Magento includes it in the next Magento release!

Line 123 of options.phtml in
app/design/frontend/base/default/template/catalog/product/view/
Right now is
price += parseFloat(config[optionId][element.getValue()]);

Should be

price += parseFloat(config[optionId][element.getValue()].price);

Basically the code was trying to convert a javascript Object to a float. Making the price 0.

Magento Search Within Current Top Level Category

 For this purpose please follow this url.

http://edmondscommerce.github.io/magento/magento-search-within-current-top-level-category.html

Hope this will help to you.

Magento website loading speed is very slow

1.Combine JS and CSS files

(i) Magento admin -> System Configuration -> Developer -> 
Under “Javascript Settings”, 
change “Merge Javascript Files” to YES.
(ii)Magento admin -> System Configuration -> Developer -> 
Under “CSS Settings”,
Change “Merge CSS Files” to YES

Note: after made this change, sometimes it show effect on entire website. In this case, please revert back the settings to "No"
2. Use Magento’s Compilation feature. It’s reported to give you a 25%-50% performance boost: System > Config. > Tools > Compilation.
Note: after made this change, sometimes it show effect on entire website. In this case, follow this url

http://tejabhagavan.blogspot.in/2016/01/when-i-enabling-compilation-in-magento.html

3.Enable flat catalog :

Go to System > Configuration > Catalog >Frontend,
 change Use Flat Catalog Category to YES. If desired, under Frontend, change Use Flat Catalog Product to YES. Clear the cache.
4. Enabled magento caching
5. MySQL Query caching
6. Enable Gzip Compression
7. Disable any unused modules
8. Disable the Magento log
9. Optimise your images

There was no 404 CMS page configured or found

To create a 404 page Create a CMS Page with Correct 'Store View'.


Then go to System=>Config=>General=>Web
in Default pages Tab > CMS No Route Page select the recently created 404 Page and save

Add caption

Magento is redirecting to previous url after transfered to new server

For this you need to follow these simple steps in database :

1. your host/phpmyadmin
2. select your database
3. find `core_config_data` table in that
4. change the secure and unsecure urls here, which is https://www.domain.com/

Import & Export all categories using csv file (without extension)

If you want to import all categories and products to your website, just follow the following instructions.

1. First of all, create all categories and create one product in your website,
2. After this, export that data and keep that with you.
3. Now arrange the data which you want to import, that total have to be arrange in the format of your exported data.
4. After arranged you can easily import the data into your website which you want to import newly in usual manner.
5. Then go to system > import/Export > Data flows > Follow that rules

Error 500 Internal Server Error

The Web server (running the Web Site) encountered an unexpected condition that prevented it from fulfilling the request by the client for access to the requested URL.

Solution :

Open your hosting control panel and check the server error logs. Usually the error caused by the incorrect directory permissions.
In case you don’t have access to the server error log or are unable to resolve the issue please contact your hosting provider

Monday 4 January 2016

How to get magento skin url of images?

getSkinUrl() function is used to get the image location. For example, If you want to get your image location "skin/frontend/default/Your theme/images/image.jpg" use the below code.


$this->getSkinUrl('images/image.jpg');

Fatal error: Maximum execution time of 30 seconds exceeded

To fix it, open your php.ini and replace the value for 'max_execution_time' and 'max_input_time' as per below.


max_execution_time = 3600
max_input_time = 3600

when i enabling compilation in magento Got fatal error

Open your "root/includes/config.php" file.
Comment the below line using '#' symbol.

define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');


Thats it. Refresh the cache and check now.

How to find magento version?

Login to the admin for Magento:

http://www.yourdomain.com/admin/

And look in the footer, you should see the following:

Magento ver. X.X.X

Where X.X.X is the version number.

Friday 1 January 2016

How do you display more than 3 related products in Magento 1.9?

Go to your magento folder location, and edit the file

app/design/frontend/YOUR PACKAGE/YOUR THEME/template/catalog/product/list/related.phtml

If the file is not there, then go to

app/design/frontend/base/default/template/catalog/product/list/related.phtml


check If count mentioned 3, change it to 4,5 or the number of products you want.

Magento : 404 error is showing admin page

Hello, Sometimes we may get the error on admin page once done with the Magento installation. In that scenario, we have to do the following: ...