Author Topic: Update Quantity arrow button not working in 1.1.9 for me.  (Read 16793 times)

myopicseer

  • Beginner
  • *
  • Posts: 25
Update Quantity arrow button not working in 1.1.9 for me.
« on: June 30, 2011, 00:09:23 am »
Nothing happens.  Dead buttons.  Anyone else experience this?

Bruce Morgan

  • Full Member
  • ***
  • Posts: 672
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #1 on: June 30, 2011, 01:50:43 am »
I checked after reading your post and noticed I have the same problem.  This VM more than any other has created more problems than it solved.  Maybe that is why this release was not even advertised on the forum or in the news section.  Come on guys!  Anyone have a fix?

Bruce
www.pepper-passion.com

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27598
  • Always on vacation
    • Jenkin Hill Internet
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #2 on: June 30, 2011, 18:33:15 pm »
I believe it was a security fix. To undo you can either use the file components/com_virtuemart/themes/default/templates/product_details/includes/quantity_box_general.tpl.php from version 1.1.8 or make the following edit to that file:

Locate:
Code: [Select]
<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;" />

Replace with:
Code: [Select]
<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;" />
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 VM 3.6.10.10211 on Joomla 3.9.13 PHP 7.0.33

Bruce Morgan

  • Full Member
  • ***
  • Posts: 672
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #3 on: June 30, 2011, 19:54:06 pm »
Thank you very much.  That solved the problem.

Bruce

rjcroasdale

  • Jr. Member
  • **
  • Posts: 75
    • Marketing Consultants
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #4 on: July 10, 2011, 08:56:44 am »
thank you from me 2, solved

Vorwaerts

  • Beginner
  • *
  • Posts: 22
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #5 on: July 18, 2011, 11:52:50 am »
Hi,
I had the same issue with the quantity arrows, but copying the old 1.1.8 version of the file solved this problem (as seen on the image attachment). But I also seem to have this problem with the Add to cart button which is completely inactive too (at least in Firefox 4 but strangely enough it works in Internet Explorer 9).

I've also seen this behavior back in 1.1.7 and 1.1.8 and only in Firefox and Chrome, clearing the cache files and starting a completely new Firefox session usually does the trick.

Have anyone experienced this ass well?

Update:

I found that disabling the AJAX functionality in VM made the Add to cart button work again.

With some particular Virtuemart configuration, the "Add to Cart" button in the "product detail" layout might not work.
In this case you must disable the use of Ajax to add products to cart, through the Virtuemart configuration.

Virtuemart >> Configuration >> Site (tab) >> Configuration (Layout section) >> Use Ajax to add, update or delete products from the cart? >> NO


[attachment cleanup by admin]
J! 1.5.25 | VM 1.1.9 | MySQL 5.0.51a | 5.2.4-2ubuntu5.17

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27598
  • Always on vacation
    • Jenkin Hill Internet
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 VM 3.6.10.10211 on Joomla 3.9.13 PHP 7.0.33

wijngeest

  • Beginner
  • *
  • Posts: 1
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #7 on: August 27, 2011, 23:29:31 pm »
I believe it was a security fix. To undo you can either use the file components/com_virtuemart/themes/default/templates/product_details/includes/quantity_box_general.tpl.php from version 1.1.8 or make the following edit to that file:

Locate:
Code: [Select]
<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;" />

Replace with:
Code: [Select]
<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;" />

With VM 1.1.9 this results in another problem. When using document.getElementByiD the arrows on the flypage with extra ID's selected can be used. But when using this.ParentNode the arrows for Extra ID's can't be used. The value of the quantity box will not change. When only one product is visible (no Extra ID's selected) with this.ParentNode the arrows function correctly. When document.getElementByiD is used the quantity box on the page with one product (no Extra ID's selected) the quantity box adds 2 with the arrow instead of 1. Why?

You have to use one of both options and with one option the other isn't usable. I use both one product and product with Extra ID's selected. This is really frustrating.

If someone has a soluton. I'm all ears.

iwebfolio

  • Beginner
  • *
  • Posts: 11
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #8 on: August 29, 2011, 18:14:10 pm »
hi guys, had the same problem and changed the coding but now the qty value is missing?

http://pumavideo.iwebfolio.co.za/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=101&category_id=12&option=com_virtuemart&Itemid=1


heres the original, please let me know where i went wrong...

<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__);
/** This template is used for the quantity box arrangement of products, within the add-to-cart form */

