Author Topic: Quantity box buttons doesn't work?  (Read 5232 times)

rastas

  • Beginner
  • *
  • Posts: 10
Quantity box buttons doesn't work?
« on: August 24, 2011, 13:03:55 pm »
Hi there is link of my web :http://www.comjaunuoliai.lt/divemen/e-parduotuv.html?page=shop.product_details&flypage=flypage.tpl&product_id=2&category_id=1
and when i try to rise number in Quantity box with buttons, they just don't work.

Any ideas?


Thanks.

MobiVM

  • Jr. Member
  • **
  • Posts: 267
    • Native Mobile Apps for VritueMart
Re: Quantity box buttons doesn't work?
« Reply #1 on: August 24, 2011, 14:17:13 pm »
Hello,

You need to edit in below file.

components\com_virtuemart\themes\default\templates\product_details\includes\quantity_box_general.tpl.php

find below code:-

<input type="button" class="quantity_box_button quantity_box_button_up" onclick="var qty_el = this.parentNode.elements[\'quantity[]\']; var qty = qty_el.value; if( !isNaN( qty )) qty_el.value++;return false;" />
      <input type="button" class="quantity_box_button quantity_box_button_down" onclick="var qty_el = this.parentNode.elements[\'quantity[]\']; var qty = qty_el.value; if( !isNaN( qty ) && qty > 0 ) qty_el.value--;return false;" />

And replace with this:-

<input type="button" class="quantity_box_button quantity_box_button_up" onclick="var qty_el = document.getElementById(\'quantity'.$prod_id.'\'); var qty = qty_el.value; if( !isNaN( qty )) qty_el.value++;return false;" />
      <input type="button" class="quantity_box_button quantity_box_button_down" onclick="var qty_el = document.getElementById(\'quantity'.$prod_id.'\'); var qty = qty_el.value; if( !isNaN( qty ) &amp;&amp; qty > 0 ) qty_el.value--;return false;" />

this will solve your issue!

Best regards,
Trivedi kartik.
Native mobile Apps for VirtueMart! Visit http://www.ivmstore.com

rastas

  • Beginner
  • *
  • Posts: 10
Re: Quantity box buttons doesn't work?
« Reply #2 on: August 24, 2011, 16:39:15 pm »
Thank's a lot it works fine:)

vmbuilder

  • Beginner
  • *
  • Posts: 21
Re: Quantity box buttons doesn't work?
« Reply #3 on: August 26, 2011, 00:18:03 am »
Thanks Trivedi - worked for me too. Unfortunately don't understand why! Oh well: Jack of all trades, Master of just a few... ;)

After way too much time, still couldn't figure why the up/down arrows were working fine on the browse_listtable but not on the product flypage. Anyway, thanks again.

Joomla 1.5.23, VM 1.1.19 BTW

Joomla 1.5.23 VM 1.1.19

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28263
  • Always on vacation
    • Jenkin Hill Internet
Re: Quantity box buttons doesn't work?
« Reply #4 on: August 26, 2011, 20:39:38 pm »
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 3.8.9.10473 on Joomla 3.9.28 PHP 7.4.14

Bravestar

  • Beginner
  • *
  • Posts: 17
Re: Quantity box buttons doesn't work?
« Reply #5 on: January 13, 2012, 09:15:53 am »
that was very helpfull..

thanks