News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Undefined Quantity in add-to-cart box VM 2.0.20b

Started by gcarne, March 25, 2014, 13:03:33 PM

Previous topic - Next topic

gcarne

Joomla 2.5.19
VM 2.0.20b
Php 5.5.9

This is a follow-up to a previous thread from April 2013 with a similar title and marked as solved. I hope someone is kind enough to help a beginner:

I followed the instructions in the previous thread by inserting below code in stockable.php which resolved the actual problem with the quantity field, but it also created a syntax error. The syntax error is in below line:

var quantity = $.parseJSON(\'' .json_encode((int)$this->product->min_order_level). '\') ;

Joomla frontend reports "Undefined property" and "Trying to get property of non-object". 


} else {
// var quantity = $(".addtocart-bar .quantity-input").val();
// Changed Gunnar

Joomla 2.5.19   VM 2.0.20b  PHP 5.5.9
var quantity = $.parseJSON(\'' .json_encode((int)$this->product->min_order_level). '\') ;
                      if (quantity == 0){
                          quantity = 1;
                                  }
// End changed
$(".addtocart-bar>span").remove();


Thanks,
Gunnar

PS: The previous thread is "[ SOLVED ] undefined quantity in field next to [add to Cart] button (VM 2.0.20b)"