extract( $quantity_options );

$html = '';
if(!$child && $display_type != 'hide') {
 $html = '<label for="quantity'.$prod_id.'" class="quantity_box">'.$VM_LANG->_('PHPSHOP_CART_QUANTITY').':&nbsp;</label>';
}
switch($display_type) {
 case "radio" : //Radio Box
  $html .= '<input type="hidden" id="quantity'.$prod_id.'" name="quantity[]" value="'.$quantity.'" />';
  $html .= '<input type="radio" class="quantitycheckbox" id="selItem'.$prod_id.'" name="selItem" value="0" ';
  if ($quantity > 0 ) {
   $html .= 'checked="checked" ';
  }
  $html .= 'onclick="alterQuantity(this.form)" />';
  break;
 case "hide" : // Hide box - but set quantity to 1!
  $html .= '<input type="hidden" id="quantity'.$prod_id.'" name="quantity[]" value="1" />';
  break;
 case "check" :
  $html .= '<input type="hidden" id="quantity'.$prod_id.'" name="quantity[]" value="'.$quantity.'" style="vertical-align: middle;"/>
  <input type="checkbox" class="quantitycheckbox" id ="selItem'.$id.'" name="check[]" ';
  if ($quantity > 0 ) {
   $html .= 'checked="checked"';
  }
  $html .= ' value="1" onclick="javascript: if(this.checked==true) document.getElementById(\'quantity'.$prod_id.'\').value = 1; else {document.getElementById(\'quantity'.$prod_id.'\').value=0;} "/> ';
  break;
 case "drop" :
  $code = '<select class="inputboxquantity" id="quantity'.$prod_id.'" name="quantity[]">';
  for($i=$quantity_start;$i<$quantity_end+1;$i += $quantity_step) {
   $code .= '  <option value="'.$i.'"';
   if ($i == $quantity) {
    $code .= ' selected="selected"';
   }
   $code .= '>'.$i."</option>\n";
  }
  $code .= "</select>\n";
  $html .= $code;
  break;
 case "none" :
 default:
  $html .= '<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 > 1 ) qty_el.value--;return false;" />
  ';
  break;
}
echo $html;
?>

scept1c

  • Guest
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #9 on: September 02, 2011, 12:08:37 pm »
thanks dude)

meyloo

  • Beginner
  • *
  • Posts: 2
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #10 on: September 03, 2011, 00:25:09 am »
i confirm i have the same problem even with the solution provided, still cant use quantity arrows on the flypage and its getting even worse i cant set any quantity the field isnt showing up anymore, anyone got this fixed?

-------------------------

Well a few minutes later i tried once again and i get finally the thing working! i must have made mistake copying the code into my quantity_box_general.tpl.php, thanks a lot!

martin-nord

  • Beginner
  • *
  • Posts: 26
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #11 on: September 30, 2011, 20:18:45 pm »
Thank you, jenkinhill!!!! 100x thumbs up! :)  :D

djvj3000

  • Beginner
  • *
  • Posts: 3
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #12 on: November 13, 2011, 09:35:13 am »
thanks mate

pctech

  • Beginner
  • *
  • Posts: 21
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #13 on: November 16, 2011, 21:41:28 pm »
I believe it was a security fix. To undo you can either use the file components/com_virtuemart/themes/default/templates/product_details/includes/quantity_box_general.tpl.php from version 1.1.8 or make the following edit to that file:

Locate:
Code: [Select]
<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;" />

Replace with:
Code: [Select]
<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;" />


I do just Love You for your answere <3 :D  Many Thank's also from meto YOU. Best Regards. Marcel

strongroots

  • Beginner
  • *
  • Posts: 4
Re: Update Quantity arrow button not working in 1.1.9 for me.
« Reply #14 on: November 28, 2011, 22:55:24 pm »
Thanks for the fix, jenkinhill! Everything works seamlessly now. :)