Skip to main content

Posts

Showing posts from December, 2016

Configuring php ini settings on magento

Depending on your hosting company, you may or may not be able to change the settings of the php. In that case, we have our custom php.ini file in magento. The php.ini file is location under the root of magento installation with the name of php.ini.sample. Open this file and make the necessary changes to php settings as shown below, ; This file is for CGI/FastCGI installations. ; Try copying it to php5.ini, if it doesn't work ; adjust memory limit memory_limit = 64M max_execution_time = 18000 ; disable magic quotes for php request vars magic_quotes_gpc = off ; disable automatic session start ; before autoload was initialized flag session.auto_start = off ; enable resulting html compression zlib.output_compression = on ; disable user agent verification to not break multiple image upload suhosin.session.cryptua = off ; turn off compatibility with PHP4 when dealing with objects   zend.ze1_compatibility_mode = off ; PHP for some reason ignores this set

Magento js validation message translation

Magento includes the translator library to translate the js messages that appear on our site. The translator js is already included at the head. To translate our messages, we just need to add the text to transator. For eg: This translator code needs to be added on our phtml file.  Translator.add('Select a color.', "<?php echo $this->__('Select a color.');?>"); Then we need to add the text to translate at locale file i.e translate.csv at the locale folder. However, this will not work for prototype js validation messages that appear on checkout pages. e.g. "This is a required field." etc. To translate these validation messages, we need to we’ll override Magento’s validate method. For that, we need to create an external js file and place it under js folder. For eg: js/lib/translatejs.js Validation.addAllThese([     ['validate-no-html-tags', Translator.translate('HTML tags are not allowed'), function(v)