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

Change product quantity from drop down to number input field

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #31  
Old 01-09-2006, 07:51 PM
 
Tuner Tuner is offline
 

eXpert
  
Join Date: Jan 2003
Location: Scottsdale Arizona
Posts: 245
 

Default

make sure to add this to the product.tpl
<Input type="hidden" name="minamount" value="{$product.min_amount}">

That will allow the javascript toknow the minimum ammount. I placed it with the text box but you can also place it with the other hidden inputs.

scott
__________________
\"Then again it could all be horse crap\"
by some old Guy.
4.013
Reply With Quote
  #32  
Old 06-08-2006, 12:57 PM
 
Dawn Howard Dawn Howard is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 229
 

Default

Works like a charm when the customer is viewing the product details! Thanks!

How can I make this happen when a customer is viewing all the products in a category?
__________________
Dawn
X-Cart Business 5.3.6.3
Mods:
Qty input - Custom Mod
Part numbers near title - Custom Mod
Membership approval before ordering - Custom Mod
Order Forms - Custom Mod
Freight on Board - Custom Mod
Catalog Order Form
Call For Price
Template: Crisp White skin
Running on Windows
Reply With Quote
  #33  
Old 07-12-2006, 10:04 AM
 
banzai banzai is offline
 

Newbie
  
Join Date: Oct 2005
Posts: 9
 

Default

Quote:
Originally Posted by Dawn Howard
Works like a charm when the customer is viewing the product details! Thanks!

How can I make this happen when a customer is viewing all the products in a category?

I opened /skin1/customer/main/buy_now.tpl and replaced

Code:
<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:
<input name=amount type="text" value="{$product.min_amount}" size="7" maxlength="5">
Reply With Quote
  #34  
Old 08-24-2006, 04:03 AM
 
ecommerce ecommerce is offline
 

eXpert
  
Join Date: Jul 2006
Posts: 267
 

Default Re: Change product quantity from drop down to number input field

Im on version 4. 0. 18,

are you guys still doing this

<input name=amount type="text" value="{$product.min_amount}" size="7" maxlength="5">

In product.tpl?

OR .....
is there something in tha admin panel that i can set?
I tried setting the quantity select box to 0, but it just went back to 50.

__________________
X-Cart 4.0.18 DBest
Reply With Quote
  #35  
Old 09-20-2006, 07:02 AM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default Re: Change product quantity from drop down to number input field

Quote:
Originally Posted by Dawn Howard
Works like a charm when the customer is viewing the product details! Thanks!

How can I make this happen when a customer is viewing all the products in a category?

Dawn, did you ever come up with a solution for this?

After making all the changes previously described in this thread, I am running into the same problem. When the customer is viewing the product details page (/cart/product.php, modified using product.tpl ) the JavaScript alert works fine if they try to order below the minimum. However, when the customer is on the page that lists all the products in one category (cart/home.php?cat=255, modified using buy_now.tpl) they do not get the alert and they still get the message "You are not allowed to access that resource!".

The changes I made to product.tpl and buy_now.tpl are identical. The problem seems to be that the Javascript FormValidation is not availalbe on the category listing pages. Is there an appropriate way to make this available on all pages?
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
Reply With Quote
  #36  
Old 09-20-2006, 08:15 AM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default Re: Change product quantity from drop down to number input field

An update to this issue...it was simple enough to include the necessary JavaScript on each page by adding: {include file="form_validation_js.tpl"} to /cart/home.php .

That still didn't solve the problem.

The reason the Javascript alert works on the individual detail pages is that there is only one form on these pages and its name is "orderform" and that is picked up by the "document.orderform.amount.value" in the FormValidation() function.

The reason its not working on the catagory pages that list multiple products, is that there is a different form for each product. Each one has a different name that is dynamically created and is something like "orderform_16152_1154021436". The Javascript FormValidation() function will only be triggered on forms named "orderform".

Anyway, if anyone has an idea how to handle this wrinkle, I would appreciate it as I am stuck at this point.
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
Reply With Quote
  #37  
Old 12-14-2007, 01:41 PM
 
stuartn stuartn is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 48
 

Default Re: Change product quantity from drop down to number input field

I have a problem with qty's, no matter what qty you input the amount sent to cart is always 1

Any clues ?

X-Cart version 4.0.18
__________________
Cheers
Stuart
-----------------------
X-Cart Version
Gold 5.4.2
Reply With Quote
  #38  
Old 04-02-2008, 02:35 PM
  designtheweb's Avatar 
designtheweb designtheweb is offline
 

Senior Member
  
Join Date: Mar 2005
Location: Sydney Australia
Posts: 132
 

Default Re: Change product quantity from drop down to number input field

I am on version 4.1.9 - is there an update for changing the quanity from drop down to number input?
__________________
"The more you know - the less you pay"

Various websites using

4.66 Pro & 5
Reply With Quote
  #39  
Old 06-10-2008, 01:15 PM
 
wendy.email wendy.email is offline
 

Advanced Member
  
Join Date: Jun 2005
Location: Canada
Posts: 90
 

Default Re: Change product quantity from drop down to number input field

anyone? please
__________________
Version 4.1.11
Reply With Quote
  #40  
Old 06-10-2008, 02:08 PM
 
stuartn stuartn is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 48
 

Default Re: Change product quantity from drop down to number input field

in product template

<tr>
<td width="30%">{$lng.lbl_quantity}</td>
<td><input type="text" name="amount" size="2" maxlength="2" value="{$product.min_amount}"/></td>
</tr>
__________________
Cheers
Stuart
-----------------------
X-Cart Version
Gold 5.4.2
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 12:08 AM.

   

 
X-Cart forums © 2001-2020