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)
-   -   Change product quantity from drop down to number input field (https://forum.x-cart.com/showthread.php?t=2428)

wayfarer 04-24-2003 12:52 AM

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?

funkydunk 04-24-2003 04:03 AM

This is in products.tpl

Jon 04-24-2003 11:33 AM

What provisions need to be made to ensure that the field is numeric and not going to cause complications?

funkydunk 04-24-2003 01:39 PM

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

8)

wayfarer 04-24-2003 03:50 PM

Excuse the newbie question, but which code should I replace, with what?

Jon 04-24-2003 03:55 PM

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">

wayfarer 04-24-2003 05:35 PM

:D Sweeeeeet! Thanks!

gfiebich 05-28-2003 06:06 AM

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

Jon 05-28-2003 10:28 AM

If I was using minimum and/or maximum quantity I'd stick with the drop down box personally.

adpboss 10-10-2003 07:16 PM

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?


All times are GMT -8. The time now is 02:57 PM.

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