View Single Post
  #2  
Old 01-03-2007, 12:44 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Change how products in the product list display in home_main.tpl for one category

If you want multiple categories with different layouts using different templates, we create a mod to create different template layouts and apply them to a category via the admin interface, and have a similar mod for product page display. Sample templates are also provided:


Multiple Category (Product Listing) Templates
http://www.websitecm.com/x-cart-mods/multiple-product-listing-templates-for-xcart.html

Multiple Product Page Templates
http://www.websitecm.com/x-cart-mods/multiple-product-templates.html

Package
http://www.websitecm.com/x-cart-mods/multiple-product-templates-package-for-xcart.html

If you need the one category only, then you can edit products.tpl and implement the following change:

FIND:

Code:
{if $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 4 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")} {include file="customer/main/products_t.tpl" products=$products}


Change to:

Code:
{if $current_category.categoryid eq "X"} {include file="customer/main/products_custom.tpl" products=$products} {elseif $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 4 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")} {include file="customer/main/products_t.tpl" products=$products}


Of course substitute your categoryid for X and use the name and location of your custom template. You can download products.tpl, rename it to products_custom.tpl and edit it.
Reply With Quote