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

Getting rid of drop down quantity box

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-04-2004, 07:01 AM
 
Bodhipaksa Bodhipaksa is offline
 

Advanced Member
  
Join Date: May 2004
Posts: 41
 

Default 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!
__________________
X-Cart version: 4.3.1
Web server: Apache
Operation system: Linux
Reply With Quote
  #2  
Old 12-04-2004, 10:15 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

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

Default

On a version 3.4 store?
Reply With Quote
  #3  
Old 12-04-2004, 10:22 AM
 
Bodhipaksa Bodhipaksa is offline
 

Advanced Member
  
Join Date: May 2004
Posts: 41
 

Default

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.
__________________
X-Cart version: 4.3.1
Web server: Apache
Operation system: Linux
Reply With Quote
  #4  
Old 12-04-2004, 10:42 AM
 
Bodhipaksa Bodhipaksa is offline
 

Advanced Member
  
Join Date: May 2004
Posts: 41
 

Default

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.
__________________
X-Cart version: 4.3.1
Web server: Apache
Operation system: Linux
Reply With Quote
  #5  
Old 12-04-2004, 10:46 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

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

Default

It might be buynow.tpl. Hope that helps.
Reply With Quote
  #6  
Old 12-04-2004, 11:29 AM
 
Bodhipaksa Bodhipaksa is offline
 

Advanced Member
  
Join Date: May 2004
Posts: 41
 

Default

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!
__________________
X-Cart version: 4.3.1
Web server: Apache
Operation system: Linux
Reply With Quote
  #7  
Old 12-04-2004, 11:41 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

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

Default

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.
Reply With Quote
  #8  
Old 12-04-2004, 06:22 PM
 
Bodhipaksa Bodhipaksa is offline
 

Advanced Member
  
Join Date: May 2004
Posts: 41
 

Default

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}
__________________
X-Cart version: 4.3.1
Web server: Apache
Operation system: Linux
Reply With Quote
  #9  
Old 12-07-2004, 02:57 PM
 
Bodhipaksa Bodhipaksa is offline
 

Advanced Member
  
Join Date: May 2004
Posts: 41
 

Default

Anyone have any ideas?
__________________
X-Cart version: 4.3.1
Web server: Apache
Operation system: Linux
Reply With Quote
  #10  
Old 12-08-2004, 04:17 PM
 
Fearthespear2k4 Fearthespear2k4 is offline
 

Member
  
Join Date: Jun 2004
Posts: 21
 

Default

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!
__________________
X-Cart 4.0.19
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 08:40 AM.

   

 
X-Cart forums © 2001-2020