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)

Tuner 01-09-2006 07:51 PM

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

Dawn Howard 06-08-2006 12:57 PM

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?

banzai 07-12-2006 10:04 AM

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

ecommerce 08-24-2006 04:03 AM

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.

:)

frankdux 09-20-2006 07:02 AM

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?

frankdux 09-20-2006 08:15 AM

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.

stuartn 12-14-2007 01:41 PM

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

designtheweb 04-02-2008 02:35 PM

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?

wendy.email 06-10-2008 01:15 PM

Re: Change product quantity from drop down to number input field
 
anyone? please

stuartn 06-10-2008 02:08 PM

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>


All times are GMT -8. The time now is 01:47 AM.

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