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

2-3 products per row viewing in product listing

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #21  
Old 02-09-2003, 05:46 PM
 
greggo greggo is offline
 

Member
  
Join Date: Oct 2002
Posts: 22
 

Default got it

Thanks.
__________________
Gregg Osofsky
Version 3.4.4 Gold
Reply With Quote
  #22  
Old 07-06-2003, 10:37 AM
 
toonarific toonarific is offline
 

Advanced Member
  
Join Date: Jul 2003
Posts: 92
 

Default

here is the error I get

Parse error: parse error, unexpected T_ELSE in W:\www-toonarific\xcart\templates_c\%%-13\%%-1366895660\products.tpl.php on line 140


can be found at

http://www.toonarific.com/xcart/customer/home.php
Reply With Quote
  #23  
Old 07-06-2003, 10:53 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

This isn't needed in v3.4.x onwards.

You error comes from the smarty text being incorrect -can you paste your code?
__________________
ex x-cart guru
Reply With Quote
  #24  
Old 07-06-2003, 11:32 AM
 
toonarific toonarific is offline
 

Advanced Member
  
Join Date: Jul 2003
Posts: 92
 

Default

Code:
{* $Id: products.tpl,v 1.21 2002/11/19 12:57:48 alfiya Exp $ *} <table border=0 width=100% cellspacing=0 cellpadding=0> <tr valign="top"> {section name=product loop=$products} <td valign="top"> <table width=100% border=0 cellpadding=0 cellspacing=0> <tr> <td width=100 rowspan="2" align=left valign=top> <a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=100 product=$products[product].product}</a> </td> <td valign=top> {$products[product].product|escape}</font> <font class="ProductDetails"> {$products[product].descr|truncate:300:"...":true} </font> {if $active_modules.Subscriptions ne "" and $products[product].catalogprice} {include file="modules/Subscriptions/subscription_info_inlist.tpl"} {else} {if $products[product].price ne 0} {if $products[product].discount ne 0} <font class=MarketPrice>{$lng.lbl_market_price}: <s> {math equation="price/(1-(discount/100))" price=$products[product].price discount=$products[product].discount format="%d.00" assign=unformatted}{include file="currency.tpl" value=$unformatted} </s></font> {/if} <font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].discount ne 0}, save {$products[product].discount}%{/if}{if $config.General.use_vat eq "Y"}, including VAT {$products[product].vat}%{/if} {else} <font class=ProductPrice>{$lng.lbl_enter_your_price}</font> {/if} {/if} </td> </tr> <tr> <td valign=top> <table width="80" border="0" cellspacing="0" cellpadding="2"> <tr valign="top"> <td><a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="buttons/showdetail.tpl"}</a></td> <td><form name=orderform_{%product.index%} method=post action="cart.php?mode=add"> <a href="javascript: document.orderform_{%product.index%}.submit()"> {include file="buttons/add_to_cart.tpl"}</a> <input type=hidden name=amount value=1> <input type=hidden name=mode value=add> <input type=hidden name=productid value="{$products[product].productid}"> <input type=hidden name=cat value="{$smarty.get.cat}"> <input type=hidden name=page value="{$smarty.get.page}"> </form></td> </tr> </table></td> </tr> </table> </td> {if $smarty.section.product.index is odd} </tr><tr valign="top"> {/if} {/section} </tr> </table> {else} {$lng.lbl_no_products_found} {/if} {/if}
Reply With Quote
  #25  
Old 07-07-2003, 12:45 AM
 
toonarific toonarific is offline
 

Advanced Member
  
Join Date: Jul 2003
Posts: 92
 

Default

did you get a chance to review the code yet?
Reply With Quote
  #26  
Old 07-24-2003, 10:39 AM
 
wallachee wallachee is offline
 

Senior Member
  
Join Date: Feb 2003
Posts: 102
 

Default Gap In Listings

The code provided earlier in this thread works great for me except for anyone using Internet Explorer. For some reason there is a huge gap in the poduct listings. You can see my site at: http://www.powerbookmedic.com/xcart1/

I'm using version 3.3.5, and my products.tpl code is below. What is causing this gap?

