X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Getting rid of drop down quantity box (https://forum.x-cart.com/showthread.php?t=10730)

Bodhipaksa 12-04-2004 07:01 AM

Getting rid of drop down quantity box
 
I want to get rid of the drop down quantity box so that the default added to the cart is 1 item. Following instructions in another post I tried replacing

Code:
Quote:

<select name=amount>
{if $product.min_amount le 1}
{assign var="start_quantity" value=1}
{else}
{assign var="start_quantity" value=$product.min_amount}
{/if}
{section name=quantity loop=$mq start=$start_quantity}
<option value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</option>
{/section}
</select>


with

Code:
Quote:

<input type="hidden" name="amount" value="1">

Unfortunately this didn't work. The drop down box stayed although whatever quantity you selected only one item would be added to the cart. Can anyone suggest a resolution?

Thanks!

adpboss 12-04-2004 10:15 AM

On a version 3.4 store?

Bodhipaksa 12-04-2004 10:22 AM

Hi adpboss,

Quote:

On a version 3.4 store?

Yes indeed. I have someone working on upgrading the store, but as he said, "The 3.4.x >> 3.5 was having issues," so we're a bit stuck at the moment.

Thanks.

Bodhipaksa 12-04-2004 10:42 AM

Just realized the drop down box has gone from the product details page, so I've had partial success. It was the featured products area I was trying to work on so I've presumably just changed the wrong tpl file. I'll hunt again for the same code elsewhere.

adpboss 12-04-2004 10:46 AM

It might be buynow.tpl. Hope that helps.

Bodhipaksa 12-04-2004 11:29 AM

That's the one! I'd just tracked it down by using windows explorer to search for files in the customer/main folder containing the term "select" Nw I just need to figure out exactly what to change. Boy, this software is complicated!

adpboss 12-04-2004 11:41 AM

Learn how to use the Webmaster Mode. It will make your life easier in the future.

I wish X-Cart made Webmaster Mode Instructions page one of the manual.

Bodhipaksa 12-04-2004 06:22 PM

Thanks for the suggestion. I'll try to get to grips with Webmaster Mode as soon as possible.

Right now I'm struggling to work out which bit of the code below to comment out in order to lose the drop-down box but keep the "add to cart" button, and have that button add one item to the cart by default. Any help would be much appreciated.

Code:

{* $Id: buy_now.tpl,v 1.5.2.1 2003/08/18 13:27:14 svowl Exp $ *}
{if $js_enabled}
<table border=0 width=100% cellpadding=0 cellspacing=0>
{if ($active_modules.Product_Options ne "" and $product.product_options) or $product.price eq 0}
<tr>
<td height=25>
{include file="buttons/buy_now.tpl"}
</td>
</tr>
{else}
<FORM name="orderform_{$product.productid}_{$product.add_date}" method=post action="cart.php?mode=add">
<input type=hidden name=productid value="{$product.productid}">
<input type=hidden name=cat value="{$smarty.get.cat|escape:"html"}">
<input type=hidden name=page value="{$smarty.get.page|escape:"html"}">
<tr>
{if $product.distribution eq ""}
<td height=25 width=15% nowrap>{$lng.lbl_quantity}
</td>
<td width=20%>
{if $config.General.unlimited_products ne "Y" and ($product.avail le 0 or $product.avail lt $product.min_amount)}
{$lng.txt_out_of_stock}
{else}
{if $config.General.unlimited_products eq "Y"}
{math equation="x+1" assign="mq" x=$config.Appearance.max_select_quantity}
{else}
{math equation="x/y" x=$config.Appearance.max_select_quantity y=$product.min_amount assign="tmp"}
{if $tmp<2}
{assign var="minamount" value=$product.min_amount}
{else}
{assign var="minamount" value=0}
{/if}
{math equation="min(maxquantity+minamount, productquantity)+1" assign="mq" maxquantity=$config.Appearance.max_select_quantity minamount=$minamount productquantity=$product.avail}
{/if}
<select name=amount>
{if $product.min_amount le 1}
{assign var="start_quantity" value=1}
{else}
{assign var="start_quantity" value=$product.min_amount}
{/if}
{section name=quantity loop=$mq start=$start_quantity}
<option value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</option>
{/section}
</select>
{/if}
</td>
{else}
<input type=hidden name="amount" value="1">
{/if}
<td height=25>
<input type=hidden name=mode value=add>
{include file="customer/main/product_prices.tpl"}
{if $config.General.unlimited_products eq "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)}
{if $js_enabled}
{include file="buttons/buy_now.tpl"}

{if $login ne "" and $active_modules.Wishlist ne ""}
{include file="buttons/add_to_wishlist.tpl"}
{/if}
{else}
{include file="submit_wo_js.tpl" value=$lng.lbl_add_to_cart}
{/if}
{/if}
</td>
</tr>
</FORM>
{if $product.min_amount gt 1}
<tr>
<td colspan=3><FONT class=ProductDetailsTitle>{$lng.txt_need_min_amount} {$product.min_amount} {$lng.lbl_items}</FONT>
</td>
</tr>
{/if}
{/if}
</table>
{/if}


Bodhipaksa 12-07-2004 02:57 PM

Anyone have any ideas?

Fearthespear2k4 12-08-2004 04:17 PM

I would like to know the answer to this as well, I am using X-Cart version 3.5.12

** I just put 0 somewhere and no my quantity box doesn't show. cool!


All times are GMT -8. The time now is 12:19 PM.

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