Magento email configuration pain and how to solve it

It's nice to setup a magento shop, but one particular task is painful and time consuming : the modification  of automatic email templates . By defautl, email tempaltes in Magento are well designed as a sample given out to the developer, but when you expect to have your shop running in a few hours  time, it is really a pain to go through all emails jsut to change phone numbers, shop name, and opening times especially when this information could be centralized in the database.  The subject is not new and here a few hacks to let you work faster when setting up a shop

One Page javascript shopping cart

This one struck me because I can remember working out a javascript shopping cart back in 1996... Long time ago in terms of web time, and 13 years later the idea has popped again from some strange mind figuring out that simplicity does it all. If you've had enough of configuring complex ecommerce solutions like Magento or Prestashop, then simplecart(js) is for you. "No databases, no programming, no headaches. A simplejavascript shopping cart in under 20kb that you can setup in minutes. It's lightweight, fast, simple to use, and completely customizable. All you need to know is basic HTML." Works with Paypal and google checkout apparently.


Magento release 1.4

It's only alpha but I've tested it because I'm still running 1.2 and I'm waiting for serious reason to upgrade : I can tell you I've seriously avoided the basic Magento advice whic is 'never hack the core', and I have a dozen fixes implemented in the app/code/core section of my production install, which means a few hours upgrade. Reading Release notes was not very interesting so I decided I'd for a test drive. Well not much to say except the new tax system which is suited to european complexity, including or excluding shipping costs, reductions and other attributes are available in the system/ admin menu. The most noticeabl imporvement was not indeed produced by Magento but by google : remember at some time Chrome did not work well with the admin. This is now fixed, and thanks to a better cookie management chrome now handles magento admin pefectly, which means faster work. For enterprise users (9000 $ /year), a new video has been posted about private sales that offer special deals to users for a limited time using special member restricted access with invitations. Magento actually works well with emails, including reports on accepted invitations and generated sales. Enjoy.

Tomatocart rebuilds oscommerce


There are many discussions on whether oscommerce is dead or not. From an industry where every six months new products come online with ever more exciting new features, the longevity of Oscommerce, the first opensource e commerce application, is a good example of a bad designed  application theat does the job well. Os commerce evolution has stopped in 2005, when the first preview of the MS3 version - not yet released as of today - went public. What struck me with tomatocart is the backend interface, based on ext js desktop layout with charts by piwik / openchart flash . More info on

Magento / wordpress showcase : Rue de Siam


I've finally released my first Magento website, and it proves to be a  real SEO winner (100% increase in visits after 2 weeks). RuedeSiam is a furniture importer based in Brittany. Now you know why I bothered comparing commercial and opensource Flash based zoomers : Rue de Siam's website site features an implementation of image  a flash based zoom within a prototype lightbox gallery  (check out this one) . Interesting too is the specific template for the "At your home" showcase category that uses products with  specific layout. Magento is really great for customising layouts, I suppose that's partly a big feature of Zend Framework expressed at its best. One technique I used a lot is the css based text over image transparency effect that I detailed a while ago for WordPress on this blog. Works fine with Magento images categories except that the background image really has to be adjusted perfectly so I used phpthumbs instead of Magento's resizing helpers that seemed to complicated to understand at first.   I've also covered  various development challenges that I shared on this blog during the development :

And a few tips :

One advice : once you're running a Magento production web site, be careful with upgrades. The Sales extension did not work with 1.3.0 on my development server and I'm sticking to 1.2.x for the moment.

Magento product : display new product icon on product list

If you're working on Magento Ecommerce layouts and template design, you might have had a look at some nasty bugs, such the sort by price bug that's occuring on Magento's latest release (1.2..1). If you've spent a few minutes reading the fix for that bug on Magento's forums, you know what product collection means. Product Collection in Magento means an easy way of listing products for specific blocks : the big drawback is that product collections store arrays of products, and products inside don't always come fully loaded of details. That's why the few hacks below are useful to get the very basic attribute of every product on a decent ecommerce store : is that product new or not, and should I tell my customer which products are new ???


How to load new attribute : in Magento the new attribute is defined by two database fields (or attributes) : new from and new to .

  • Using these parameters in list.phtml requires you to modify the attribute set returned by the Mage_Catalog_Block_Product_List class to be found in app\code\core\Mage\Catalog\Block\Product\List.php
  • in function _getProductCollection, paste the following line
  • obvisouly this comes just after the product collection definition around line 75 of the List.php
    $this->_productCollection = $layer->getProductCollection();
  • your list.phtml template now has access to the data and checking that a product is new is as simple as performing PHP based date comparisons. We provide here basic comparison that will only work for products where both news_from and news_to have been filled. Add the following PHP code somewhere in your productcollection loop and the work is done !
    $now = date("Y-m-d");
    $newsFrom= substr($_product->getData('news_from_date'),0,10);
    $newsTo=  substr($_product->getData('news_to_date'),0,10);
    if ($now>=$newsFrom && $now<=$newsTo)
    {?> <h3 class="nouveauteProductList" >NEW PRODUCT!<h3><?};

This hack will be used on RueDeSiam's website (to be released next month,bookmark it now!)

Magento product page : how to display other products from same category

