Enable GZIP for CSS and JS files on NGINX server for Magento

This is an working config that I currently use in production. http://pastie.org/10870547 gzip on; gzip_disable “msie6”; gzip_comp_level 6; gzip_min_length 1100; gzip_buffers 16 8k; gzip_proxied any; gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/json application/xml application/rss+xml image/svg+xml; This config was tested via tools.pingdom.com.

Understanding getChildHtml in Magento

If we’re discussing the frontend of the website, the particular line you’ve asked about…. <?php echo $this->getChildHtml(‘content’) ?> is added to the Magento layout XML in app/design/frontend/base/default/layout/page.xml. In Magento version 1.8, you’ll find it defined in lines 92-94. <block type=”core/text_list” name=”content” as=”content” translate=”label”> <label>Main Content Area</label> </block> By looking at the “type” attribute of this … Read more

Clearing Magento Log Data

Cleaning the Magento Logs using SSH : login to shell(SSH) panel and go with root/shell folder. execute the below command inside the shell folder php -f log.php clean enter this command to view the log data’s size php -f log.php status This method will help you to clean the log data’s very easy way.

Magento Payment flow

Here’s the way I’ve always understood the concepts, and what you’ll need to know to implement a payment module in Magento. Answers to your specific “where does this happen” are bolded below, although it’s not quite as simple as you’re hoping for. Pre-internet, brick and mortar credit card transactions were a two stage process. At … Read more

Magento products will not show in category

The checklist for whether items are in stock follows. Some will seem stupid until the first time you spend an hour trying to figure this problem out: The products must be Visible in Catalog. The products must be Enabled. Product must have a stock Quantity. The product must be set to In Stock. If the … Read more

How to get store information in Magento?

Get store data Mage::app()->getStore(); Store Id Mage::app()->getStore()->getStoreId(); Store code Mage::app()->getStore()->getCode(); Website Id Mage::app()->getStore()->getWebsiteId(); Store Name Mage::app()->getStore()->getName(); Store Frontend Name (see @Ben’s answer) Mage::app()->getStore()->getFrontendName(); Is Active Mage::app()->getStore()->getIsActive(); Homepage URL of Store Mage::app()->getStore()->getHomeUrl(); Current page URL of Store Mage::app()->getStore()->getCurrentUrl(); All of these functions can be found in class Mage_Core_Model_Store File: app/code/core/Mage/Core/Model/Store.php

Magento – Retrieve products with a specific attribute value

Almost all Magento Models have a corresponding Collection object that can be used to fetch multiple instances of a Model. To instantiate a Product collection, do the following $collection = Mage::getModel(‘catalog/product’)->getCollection(); Products are a Magento EAV style Model, so you’ll need to add on any additional attributes that you want to return. $collection = Mage::getModel(‘catalog/product’)->getCollection(); … Read more

tech