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
  #1  
Old 04-24-2003, 12:52 AM
 
wayfarer wayfarer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 56
 

Default Change product quantity from drop down to number input field

Which template do I need to change and (with what code) do I need to change to replace the product quantity drop down menu in a normal product table, to a normal quantity input field?
Reply With Quote
  #2  
Old 04-24-2003, 04:03 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

This is in products.tpl
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 04-24-2003, 11:33 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

What provisions need to be made to ensure that the field is numeric and not going to cause complications?
Reply With Quote
  #4  
Old 04-24-2003, 01:39 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

That is already inbuilt into cart.php and will not cause a problem.

__________________
ex x-cart guru
Reply With Quote
  #5  
Old 04-24-2003, 03:50 PM
 
wayfarer wayfarer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 56
 

Default

Excuse the newbie question, but which code should I replace, with what?
Reply With Quote
  #6  
Old 04-24-2003, 03:55 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Code:
<select name=amount> {if $products[product].min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$products[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>

Replace with this code and that should do it:

Code:
<input type="text" name="amount" size="3">
Reply With Quote
  #7  
Old 04-24-2003, 05:35 PM
 
wayfarer wayfarer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 56
 

Default

Sweeeeeet! Thanks!
Reply With Quote
  #8  
Old 05-28-2003, 06:06 AM
 
gfiebich gfiebich is offline
 

Senior Member
  
Join Date: Feb 2003
Location: St. Paul, MN
Posts: 108
 

Default made the modification - now Access Denied problem

I've changed my quantity field as described above - but now have this problem:

Product has a minimum quantity - must purchase 100. If user enters a number less than 100, resulting page reads "Access Denied! You are not allowed to access that resource!". Any ideas? I'm assuming the cart is trying to redirect me to a page alerting me that I didn't enter a valid quantity, but for some reason isn't getting there.

thanks in advance!
Glen
Reply With Quote
  #9  
Old 05-28-2003, 10:28 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

If I was using minimum and/or maximum quantity I'd stick with the drop down box personally.
Reply With Quote
  #10  
Old 10-10-2003, 07:16 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

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

Default

How would I set the default value of this text box to "1"?

So the box would read "1" but the user could change that number via highlight or delete and add their own number.

Make sense?
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 01:02 PM.

   

 
X-Cart forums © 2001-2020