View Single Post
  #12  
Old 05-16-2006, 08:51 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Zaja,

The code you so generously supplied is working like a charm, again thank you so much. But I have a little problem with it that I can't figure out. I'm sure it's a simple one - well I hope it's a simple one

The 'add to cart' button displays in product listings even if the item is out of stock. Is there a simple fix for this?

Cheers,

G

Quote:
Originally Posted by Zaja
Grant, do you feel lucky today?

Replace products.tpl code with this:
Code:
{* $Id: products.tpl,v 1.45.2.17 2006/04/21 08:53:50 svowl Exp $ *} {if $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 4 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")} {include file="customer/main/products_t.tpl" products=$products} {else} {if $products} {section name=product loop=$products} {assign var="discount" value=0} <table border="0" cellpadding="5" cellspacing="1" width="100%"> <tr style="background-color:{cycle values="#eee,#fff};"> <td style="width:300px;"> <font class="ProductTitle">{$products[product].product}</font> </td> <td> {if $products[product].product_type eq "C"} {include file="buttons/details.tpl" href="product.php?productid=`$products[product].productid`&cat=`$cat`&page=`$navigation_page`"} {else} {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} <font class="ProductPrice">{include file="currency.tpl" value=$products[product].taxed_price}</font> {/if} {/if} </td> <td style="text-align:right;width:110px;"> {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="productid" value="{$products[product].productid}"> <input type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}"> <input type="hidden" name="page" value="{$smarty.get.page|escape:"html"}"> <input type="hidden" name="amount" value="1"> <input type="button" value="{$lng.lbl_add_to_cart}" onclick="document.orderform_{$products[product].productid}_{$products[product].add_date}.submit();"> </form> {/if} </td> {/if} </tr> </table> {/section} {else} {$lng.txt_no_products_found} {/if} {/if}
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote