Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Featured Products Custom Template Help Needed

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-28-2005, 04:28 PM
 
Bionet Bionet is offline
 

Member
  
Join Date: Aug 2004
Location: New Zealand
Posts: 14
 

Default Featured Products Custom Template Help Needed

Hi guyz,

I am trying to use a custom template for the front page - featured product area, that was given here by the lady who designed www.justforbubs.com.au.

My site is at www.labottegadellasalute.com.

It is the customer/main/products_t.tpl template and the code is the following:

Code:
{* $Id: products_t.tpl,v 1.10.2.7 2004/12/23 09:11:59 max 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 background="images/top.gif" border="0" cellpadding="0" cellspacing="0" height="5" width="100%"> <tbody><tr> <td align="left" valign="top">[img]images/ctl.gif[/img]</td> <td align="right">[img]images/ctr.gif[/img]</td> </tr> </tbody></table> <table class="menutable" align="center" border="0" cellpadding="2" cellspacing="2" width="100%" height="225px"> <tbody><tr> <td align="center" valign="top">{$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} <TABLE cellpadding="3" cellspacing="0" border="0"><TR><TD height="100"> {include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url}</td><td>{$products[product].descr|truncate:180:"...":true} </TD></TR> </TABLE> {/if} {$lng.lbl_see_details} {if $active_modules.Subscriptions ne "" and $products[product].catalogprice} {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="%d" 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">{$lng.lbl_our_price}: {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}, {$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} </td> </tr> </tbody></table> <table background="images/bottom.gif" border="0" cellpadding="0" cellspacing="0" height="5" width="100%"> <tbody><tr> <td align="left" valign="top">[img]images/cbl.gif[/img]</td> <td align="right">[img]images/cbr.gif[/img]</td> </tr> </tbody></table> {if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0} {include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid} {/if} {*** Uncomment it if you need 'Buy Now' button *** {if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"} {include file="customer/main/buy_now.tpl" product=$products[product]} {/if} *** Uncomment it if you need 'Buy Now' button ***} </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}

I ve copied the code and it did format my photos and text in the proper way, but I can't reproduce those fine borders around the products and text.

I ve coppied the image files bottom.gif, top.gif, cbl.gif, cbr.gif, ctl.gif and ctr.gif into my /www/images folder but nothing happened. IExplorer doesnt show any borders at all, and Firefox shows a small square at the corner of each product. I m not sure if I uploaded images at the right place (look at the code) if anybody can help that would be great.

Thanks a lot.
__________________
x-Card Gold 4.0
Reply With Quote
  #2  
Old 05-28-2005, 06:31 PM
 
longhorn180 longhorn180 is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Richmond, Virginia
Posts: 187
 

Default

Try putting the images in your skin1/images folder. Then instead of this:
Code:
[img]images/cbr.gif[/img]
Use this:
Code:
[img]{$ImagesDir}/cbr.gif[/img]
to call your images. This is the easiest way to use images in your templates.
__________________
4.1.9 (Linux) Live Store
www.thecrackedbook.com
Find used books and out of print books.
Reply With Quote
  #3  
Old 05-28-2005, 09:06 PM
 
Bionet Bionet is offline
 

Member
  
Join Date: Aug 2004
Location: New Zealand
Posts: 14
 

Default

Thanks a lot!

It works!
__________________
x-Card Gold 4.0
Reply With Quote
  #4  
Old 05-29-2005, 05:56 AM
 
longhorn180 longhorn180 is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Richmond, Virginia
Posts: 187
 

Default

No problem, glad you got it fixed.
__________________
4.1.9 (Linux) Live Store
www.thecrackedbook.com
Find used books and out of print books.
Reply With Quote
  #5  
Old 06-09-2005, 07:22 AM
 
ozi ozi is offline
 

Member
  
Join Date: Jun 2005
Posts: 23
 

Default Error

I have tried to install the above. But I get this error msg in the Featured Products box:

Warning: Smarty error: math: parameter x is empty in /home/ozidoggy/www/www/shop/Smarty-2.6.3/Smarty.class.php on line 1082

can anyone help pls?

Ozi
__________________
Version 4.1.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:16 AM.

   

 
X-Cart forums © 2001-2020