Magento comes with a lot of product relationship features :  implemented as selective lists maintained for each product by the shop owner, related / cross selling and up selling backend features allow some sort of manual product linking that displays product associations on the front end. For example related products are displayed by default in the product page right column, while upsell / crosssell products are displayed on the shopping cart page. These 3 types of product associations are well explained on inchoo's blog, and  on magento 's knowledge base you'll find user instructions on how to setup   product relationship in the backend.

What we aim here is to setup an automatic  display of related products on a product view page, via the categories they belong to. We build two loops : one that gets categories the product belongs to, and another one inside that gets products of each category.

How to setup category related products in Product view :

  1. add the following code somewhere in default\template\catalog\product\view.phtml
  2. Configure the category query according to your catalog by uncommenting the following :
    • ->setPage(1, 1) : selects only one category
    • ->addFieldToFilter('level',"3") : selects only 3rd level categories
    • ->addFieldToFilter('parent_id',"3") : select only child categories of no 3
    • ->setOrder("level") : combined by setPage, returns the lowest level category
  3. please that the product loop uses the $_product variable, which can be dangerous because this name is widely used. We use it here for comodity reasons because I just took toe display code from Magento's product list view
if ($_product) {
  // get collection of categories this product is associated with
  $categories =$_product->getCategoryCollection()
  //  ->setPage(1, 1)
// if the product is associated with any category
if ($categories->count()) 
foreach ($categories as $_category)
  $cur_category = Mage::getModel('catalog/category')->load($_category->getId());

Dans la même collection :getName()?>

addCategoryFilter($_category) ->addAttributeToSelect('small_image'); foreach ( $products as $productModel ) { $_product = Mage::getModel('catalog/product')->load($productModel->getId()); $width=135; $height=135; $_imageUrl = $this->helper('catalog/image')->init($productModel, 'small_image')->resize($width, $height); ?>
width="" height=""/> getPriceHtml($_product, true) ?> isSaleable()): ?>
__('Out of stock') ?>
getShortDescription()) ?> __('Learn More') ?>

opensource commerce : bakesale is back in the game

Great news this morning in the email : bakesale, a CAKE PHP based opensource ecommerce application, is back online with a new version scheduled mid february. Of course we don't expect a small team to compete with Magento but CAKE PHP users or learners will be delighted to find this application delievered  in a production state. New features include Some of the major features include  User Groups/Categories,  Easier Static Pages, Plugin Installer,  Theme Installer,  Discount codes. Something standard for ecommerce but worth mentionning because bakesale was among AJAX precursors in the opensource ecommerce business. Glad to be back online ?

Prestashop : How to setup thumbnail / combination link

The ability to make mulitple products out on one for size, color or other speicifications, is a great feature of Prestashop, but on small display trick is missing. Prestashop's default template (v1.1) includes the automatic resizing of multiple images for a product. It also allows the administrator / editor to specify one of the product images for each combination. As a result, the front end display of the product will let the combination select box interact with the mbig image display : here we explain how to modify the product template to let the thumbnail click act onthe combination choice.

Read more

How to install magento free themes

Well you've finally decided you're going to switch to Magento for building ecommerce website. While new versions of Magento coming up regularly make the learning curve easier to climb, be prepared for at least a few days before you can use magento's features to its best. This article explains the few tricks and tips that will start you off with variations on the basic design of magento's default installation.

Read more

Wysiwyg image mapping with Prestashop

Prestashop is an amazing example of very specific features that benefit large audiences : the new version 1.1 is still in beta stage but the image mapping feature is really impressive.  The objective  described in the products section of prestashop admin manager,  allows the administrator to select portions of a category image, link areas to a specific product,  all this stuff is linked to the products database, in a process that saves thousands of repetitive work  : "When a customer hovers over the image with the mouse, a pop-up appears displaying a brief description of the product. The customer can then click to open the product's full product page. To achieve this, please define the 'mapping zone' that, when hovered over, will display the pop-up. Left-click with your mouse to draw the four-sided mapping zone, then release. Then, begin typing the name of the associated product. A list of products appears. Click the appropriate product, then click OK. Repeat these steps for each mapping zone you wish to create. When you have finished mapping zones, click Save Image Map." The interface uses the jquery imgareaslect plugin and the result below proves that Rich Application Interface is not any more for the rich only.

Monday’s web applications

Javascript libraries

While EXTJS 3.0 is on the way with a roadmap setting deadlines for early 2009, Jquery continues its path on the way to serious lightweight alternative to the massive EXT : JX extension for Jquery includes the viewport paradigm on which relies every EXT JS application.

Web based interfaces

In spite of huge progress and impressive use of ease, Jquery is not there yet : for the development of applications many developers have chosen the exhaustivity of EXT JS. Have a look at google code hosted project in development : ecartcommerce, CMS jimw, both ext js and zend framework based. In the world of content management systems, mysource is making the news with a new video that demonstrates inline editing, and other exciting Rich Application features.

Magento promotions : flexibility in the form of rules

Promotions are always a result of  complex  marketing strategies : making them real on ecommerce involves either analytic programmation, or default product features : most ecommerce application come with product promotions schema, based on percentage or price reduction. In Magento, complex rules can be implemented from within the interface, that cover a wide variety of busines cases : based on shopping cart total, shipping method, product / attribute combination, or product characteristics, Magento offers various promotion modes, such as percentage of the original price, fixed reduction, fixed destination price... Well done Magento for this new implentation of a generic feature that will answer a lot of business needs.