VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: chaldama on August 06, 2014, 01:13:59 AM

Title: [solved] 2 errors after updating to VM 2.6.6
Post by: chaldama on August 06, 2014, 01:13:59 AM
Updating to VM 2.6.6, which I have done before on many other webshops without problems, caused a big problem on one of my sites.

The cart/checkout is not working anymore, instead I get 2 errors:
vmError: Cart variant was not found and no fallback found
Error the quantity of the product for calculation is 0, please notify the shopowner, the product id 0

I have now set the shop offline, if anyone wants to help me out I can give you inlog information.
Title: Re: 2 errors after updating to VM 2.6.6
Post by: chaldama on August 11, 2014, 00:22:52 AM
Ok, since it was a live website I had no other choice then to restore a backup using an older version of VM 2.

Unfortunately, I now experience the problem again with another website. I have made a  copy of this website (http://www.petiteevi.com/) and placed it here to work on it. After updating Joomla, extensions (JCE Editor, XMap, etc) and Virtuemart, exactly the same error comes up when you place something in the cart "Error the quantity of the product for calculation is 0, please notify the shopowner, the product id 0".
The new version of the website where the error shows up can be seen here (http://marloesdeheer.nl/evi/interieur/decoratie).

This is really driving me mad, any help is greatly appreciated!
Title: Re: 2 errors after updating to VM 2.6.6
Post by: GJC Web Design on August 11, 2014, 00:31:42 AM
the error is raised in the calculationh.php (prices script) ~ line 655
it is

if (empty($product->quantity) || empty($product->virtuemart_product_id)) {
            JError::raiseWarning(710, 'Error the quantity of the product for calculation is 0, please notify the shopowner, the product id ' . $product->virtuemart_product_id);
            continue;
         }

basically it's saying either the product quantity in the cart is 0 or the product id is missing

it says prod id is 0  - have you a product with an id of 0?

cart variant error is a missing variant


check your products

Title: Re: 2 errors after updating to VM 2.6.6
Post by: chaldama on August 11, 2014, 11:43:48 AM
Thank you for looking into it.

In the shop which I now discarded and placed back a back-up with an older VM version I noticed that not all products had a SKU. I had hoped that this would be the solution but after adding SKU's to all products the error remained. This shop has 132 products, I will discuss with the owner if she wants to add SKU's manually.
Title: Re: 2 errors after updating to VM 2.6.6
Post by: GJC Web Design on August 11, 2014, 12:27:45 PM
Hmm - sku are not enforced in VM2 -
the errors are something to do with product ids
have a look thru your product tables and see if one has a id of 0 or something strange
Title: Re: 2 errors after updating to VM 2.6.6
Post by: chaldama on August 11, 2014, 12:48:49 PM
Just checked in PhPMyAdmin. The product IDs variy from 169 till 308 but I see nothing strange in the table. There is no product with an ID 0
Title: Re: 2 errors after updating to VM 2.6.6
Post by: GJC Web Design on August 11, 2014, 13:10:41 PM
was just an idea - but you see where the error is thrown - so it will need some debugging on your side -

unpublish blocks of products etc till u find it .. there is no simple solution..
Title: Re: 2 errors after updating to VM 2.6.6
Post by: chaldama on August 11, 2014, 13:28:58 PM
Really appreciate your help!

Even after unpublishing all products and adding a new test product (http://marloesdeheer.nl/evi/baby/test-detail) the error is still there.
In my opinion something has changed in the VM update which causes the conflict, since prior to updating there was no problem.
Title: Re: 2 errors after updating to VM 2.6.6
Post by: GJC Web Design on August 11, 2014, 13:50:23 PM
but the problem is 2.6.6 has been out for a while now - all my sites are on it - and afaik  - this error has never been reported

what happens on your duff site if you just comment out the error ? does the checkout work or is it blocked?
Title: Re: 2 errors after updating to VM 2.6.6
Post by: chaldama on August 11, 2014, 13:54:13 PM
Yes, you're right. I have many other webshops which run om 2.6.6 without the problem.

How do I comment out the error?
Title: Re: 2 errors after updating to VM 2.6.6
Post by: GJC Web Design on August 11, 2014, 14:47:21 PM
this isn't a fix - it is to experiment -
you need to do some digging by echoing out stuff etc to see what is wrong

the error is raised in the calculationh.php (prices script) ~ line 655
comment out

/*
if (empty($product->quantity) || empty($product->virtuemart_product_id)) {
            JError::raiseWarning(710, 'Error the quantity of the product for calculation is 0, please notify the shopowner, the product id ' . $product->virtuemart_product_id);
            continue;
         }
*/
Title: Re: 2 errors after updating to VM 2.6.6
Post by: chaldama on August 11, 2014, 16:39:18 PM
Ok, just tried that. The error does not show, but the cart isn't filled.
Title: Re: 2 errors after updating to VM 2.6.6
Post by: GJC Web Design on August 11, 2014, 16:41:38 PM
Sorry - it is impossible to debug your install by remote - you've proven that it is only one install that is the problem - that is your starting point...
Title: Re: 2 errors after updating to VM 2.6.6
Post by: chaldama on August 11, 2014, 16:45:15 PM
I am really happy with your support.
If you would like to have backend access and/or FTP I would be more than happy to give you access.

This is the second site where I encounter the problem. The first site was a live website so I just restored a backup where the old version of VM was still in use.
Title: Re: 2 errors after updating to VM 2.6.6
Post by: GJC Web Design on August 11, 2014, 17:37:14 PM
I will need paying of course for 1 to 1 support - email me if that is what you meant....
Title: Re: 2 errors after updating to VM 2.6.6
Post by: chaldama on August 12, 2014, 21:10:43 PM
You've got mail!
Title: Re: 2 errors after updating to VM 2.6.6
Post by: capewellmj on September 16, 2014, 23:16:19 PM
I'm getting this error too on VM 2.6.10 after a test update. I reinstalled old VM and it did not fix it. It happened right after I did a second test order.

"Error the quantity of the product for calculation is 0, please notify the shopowner, the product id 0"

How did you fix this, it happens on every page.

Thank you,

Martin
Title: Re: 2 errors after updating to VM 2.6.6
Post by: GJC Web Design on September 16, 2014, 23:56:07 PM
From memory I fixed the above in the add to cart template .. it was an old template and the product id wasn't being passed
Title: Re: 2 errors after updating to VM 2.6.6
Post by: capewellmj on September 17, 2014, 00:07:29 AM
Where is that. It seems to me something got corrupted because my live site is working fine fortunately. I have installed and uninstalled the latest virtuemart a number of times due to the new behaviour which deletes pending orders. It was right after a test order that deleted a pending order that this issue started.

Martin
Title: Re: 2 errors after updating to VM 2.6.6
Post by: capewellmj on September 17, 2014, 01:15:36 AM
That helped. I reinstalled an older version of my yagendoo virtuemart theme and it fixed it.

Thanks,

Martin
Title: Re: 2 errors after updating to VM 2.6.6
Post by: chaldama on September 17, 2014, 09:02:26 AM
Yagendoo has issued updates of all themes/templates in which the problem is fixed. So it would be best to update both Virtuemart and the the theme.

Title: Re: 2 errors after updating to VM 2.6.6
Post by: GJC Web Design on September 17, 2014, 11:27:35 AM
Indeed - all comes flooding back - it was a yagendoo template from chaldama that had the problem
Title: Re: 2 errors after updating to VM 2.6.6
Post by: capewellmj on September 17, 2014, 15:28:27 PM
Thanks guys. It was the latest yagendoo theme with the latest virtuemart that was the problem. I let Yagendoo know and they indeed sent me an updated add-to-cart file. Its interesting to note that it was the new behaviour that deletes pending orders that triggered the issue. It was working fine before that.

Thanks again for the help figuring that out.

Martin