Pages

Change Domain in Magento

If you need to update the domain name of your Magento installation, just follow these steps:

  1. Login to cPanel.
  2. Click the phpMyAdmin icon.
  3. Select your Magento database
  4. Click the link for the core_config_data table.
  5. Look for the "path" fields named web/unsecure/base_url and web/secure/base_url. (Currently, the "config_id" is 2 and 3.)
  6. Change each "value" to your new domain.
  7. You may need to empty your /var/cache/ folder before it works.

Edit Email Templates in Magento

Default place/locale. You should not customize them in the filesystem.

app/locale/en_US/template/email/

Customize email and to create a new email template you have to go to 

admin -> system -> transactional emails -> add new template -> choose the base template from the drop down and edit as appropriate.

It is possible that your email templates are already saved into the database. Then you can assign the newly created template to proper functionality.

For e.g. if you have created new template for Invoice you can assign as follows.Go to

admin -> system -> configuration -> Sales Emails -> Invoice -> Invoice Email Template

And from the drop down select the template you created for invoice and save config.

Most important step.
- Clear the Cache.
- Go to System –> Cache Management
- Refreh Cache.
- If you have not enabled the Cache OR if it didn’t work even after refreshing the cache, then
- delete the cache folder present inside var (var/cache)

How to change Joomla Admin Folder Name or Path

how to protect your admin side of website. Rename Joomla administrator directory without having to modify any Joomla code.

1. Create a new directory in your root directory (eg. "newadmin")
2. Create an index.php file in your "newadmin" directory

## newadmin/index.php

$admin_cookie_code="1234567890";
setcookie("JoomlaAdminSession",$admin_cookie_code,0,"/");
header("Location: ../administrator/index.php");

3. Add this to the beginning of index.php in real administrator folder

if ($_COOKIE['JoomlaAdminSession'] != "1234567890")
{
header("Location: ../index.php");
}


To login Joomla administration page, go to "http://yoursite.com/newadmin/". The php code will set a cookie that expires at the end of the session and redirect you to your real administration page. No one will be able to load anything from the administrator directory without having gone through the "newadmin" directory first.

Load Flash Video Before Load Front Page Joomla

Create a .htaccess file which contains the following code:

DirectoryIndex index.html index.php

Then create a index.html where you include the flash. If you make the flash linkable and have it go to the index.php it should work.

web page is not cached, across all browsers

set of headers which works in all of the mentioned browsers is the following:


Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

The PHP way would look like:


header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
header('Pragma: no-cache'); // HTTP 1.0.
header('Expires: 0'); // Proxies.

The Java/Servlet way would look like:


response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
response.setDateHeader("Expires", 0); // Proxies.

The ASP.NET way would look like:


Response.AppendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.0.
Response.AppendHeader("Expires", "0"); // Proxies.

The plain HTML way would look lile:


<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">


The Cache-Control is per the HTTP 1.1 spec for clients (and implicitly required by some browsers next to Expires),
the Pragma is per the HTTP 1.0 spec for clients and proxies and Expires is per the HTTP 1.1 spec for clients and proxies. Other Cache-Control parameters are irrelevant if the abovementioned three are specified. The Last-Modified header is only intersting if you actually want to cache the request.

Change suffix from html to htm in Joomla

Goto includes/router.php
Line 57 : Replace the current code there with ,


if($suffix = pathinfo($path, PATHINFO_EXTENSION))
{
$path = str_replace('.'.$suffix, '', $path);
$vars['format'] = $suffix;
if ($suffix == 'htm')
{
$path = str_replace('.'.$suffix, '', $path); //pair of single quotes inserted
$vars['format'] = 'html';
} else {
$path = str_replace('.'.$suffix, '', $path); //pair of single quotes inserted
$vars['format'] = $suffix;
}
}




Then goto line 101 : Replace the current code there with ,



if($format = $uri->getVar('format', 'html'))
{
$route .= '.htm';
$uri->delVar('format');
}




If you need the suffix to change from .html to .php , then just replace the .htm in the above code by .php and thats it..

if you are still not able to do it, then just download this ,
router.php file and upload it to includes folder.

Virtuemart- Set the number of products per page

Add $limit=5; in line after $ps_product_attribute = new ps_product_attribute;
in /administrator/com_virtuemart/html/shop.browse.php