View Single Post
  #11  
Old 05-15-2006, 08:33 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Ok I've sorted it out now. I'm using multiple templates for both products and catergories. Here is the products_t.tpl I played around with below just in case it's at all useful to anybody else and a little screen shot of how it renders.

http://www.wyzeshop.com/screenshot5.jpg

Quote:
{* $Id: products_t.tpl,v 1.10.2.12 2006/02/27 08:53:50 svowl Exp $ *}
<TABLE border="0" width="100%" cellpadding="0" cellspacing="0"><TR><TD class="TableThumbnailBorder">

<TABLE border="0" width="100%" cellpadding="5" cellspacing="1">

{math equation="floor(100/x)" x=$config.Appearance.products_per_row assign="width"}

{section name=product loop=$products}
{assign var="discount" value=0}

{if %product.index% is div by $config.Appearance.products_per_row}
<TR>
{assign var="cell_counter" value=0}
{/if}

{math equation="x+1" x=$cell_counter assign="cell_counter" }

<TD align="center" valign="top" width="{$width}%" class="DialogBox">
<TABLE cellpadding="3" cellspacing="0" border="0" height="120">
<TR>
<TD height="100" width="60"> <A href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}">{i nclude
file="product_thumbnail.tpl" productid=$products[product].productid
image_x=$config.Appearance.thumbnail_width product=$products[product].product
tmbn_url=$products[product].tmbn_url}</A>
</TD>
<TD width="439">{$products[product].product}

{$lng.lbl_sku}: {$products[product].productcode}

{if $active_modules.Special_Offers ne "" and $products[product].have_offers}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl"
product=$products[product]} {else}{/if} {if $products[product].product_type
ne "C"} </TD>
<TD width="150">{if $active_modules.Subscriptions ne "" and ($products[product].catalogprice
gt 0 or $products[product].sub_priceplan gt 0)} {include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else} {if $products[product].taxed_price ne 0} {if $products[product].list_price
gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price
lprice=$products[product].list_price format="%3.0f" assign=discount}
{if $discount gt 0} <FONT class="MarketPrice">{$lng.lbl_market_price}:
<S> {include file="currency.tpl" value=$products[product].list_price}
</S></FONT>

{/if} {/if} <FONT class="ProductPrice">{include file="currency.tpl"
value=$products[product].taxed_price}</FONT><FONT class="MarketPrice">{include
file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</FONT>{if
$discount gt 0}{if $config.General.alter_currency_symbol ne
""}, {/if}{$lng.lbl_save_price} {$discount}%{/if} {if $products[product].taxes}

{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if}
{else} <FONT class="ProductPrice">{$lng.lbl_enter_your_price}</FONT>
{/if} {/if} {if $active_modules.Feature_Comparison ne '' &&
$products[product].fclassid > 0}

{include file="modules/Feature_Comparison/compare_checkbox.tpl"
id=$products[product].productid} {/if}</TD>
<TD width="100">{if $usertype eq "C" and $config.Appearance.buynow_button_enabled
eq "Y"}
<form style="margin:0;" name="orderform_{$products[product].productid}_{$products[product].add_date}" method="post" action="cart.php?mode=add">
<input type="hidden" name="productid2" value="{$products[product].productid}">
<input type="hidden" name="cat2" value="{$smarty.get.cat|escape:"html"}">
<input type="hidden" name="page2" value="{$smarty.get.page|escape:"html"}">
<input type="hidden" name="amount2" value="1">
<input name="button" type="button" value="{$lng.lbl_add_to_cart}" onclick="document.orderform_{$products[product].productid}_{$products[product].add_date}.submit();">
</form>
{/if}</TD>
</TR>
</TABLE>

{/if} </TD>

{capture name=prod_index}
{math equation="index+x+1" index=%product.index% x=$config.Appearance.products_per_row}
{/capture}
{if $smarty.capture.prod_index is div by $config.Appearance.products_per_row }
</TR>
{/if}

{/section}

{if $cell_counter lt $config.Appearance.products_per_row}
{section name=rest_cells loop=$config.Appearance.products_per_row start=$cell_counter}
<TD class="DialogBox"></TD>
{/section}
</TR>
{/if}

</TABLE>
</TD></TR></TABLE>
{if $active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y'}
{include file="modules/Feature_Comparison/compare_selected_button.tpl"}
{/if}
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote