Jump to content

Change quantity on product page


eporedieis

Recommended Posts

Hi, I'm always here in these days!

I want to do a little implementation in my product page but...I need an help.

 

In my site there'll be products that are sold in box, but the price is per square meter.

So, when a customer is on the product page (product.tpl) I want that his wishes quantity is updated at the next box, so I've created these four lines:

 

{assign var="input" value=$display_qties}
{assign var="var1" value=$feature.value|escape:'htmlall':'UTF-8'}
{assign var="total" value=ceil($input/$var1)*$var1}

# where var1 is the box quantity -> this is ok with other 5 rows of code

 

But...how can I use them? If I insert them on the page, the input is "1". And I don't want to insert a js (that can be a problem on mobile template).

 

I think I can use OnKeyUp on the submit button to set the "input" variable and the OnSubmit on the text input to update his value (that will be $total).

 

Is this correct for you? Thanks!!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...