X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Add to cart button on product listing (https://forum.x-cart.com/showthread.php?t=816)

DataViking 06-22-2003 01:47 AM

Thanks for the code, works great :lol:

YuriC 06-23-2003 12:01 PM

How about this feature
 
http://www.worldhealthproducts.com/xcart-musclesoft/customer/home.php

DataViking 06-23-2003 04:54 PM

YuriC
 
I like yours a lot. Is any chance that you will share the code?

YuriC 06-24-2003 02:20 PM

I dont see why not
 
Here you go. Replace your products.tpl with this code

Code:

{* $Id: products.tpl,v 1.21.2.2 2003/03/11 10:49:14 svowl Exp $ *}
{* mod by YuriC *}
{section name=product loop=$products}
<table border=0 width=100%>
<tr><td width=90 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>
{$products[product].product}</font>
<font size=1>




{$products[product].descr|truncate:300:"...":true}


</font>
<hr size=1 noshade width=230 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/(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"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if}
{else}
<font class=ProductPrice>{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
<form name="form{$products[product].productid}" method=post action="cart.php?mode=add">
{$lng.lbl_quantity}:{if $product.min_amount gt 1}
<FONT class=ProductDetailsTitle>{$lng.txt_need_min_amount} {$product.min_amount} {$lng.lbl_items}</FONT>{/if}

{if $config.General.show_in_stock eq "Y" and ($product.avail le 0 or $product.avail lt $product.min_amount)}
{$lng.txt_out_of_stock}
{else}
{if $config.General.show_in_stock ne "Y"}
{assign var="mq" value=$config.General.max_select_quantity}
{else}
{math equation="min(maxquantity+minamount, productquantity)+1" assign="mq" maxquantity=$config.General.max_select_quantity minamount=$product.min_amount productquantity=$product.avail}
{/if}
<input type=hidden name=mode value=add>
{if $product.distribution eq ""}
{if $product.min_amount le 1}
{assign var="start_quantity" value=1}
{else}
{assign var="start_quantity" value=$product.min_amount}
{/if}
<input type="text" name="amount" value="{$start_quantity}" size="2">

<font class=FormButton>{$lng.lbl_add_to_cart} [img]{$ImagesDir}/GOboutonWhiteBkg.gif[/img]</font>
{else}
<font class=ProductDetailsTitle>1</font><input type=hidden name=amount value=1> {$lng.txt_product_downloadable}
{/if}
{/if}
<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>






{/section}

use it under your own consent

pauld 09-05-2003 03:51 PM

OK great job you guys this is exactly what I was looking for.

:)

pauld 09-08-2003 05:49 PM

Quote:

Originally Posted by John7
Actually you see its the code itself. I think it needs to be modified to be able to do more than just display the ad buttom it needs to display the choice of which color.

Do you understand?


Did you ever receive a reply to this??????


All times are GMT -8. The time now is 07:05 AM.

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