VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: SamF on December 21, 2012, 18:25:21 PM

Title: VM2.0.16 - warning when purchasing zero-priced product
Post by: SamF on December 21, 2012, 18:25:21 PM
Hello,

J2.5.8 + VM2.0.16

After confirming purchase with cart total = 0 (all products with zero price), the following warning appears at "Thank you..." page:

Warning:  Invalid argument supplied for foreach() in .../administrator/components/com_virtuemart/models/orders.php
on line 935

Regards,
Title: Re: VM2.0.16 - warning when purchasing zero-priced product
Post by: Milbo on December 21, 2012, 18:44:26 PM
Unbelievable guys, what for ideas you have.
added line 934

if(!isset($_cart->pricesUnformatted[$key][$calculation_kind])) continue;


added in vm2.1
Title: Re: VM2.0.16 - warning when purchasing zero-priced product
Post by: SamF on December 22, 2012, 07:16:51 AM
Quote from: Milbo on December 21, 2012, 18:44:26 PM
Unbelievable guys, what for ideas you have.
added line 934

if(!isset($_cart->pricesUnformatted[$key][$calculation_kind])) continue;

added in vm2.1

Thank you, can't wait for 2.1.

The idea is easy: giving something for free (let's say, free downloads) to VM shoppers, without setting separate "download" extensions. Nothing, but Virtuemart!))
Title: Re: VM2.0.16 - warning when purchasing zero-priced product
Post by: delliott on April 26, 2013, 19:03:06 PM
I can see this fix is in virtuemart 2.0.20b but trying to checkout with a zero-priced total still does not work.  What I am seeing on Joomla 2.5.10 and VM 2.0.20b is that no emails are sent and the cart is NOT emptying out.  Basically the confirmation of the order is not getting set.  I need a fix for this asap.  Please reply.

Also just noted that you cannot delete the order from the backend even after you have manually confirmed it.  Something is seriously wrong in this section of code.

One more issue, manual confirmation also causes a problem with email subject lines.  "COM_VIRTUEMART_MAIL_SUBJ_VENDOR_" is what shows in emails sent about products that are zero-priced.  I've tested sales of products with prices and everything works ok there.