Pages

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

CSS Hacks for Different Versions of Firefox

CSS hacks targeting different versions of Firefox. Some of these CSS Firefox hacks are organized according to version number and presented with ease of copying and pasting in mind. That said, here are some notes that apply to all of the hacks in this article.
  • For each hack, change only #selector, .selector, and of course the declaration blocks.
  • Hacks that do not validate as CSS are designated with [!] in the associated comment.
  • If you discover any inconsistencies, incompatibilities, or inoperabilities, please leave a comment.
  • This post is a work in progress. Please share any Firefox hacks that are not on the list.

Types of CSS hacks


1. target -
We are referring to the application of CSS styles to a particular, targeted browser (or set of browsers) at the exclusion of all others.

2. filtering
We are referring to the application of CSS styles to every browser except a particular browser (or set of browsers).

CSS Hacks targeting all Firefox


/* Target all Firefox */
#selector[id=selector] { color: red; }
/* Target all Firefox */
@-moz-document url-prefix() { .selector { color: red; } }

/* Target all Gecko (includes Firefox) */
*>.selector { color: red; }

CSS Hacks targeting Firefox 1.5 and newer


/* Target Firefox 1.5 and newer [!] */
.selector, x:-moz-any-link, x:only-child { color: red; }

CSS Hacks targeting Firefox 2 and older


/* Target Firefox 2 and older [!] */
body:empty .selector { color: red; }

/* Target Firefox 2 and older */
#selector[id=SELECTOR] { color: red; }

/* Target FireFox 2 and older [!] */
html>/**/body .selector, x:-moz-any-link { color: red; }


CSS Hacks targeting Firefox 3


/* Target FireFox 3 [!] */
html>/**/body .selector, x:-moz-any-link, x:default { color: red; }