Pages

Temporarily override viewing index.php with index.html

Apache configuration file, there is a command called DirectoryIndex

DirectoryIndex index.php index.html

Change yours to look like this:

DirectoryIndex index.html index.php

Magento - billing countries different from shipping countries

app\design\frontend\default\(my_skin_name)\template\checkout\onepage\shipping.phtml

Line 103, remove or comment out this line:

<php echo $this->getCountryHtmlSelect('shipping') ?>

and replace with:

<select name="shipping[country_id]" id="shipping:country_id" class="validate-select" title="Country" onchange="shipping.setSameAsBilling(false);">

<option value=""> </option>

<option value="US" selected="selected">United States</option>

</select>

Or your own set of countries you want to show. You have the valid 2 letter country abbreviation, Magento should take care of the rest on state/province selection automatically for you.

Magento - Paypal does not allow your country of residence to ship to the country you wish to

app/code/core/Mage/Paypal/Model/Api/Standard.php
Line 237

Set the address override to "0"

If you set it to 1, the address overrides the Paypal address (the billing address), so when when it compares the addresses, if they don't match exactly, you get this error.

Magento database configuration file changed

MySQL database connection details such as hostname, database name, username etc of a Magento, you find that information into the file:

/app/etc/local.xml

Find the below lines in the file

<connection>
<host><![CDATA[hostname]]></host>
<username><![CDATA[Database Username]]></username>
<password><![CDATA[Database Password]]></password>
<dbname><![CDATA[Database Name]]></dbname>
<active>1</active>
</connection>

Virtuemart - Change Ascending / descending sort default on Browse page

Make a change to the file located in,

administrator/components/com_virtuemart/html/shop_browse_queries.php

Line #23

$DescOrderBy = $vmInputFilter->safeSQL( $vm_mainframe->getUserStateFromRequest( "browse{$keyword}{$category_id}{$manufacturer_id}DescOrderBy", 'DescOrderBy', "ASC" ) );

Change to:

$DescOrderBy = $vmInputFilter->safeSQL( $vm_mainframe->getUserStateFromRequest( "browse{$keyword}{$category_id}{$manufacturer_id}DescOrderBy", 'DescOrderBy', "DESC" ) );

Magento Performance Tips

Magento is a very flexible e-commerce platform.If you have a hosting configuration that should be loading your Magento pages quickly, there might be a problem in the configuration. There are a few configurations that can be easily missed, but make a large impact on performance.

Enable Flat Catalogs


Magento Community Editions 1.4 and newer, as well as Magento Enterprise Edition 1.9 and newer, offer "Flat Catalogs" that summarize the highly normalized data in flat summary tables. Using these flat summary tables makes a noticeable difference in the database query execution time.

Check your Flat Catalog configuration now to ensure that your Magento store is taking advantage of this key performance enhancement.

1. Log into your Magento administration panel
2. Navigate to System > Configuration > Catalog
3. Expand the "Frontend" accordion tab
4. Set "Use Flat Catalog Category" to "Yes"
5. Set "Use Flat Catalog Product" to "Yes"


Enable Magento Flat Catalog
Now that we have enabled the Flat Catalog options, we must refresh the indexes and populate the summary tables with the newest data.

Refresh Indexes


1. Log into your Magento administration panel
2. Navigate to System > Index Management
3. Click "Select All"
4. Set Actions to "Reindex Data"
5. Click "Submit"

The resulting screen should show all index statuses as "READY" with a green background.


Refreshed Magento Indexes

Enable JavaScript and CSS Merging


Magento offers built-in JavaScript and CSS merging. Merging JavaScript and CSS reduces page load time by combining multiple files into a single include file with the whitespace characters stripped out. This improves page load time on your customers’ web browsers.

To enable JavaScript and CSS Merging, follow these steps:

1. Log into your Magento administration panel
2. Navigate to System > Configuration
3. Click "Developer" in the left navigation
4. Expand "CSS Settings" accordion
5. In the "CSS Settings" accordion, set "Merge CSS Files" to "Yes"
6. Expand "JavaScript Settings" accordion
7. In the "JavaScript Settings" accordion, set "Merge JavaScript Files" to "Yes"


Magento Merge CSS and JavaScript Files

Use the Database To Store Sesssions


For Magento hosting configurations that have a dedicated database server, or for hosting environments with the proper hardware resources, use the database or memcached to store user sessions. Contact your hosting provider to verify that this is an option for your Magento online store.

1. Edit app/etc/local.xml
2. Inside the "session_save" element, change "files" to "db" or "memcache"