How to Show Static Block in theme Magento

Share
Posted on February 17th, 2012 | Posted by admin

Create an Static Block from your CMS admin tab and show it in your theme.

In my case I wanted to call a Static Block from my theme to show up in the sidebar.

I edited my theme file called 2columns-left.phtml and then added the following code.

Please notice you need to replace the YourBlockId with your own Static Block Id.

<?php echo $this->getLayout()->createBlock(‘cms/block’)
->setBlockId(‘YourBlockId’)->toHtml() ?>

How to show Tier prices Magento

Share
Posted on February 4th, 2012 | Posted by admin

Do you want to show tier prices in your product list or product view?

The function

The function we need to use is:

$this->getTierPrices($_product);

Version

I’ve tested my code in a Magento 1.3 version.

Code

You should paste this close to where the main price os printed.

Please notice the formated_price_incl_tax you may change this if you’re using excluding tax.

How to Show Static Block in theme Magento

Share
Posted on February 4th, 2012 | Posted by admin

Create an Static Block from your CMS admin tab and show it in your theme.

In my case I wanted to call a Static Block from my theme to show up in the sidebar.

I edited my theme file called 2columns-left.phtml and then added the following code.

Please notice you need to replace the YourBlockId with your own Static Block Id.

<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘YourBlockId’)->toHtml() ?>

How To Show Most Viewed & Best Selling Products In Magento Store

Share
Posted on January 26th, 2012 | Posted by admin

Lately, we have noticed that many Magento store owners started asking us how to show most viewed

products or best selling products on their store’s home page or some other places in their store.

Unfortunately, there is nothing like these feature pre built in Magento core so you have to tweak

and write some lines of code to make it work.

Display Most Viewed Products

Step 1: Create a file app/code/local/Mage/Catalog/Block/Product/Mostviewed.php

How to show additional fields in magento abandoned carts grid

Share
Posted on January 16th, 2012 | Posted by admin

Magento Abandoned carts report gives the list of customers who have added products to the shopping cart and logged out without placing orders, the products they placed will still be in their cart. Abandoned carts report will be shown as a grid in admin panel. This report notifies the store owner about the customers who have abandoned their carts, later the store admin can inform to the respective customer and make them clear their cart.
Recently I got a client requirement to show the customer telephone field in the abondoned cart grid. As it will be useful for the admin to call customers and alert them to complete their orders.

To add additional field to abandoned carts

Step 1: Copy the file app\code\core\Mage\Adminhtml\Block\Report\Shopcart\Abandoned\Grid.php to the local directory app\code\local\Mage\Adminhtml\Block\Report\Shopcart\Abandoned\Grid.php. Whenever a Core file is copied to the local directory structure, the file included in the local directory will get preference and it will be taken.

Step 2: Now in the _prepareCollection method we need to join our additional field to the existing collection. A collection is an array of model class objects.