Setting custom environment variables using .htaccess

If you are familiar with Magento, esp with setting up multiple websites/stores using .htaccess then you may have encountered variables like: MAGE_RUN_CODE & MAGE_RUN_TYPE. Yes they are the custom environment variables. In order to set up custom environment variables using .htaccess, try as follows: RewriteRule ^ – [E=MAGE_RUN_CODE:default] RewriteRule ^ – [E=MAGE_RUN_TYPE:store] Where MAGE_RUN_CODE & …

Read more

Reset form using jQuery

One thing to be noted that pre-filled form values do not get reset using the html reset button. In this case, javascript becomes handy. It’s again even much easier to reset using JQuery. Here is the solution: function resetForm(id) { $(‘:input’,’#’+id) .not(‘:button, :submit, :reset, :hidden’) .val(”) .removeAttr(‘checked’) .removeAttr(‘selected’); } <input type=”button” onclick=”resetForm(‘formId’);” value=”Reset” /> Where …

Read more

How to run Magento 1.3.X on PHP 5.3?

You know that Magento version (>= 1.4.X) works well under PHP 5.3. But what if you want to run the Magento 1.3.X under the same AMP(Apache/Mysql/PHP) package? You may need this in order to test the extension/theme compatibilities. In order to run Magento 1.3.x on PHP 5.3, you need to replace the following function from …

Read more

List out all the product names in Magento via SQL code

You know we can easily fetch the product names using the Model object. But what if you want to list out all the product names via SQL code? Don’t worry here is the SQL code for you: SELECT `value` AS product_name FROM catalog_product_entity_varchar WHERE entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = ‘catalog_product’) AND …

Read more