Code:
<table border=0 width=100% <tr> <td> <table border=0 width=100% > {section name=product loop=$products} б═ {if $smarty.section.product.index is div by 2} </tr> <tr valign="top"> б═ б═ б═ {/if} <td valign="top"> б═ б═ <table border=0 width=70%> <tr> б═ б═ б═<td width="20%" align=center valign=top><a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=70 product=$products[product].product} { $lng.lbl_see_details }</a></td> б═ б═ б═ <td valign=top width=100% >{$products[product].product|escape}</font> <font class=TableCenterProductTitleOrange></font><font size=1> {$products[product].descr|truncate:100:"...":true} </font><hr size=1 noshade width=130 align=left> б═ б═ б═ {if $active_modules.Subscriptions ne "" and $products[product].catalogprice} б═ б═ б═ {include file="modules/Subscriptions/subscription_info_inlist.tpl"} б═ б═ б═ {else} б═ б═ б═ {if $products[product].price ne 0} б═ б═ б═ {if $products[product].discount ne 0} б═ б═ б═ <font class=MarketPrice>{$lng.lbl_market_price}: <s>{math equation="(price/(100-discount))*100" price=$products[product].price discount=$products[product].discount format="%d.00" assign=unformatted}{include file="currency.tpl" value=$unformatted}</s> </font> б═ б═ б═ {/if} б═<div align="left"> б═ б═ <font class=TableCenterProductTitleOrange>{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].discount ne 0}, save {$products[product].discount}%{/if} б═ б═ б═ {else} б═ б═ б═<div align="left"> <font class=TableCenterProductTitleOrange>{$lng.lbl_enter_your_price}</font> б═ б═ б═ {/if} б═ б═ б═ {/if} б═ б═ б═ </td></tr> б═ б═ </table> б═ </td> б═ {/section} </td></tr></table> </td></tr></table>
Reply With Quote
  #27  
Old 07-24-2003, 08:24 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Compare it with mine. Mine works perfect for my needs, but is a little more simplified than yours.

Code:
{* $Id: products.tpl,v 1.21 2002/11/19 12:57:48 alfiya Exp $ and amended further by funkydunk.netand ADPBoss*} <table width=100% border=0 cellpadding=0 cellspacing=0> {section name=product loop=$products} {if $smarty.section.product.index is div by $config.General.products_per_row} <tr valign="top"> {/if} <td valign="top"> <table width=100% border=0 cellpadding=3 cellspacing=0> <tr> <td width=100 rowspan="2" align=left valign=top> <div align="center"><a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=100 product=$products[product].product}</a> {if $products[product].avail le 0}<font color="#FF0000" size="3">Sold Out!</font>{/if} </div></td> <td valign=top width=90%> {$products[product].product|escape}</font> {if $active_modules.Subscriptions ne "" and $products[product].catalogprice} {include file="modules/Subscriptions/subscription_info_inlist.tpl"} {else} {if $products[product].price ne 0} {if $products[product].discount ne 0} <font class=MarketPrice>{$lng.lbl_market_price}: <s> {math equation="price/(1-(discount/100))" price=$products[product].price discount=$products[product].discount format="%d.00" assign=unformatted}{include file="currency.tpl" value=$unformatted} </s></font> {/if} <font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].discount ne 0}, save {$products[product].discount}%{/if}{if $config.General.use_vat eq "Y"}, including VAT {$products[product].vat}%{/if} {else} <font class=ProductPrice>{$lng.lbl_enter_your_price}</font> {/if} {/if} </td> </tr> <tr> <td valign=top> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr valign="top"> <td><a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="buttons/details1.tpl"}</a></td> </tr> {if $products[product].avail gt 0} <tr valign="top"> <td><form name=orderform_{%product.index%} method=post action="cart.php?mode=add"> <a href="javascript: document.orderform_{%product.index%}.submit()"> {include file="buttons/add_to_cart1.tpl"}</a> <input type=hidden name=amount value=1> <input type=hidden name=mode value=add> <input type=hidden name=productid value="{$products[product].productid}"> <input type=hidden name=cat value="{$smarty.get.cat}"> <input type=hidden name=page value="{$smarty.get.page}"> </form></td></tr> {else}<tar valign="top"><td></td></tr>{/if} </table></td> </tr> </table> </td> {/section} </tr> </table>

Visit http://www.adpmods.com/xcart to preview how it looks and works. NOTE: I do have some fancy inventory stuff going on with displaying out of stock conditions. Unless you desire the same effect, DO NOT copy my code verbatim.

Good Luck!
Reply With Quote
  #28  
Old 07-24-2003, 10:16 PM
 
wallachee wallachee is offline
 

Senior Member
  
Join Date: Feb 2003
Posts: 102
 

Default

You're the man. After a couple hours, I finally got it...I found out I had one too many </td> in my code. It was screwing everything up. Thanks for the help.

-Bradley
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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

   

 
X-Cart forums © 2001-2020