How to edit Email Templates in Magento

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 you want.

Then you can assign the newly created template to proper functionality. For e.g. if you want to assign new tempalte for New Order confirmation email then you can assign as follows.
Go to admin –> system –> configuration –> Sales (in left section) –> Sales Emails –> Order

Then select new template in “New Order Confirmation Template” and “New Order Confirmation Template for Guest” dropdwons.

Finally you have to clear cache then it will work.

Remove breadcrumb from homepage in Magento

To remove breadcrumb from homepage in Magento

Try adding this to the layout update of your home cms page:
<remove name=”breadcrumbs” />

then clear cache and that’s done!

Remove Breadcrumbs from all pages in magneto

To remove breadcrumbs from all pages in magneto. Just go to

app/design/frontend/default/your theme name/layout/

Open file page.xml and you have to just comment below code around line 82

<!– <block type=”page/html_breadcrumbs” name=”breadcrumbs” as=”breadcrumbs”/> –>

Then upload file and remove cache.

How to limit the number of products on home page in Magento

How to limit the number of products on home page in Magento

To limit the number of products displayed on the homepage in Magento, you can modify the home page’s widget settings or edit the associated CMS block. If you’re using the “Catalog Products List” widget, navigate to Content > Pages, edit the “Home Page,” and adjust the widget settings to specify the “Number of Products to Display.” Alternatively, if products are being fetched dynamically via code, modify the corresponding .

html file, typically located in your theme’s template directory (app/design/frontend/YourTheme/Magento_Catalog/templates/product/list.phtml).

Use the ->setPageSize() method in the product collection query to define the limit.

This approach ensures a controlled number of products appear while maintaining site performance and user experience.

Top navigation as submenu in magento

If you would like to show your magento store categories like as in picture then you are on right place.
navigation_as_submenu

Replace this code in topmenu.phtml

<?php $_menu = $this->getHtml(‘level-top’) ?>
<?php if($_menu): ?>
<div class=”nav-container”>
<ul id=”nav”>
<?php echo $_menu ?>
</ul>
</div>
<?php endif; ?>

with below

<?php $_menu = $this->getHtml(0,’level-top’) ?>
<?php if($_menu): ?>
<div class=”nav-container”>
<ul id=”nav”>
<li class=”level0 nav-1 first level-top parent” id=”home”>
<a class=”level-top” href=”<?php echo Mage::getBaseUrl();?>”>
<span>Home</span></a>
</li>
<li class=”level0 nav-1 first last level-top parent” id=”products”>
<a class=”level-top”><span>Products</span></a>
<ul class=”level0″>
<?php echo $_menu ?>
</ul>
</li>
<li class=”level0 nav-1 last level-top parent” id=”contact_us”>
<a class=”level-top” href=”<?php echo Mage::getBaseUrl().’contacts’;?>”>
<span>Contact Us</span></a>
</li>
</ul>
<?php endif ?>

Exclude categories in magento top navigation

Exclude categories in magento top navigation

We can achive this using below code

<?php $cats = Mage::getModel(‘catalog/category’)->load(2)->getChildrenCategories();
?>
<ul>
<?php foreach($cats as $category): ?>
<?php if (!in_array($category->getId(), array(6,7,8,9))) : ?>
<li>
<a href=” </li>
<?php endif; ?>
<?php endforeach; ?>

</ul>

Note : 6,7,8,9 are the categories which you want to execlude, you should replace with yours

Remove callouts (sidebar banners) in Magento

Remove callouts (sidebar banners) in Magento

Left Callout banner (the dog)

Find in app/design/frontend/*/*/layout/catalog.xml

Right Callout banner (back to school)

Find in app/design/frontend/*/*/layout/catalog.xml

X-cart Database Backup/Restore HTTP 500 Error

X-cart Database Backup/Restore HTTP 500 Error

If you are getting Database Backup/Restore HTTP 500 Error then check your error logs – /var/log

If you will see following entry
[06-Mar-2013 02:52:09 America/Denver] PHP Fatal error: Call to undefined function func_xpc_check_iframe_methods() in /var/www/vhosts/yoursitefoldername/httpdocs/modules/XPayments_Connector/config.php on line 57

then you can try to activate the x-payment module without configuring and see if all works. It is a bug though

Show more than 5 “New Products” to the home page in magento

Show more than 5 “New Products” to the home page in magento

We have two methods for doing this. The first one is below

Go to CMS –> Pages –> Home page in admin section and click Design section and then upadte Layout XML code with below

<block type=”catalog/product_new” name=”home.catalog.product.new” alias=”product_new” template=”catalog/product/new.phtml” after=”cms_page”>
<action method=”addPriceBlockType”>
<type>bundle</type>
<block>bundle/catalog_product_price</block>
<template>bundle/catalog/product/price.phtml</template>
</action>
<action method=”setProductsCount”><count>12</count></action>
</block>

This shows a maximum of 10 items.

The second one is change code in the magento files.

This example to show 10 items in 2 rows 5 products each.

You need to change the line in appcodecoreMageCatalogBlockProductNew.php
$products->setOrder(’news_from_date’)->setPageSize(5)->setCurPage(1);
change to
$products->setOrder(’news_from_date’)->setPageSize(10)->setCurPage(1);

And need to change new.phtml

<!–?php if ($i–>5): continue; endif; ?>
change to
<!–?php if ($i==5): echo ” “; endif; ?>
<!–?php if ($i–>9): continue; endif; ?>

How to increase or decrease the maximum execution time of a php script

By default PHP script execution time is set for 30 seconds at php.ini file. This is the time limit set for all the files to finish its execution. If the file takes more than this set time then the execution of the script will be stopped and error message will be displayed like this.

Fatal error: Maximum execution time of 30 seconds exceeded in F:php_filesttest.php on line 14

This maximum execution time limit is set inside the php.ini file like this.

max_execution_time = 30 ; Maximum execution time of each script, in seconds

This value can be increased or decreased as per our requirement at php.ini file but note that in a server environment where many sites are hosted, any change in php.ini will affect all the sites hosted by the server. So this change is not possible unless you own the server and you are the only user. In a shared hosting our host may not like to change any settings of php.ini for our requirement. So there is a option to set the file execution time for the particular file at the individual file end. This adjustment of time limit has no effect if php is running in safe mode. Let us try to learn how this works.