| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Change product quantity from drop down to number input field | ||||
|
|
Thread Tools | Search this Thread |
#41
|
|||||||
|
|||||||
Re: Change product quantity from drop down to number input field
Hi Stuart,
I've been searching for this answer... Your code works! Can you tell me if there's something different I need to do for v4.1.9 with the buy_now.tpl? I still need to remove the quantity drop down box. I found the section for buy_now.tpl, but in my v4.1.9 it's a little different than previously posted: {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/if} {if $config.General.unlimited_products eq "Y"} {math equation="x+y" assign="mq" x=$mq y=$start_quantity} {/if} <select name="amount"> {section name=quantity loop=$mq start=$start_quantity} <option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option> {/section} </select> ...when I try to comment this out and add <input name=amount type="text" value="{$product.min_amount}" size="2" maxlength="2"> Nothing changes. Any suggestions? Thank you, Christine Quote:
__________________
______________ version 4.1.9 Gold Last edited by ChristineP : 12-31-2008 at 08:20 AM. Reason: Added image |
|||||||
#42
|
|||||||
|
|||||||
Re: Change product quantity from drop down to number input field
I've tested this over the holiday and when I change the text box quantity to higher number than 1, it does not change when adding to my shopping cart. Is there something missing for v4.1.9 for the text quantity to work?
Christine
__________________
______________ version 4.1.9 Gold |
|||||||
#43
|
|||||||
|
|||||||
Re: Change product quantity from drop down to number input field
For v4.1.9.... I have this working now for the quantity to multiply when the text number is changed, and I was able to remove the "drop down".
In customer/main/product.tpl to add the text quantity: <tr> <td width="30%">{$lng.lbl_quantity}</td> <td><input type="text" style="text-align:right" name="amount" size="4" maxlength="4" value="{$product.min_amount}"/></td> </tr> <!--<tr><td height="25" width="30%">{$lng.lbl_quantity}{if $product.min_amount gt 1}<br /><font class="ProductDetailsTitle">{$lng.txt_need_min_amo unt|substitute:"items":$product.min_amount}</font></td>--> and comment out this section to remove the drop down: <!--<select id="product_avail" name="amount"{if $active_modules.Product_Options ne '' && $product_options ne ''} onchange="check_wholesale(this.value);"{/if}> {section name=quantity loop=$mq start=$start_quantity} <option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option> {/section} </select>--> Christine
__________________
______________ version 4.1.9 Gold |
|||||||
#44
|
|||||||
|
|||||||
Re: Change product quantity from drop down to number input field
Using X-Cart Gold 4.1.10
I want to remove drop down, instead the customer can put any number. I also want to restrict to add the number to 200000, Can this be pssible?
__________________
X-Cart Gold 4.1.10 |
|||||||
#45
|
|||||||
|
|||||||
Re: Change product quantity from drop down to number input field
You can try the same code as I've posted for your customer/main/product.tpl to remove the drop down and have only a text box for your customer to put any number up to 200000 (see attached image). This code works for v4.1.9.
In customer/main/product.tpl to add the text quantity: <tr> <td width="30%">{$lng.lbl_quantity}</td> <td><input type="text" style="text-align:right" name="amount" size="6" maxlength="6" value="{$product.min_amount}"/></td> </tr> <!--<tr><td height="25" width="30%">{$lng.lbl_quantity}{if $product.min_amount gt 1}<br /><font class="ProductDetailsTitle">{$lng.txt_need_min_amo unt|substitute:"items":$product.min_amount}</font></td>--> and comment out this section to remove the drop down: <!--<select id="product_avail" name="amount"{if $active_modules.Product_Options ne '' && $product_options ne ''} onchange="check_wholesale(this.value);"{/if}> {section name=quantity loop=$mq start=$start_quantity} <option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option> {/section} </select>--> I changed the size values of quantity to allow up to 6 numbers, but you will also need to change the size of the quantity text box in the checkout page where the customer is allowed to 'update' their purchase. I haven't tested any of the checkout templates to guide you in changing the size value for the quantity text box, though the experts here can point you in that direction. Also, you will need to add 200000 to the maximum allowed in your admin>General Settings under Purchase limitations "Maximum allowed total quantity of products in an order (0 means no maximum limit):" Good luck. Quote:
__________________
______________ version 4.1.9 Gold |
|||||||
#46
|
|||||||||
|
|||||||||
Re: Change product quantity from drop down to number input field
I just implemented this in 4.1.11 - it's been up for like 2 minutes, so haven't tested it - other than to note that if you have (in General Options) inventory tracking enabled, it will not allow the customer to add more to their cart than you have in stock.
For me, since many items are ordered direct from the manufacturer upon MY order (similar to drop ship, but not exact) I want them to be able to order as many as they want - thus I had to check "Disable Inventory Tracking"
__________________
Chris Tindall x-cart 4.7.5 Gold Plus www.theweedpatchstore.com AlteredCart: On-Sale, One Page Checkout, Checkout One Payments (although that's not working yet) BCSE: Back in stock Notify, Checkbox Radio Mod, Upselling Links SMACK: CDSEO Pro, Product Map X-Cart: Gold+, Mobile (still trying to get working: Gahela Support Suite) |
|||||||||
|
|||
X-Cart forums © 2001-2020
|