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

2 Row Featured Products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-21-2003, 09:30 AM
 
jpsowin jpsowin is offline
 

X-Adept
  
Join Date: Sep 2002
Posts: 459
 

Default 2 Row Featured Products

Since I'm feeling nice and someone asked for it, here is the code I use to display my featured products in 2 seperate rows. This took me a while to do, since I'm not an expert in SMARTY tags. Anyhoo, here it is.

Code:
{* $Id: featured.tpl,v 1.13 2002/05/20 06:55:20 lucky Exp $ *} {* petsupplyonline featured products template *} {* not released under any licence, not allowed to sell this *} {capture name=dialog} {if $f_products ne ""} {section name=product loop=$f_products} { if %product.first% } <table border="0" width="500" align="center"> {/if} { if %product.index% is even } <tr> <td><table width="250" border="0" > <tr> <td width="80" rowspan="5"> {* IMAGE *} <a href=product.php?productid={$f_products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$f_products[product].productid product=$f_products[product].product}</a></td> </tr> <tr> <td> {* NAME *} {$f_products[product].product|escape}</font> <font class=ProductTitle></font> </td> </tr> <tr> <td> {* DESCRIPTION *} {$f_products[product].descr|truncate:135:"...":true} </td> </tr> <tr> <td> {* PRICE *} <font class=ProductPriceTitle>Price: {include file="currency.tpl" value=$f_products[product].price}</font><font class=ProductPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$f_products[product].price}</font> </td> </tr> <tr> <td> <a href=product.php?productid={$f_products[product].productid}&cat={$cat}&page={$navigation_page}> { include file="buttons/more_info.tpl" } </a> </td> </tr> </table> </td> {else} <td><table width="250" border="0"> <tr> <td width="80" rowspan="5"> {* IMAGE *} <a href=product.php?productid={$f_products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$f_products[product].productid product=$f_products[product].product}</a></td> </tr> <tr> <td> {* NAME *} {$f_products[product].product|escape}</font> <font class=ProductTitle></font> </td> </tr> <tr> <td> {* DESCRIPTION *} {$f_products[product].descr|truncate:135:"...":true} </td> </tr> <tr> <td> {* PRICE *} <font class=ProductPriceTitle>Price: {include file="currency.tpl" value=$f_products[product].price}</font><font class=ProductPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$f_products[product].price}</font> </td> </tr> <tr> <td> <a href=product.php?productid={$f_products[product].productid}&cat={$cat}&page={$navigation_page}> { include file="buttons/more_info.tpl" } </a> </td> </tr> </table> </td> </td> </tr> {/if} { if %product.last% } </table> {/if} {/section} {else} {$lng.txt_no_featured} {/if} {/capture} {include file="dialog.tpl" title=$lng.lbl_featured_products content=$smarty.capture.dialog extra="width=100%"}
__________________
Joshua Sowin
...taking things one TPL at a time.
Reply With Quote
  #2  
Old 01-29-2003, 12:46 PM
 
chiringill@yahoo.com chiringill@yahoo.com is offline
 

Newbie
  
Join Date: Jan 2003
Location: UK
Posts: 9
 

Default

thanks a lot !! that looks great ! keep up the good work on the site !
Reply With Quote
  #3  
Old 02-04-2003, 01:08 PM
 
nev nev is offline
 

Member
  
Join Date: Jan 2003
Posts: 10
 

Default Great

This is great, but whats with the more_info.tpl as I cannot find this in my installation?

Thanks
Nev
Reply With Quote
  #4  
Old 02-04-2003, 02:04 PM
 
jpsowin jpsowin is offline
 

X-Adept
  
Join Date: Sep 2002
Posts: 459
 

Default

Oh sorry, that's my own thing... just take it out and it'll be fine.
__________________
Joshua Sowin
...taking things one TPL at a time.
Reply With Quote
  #5  
Old 02-04-2003, 02:17 PM
 
Blackhawk Blackhawk is offline
 

Senior Member
  
Join Date: Dec 2002
Location: United States
Posts: 101
 

Default hmm

I copied this in to replace my featured.tpl since I hadn't done anything with it yet.. and it doesn't do anything at all.

I must be daft.
Reply With Quote
  #6  
Old 02-04-2003, 05:26 PM
 
jpsowin jpsowin is offline
 

X-Adept
  
Join Date: Sep 2002
Posts: 459
 

Default

Did I mention to always make backups and that I'm not responsible for any explosions

It works for 3.3.2, I'm not sure about the others.
__________________
Joshua Sowin
...taking things one TPL at a time.
Reply With Quote
  #7  
Old 02-04-2003, 06:13 PM
 
Blackhawk Blackhawk is offline
 

Senior Member
  
Join Date: Dec 2002
Location: United States
Posts: 101
 

Default :)

Well that's no help!!
Reply With Quote
  #8  
Old 02-04-2003, 06:44 PM
 
jpsowin jpsowin is offline
 

X-Adept
  
Join Date: Sep 2002
Posts: 459
 

Default

I don't know what to tell you... it should display something even if it's an error. Are you running 3.3.2?
__________________
Joshua Sowin
...taking things one TPL at a time.
Reply With Quote
  #9  
Old 02-04-2003, 09:49 PM
 
Blackhawk Blackhawk is offline
 

Senior Member
  
Join Date: Dec 2002
Location: United States
Posts: 101
 

Default Featured

I'll check it out more.. I'm running 3.3.1
Reply With Quote
  #10  
Old 02-04-2003, 09:51 PM
 
Blackhawk Blackhawk is offline
 

Senior Member
  
Join Date: Dec 2002
Location: United States
Posts: 101
 

Default Featured

Do I have to enable something?

My front page has a "Featured Products" section.. and nothing list.. no error.. nothing.. ??
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 04:09 AM.

   

 
X-Cart forums © 2001-2020