X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing and adding new features (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   2 Row Featured Products (https://forum.x-cart.com/showthread.php?t=1241)

jpsowin 01-21-2003 09:30 AM

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%"}


chiringill@yahoo.com 01-29-2003 12:46 PM

thanks a lot !! that looks great ! keep up the good work on the site !

nev 02-04-2003 01:08 PM

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

Thanks
Nev

jpsowin 02-04-2003 02:04 PM

Oh sorry, that's my own thing... just take it out and it'll be fine.

Blackhawk 02-04-2003 02:17 PM

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.

jpsowin 02-04-2003 05:26 PM

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

It works for 3.3.2, I'm not sure about the others.

Blackhawk 02-04-2003 06:13 PM

:)
 
Well that's no help!!

jpsowin 02-04-2003 06:44 PM

I don't know what to tell you... it should display something even if it's an error. Are you running 3.3.2?

Blackhawk 02-04-2003 09:49 PM

Featured
 
I'll check it out more.. I'm running 3.3.1

Blackhawk 02-04-2003 09:51 PM

Featured
 
Do I have to enable something?

My front page has a "Featured Products" section.. and nothing list.. no error.. nothing.. ??


All times are GMT -8. The time now is 07:11 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.