VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: MaxMi on September 04, 2013, 14:43:37 PM

Title: error Paypal with coupon
Post by: MaxMi on September 04, 2013, 14:43:37 PM
Hello,
I open again the problem here and I hope it is the right room. I have VM 2.0.22b and Joomla 2.5.13.

I have a problem in payment when coupon change to zero the price in the cart. The selection of the method of payment, in fact, takes place on price without considering the coupon.

I set 2 methods of payment:
1) Paypal, with a minimum amount of € 1
2) ZERO (standard), with a maximum amount of € 1

In this way Virtuemart use PayPal only if the order exceeds € 1 and ZERO only when the order is less than 1 €, but chooses based on the amount before applying the coupon.

When the order is more than 1 € and I put a coupon code even if the total becomes 0 (zero) there is only Paypal, but the payment does not continue because virtuemart sends an informational message indicating that "This amount is not valid for payment with Paypal.".

It seems to me that virtuemart decide on the method of payment without considering the coupon. I tried to edit the plugin standard.php (payment standard) as follows:
from
$ amount = $ cart_prices ['salesPrice'];
to
$ amount = $ cart_prices ['billTotal'];

It seems to work, check the total price. I do not find, however, how to change paypal.php (and then I would not make errors).

Same developers know how to do? I think it's everyone's problem and then I would be sure that the change is correct.

Thank You

Max
Title: Re: error Paypal with coupon
Post by: alatak on September 04, 2013, 19:37:30 PM
Hello
This is actually the fix
replace
$amount = $cart_prices['salesPrice'];

by

$amount=$cart_prices['salesPrice'] + $cart_prices['salesPriceShipment'] + $cart_prices['salesPriceCoupon'] ;


The problem is that $ cart_prices ['billTotal']; is not correct when displaying the list of shipement methods
Title: Re: error Paypal with coupon
Post by: AH on September 04, 2013, 20:18:42 PM
Alatak

Is this fixed in 2.0.22c ?
Title: Re: error Paypal with coupon
Post by: MaxMi on September 05, 2013, 08:01:12 AM
Perfect! It works, I modified paypal.php and standard.php.
Thank you very much!
Title: Re: error Paypal with coupon
Post by: alatak on September 05, 2013, 10:08:46 AM
Hello
Is this fixed in 2.0.22c ?

No , not in that one.
It is fixed for the next one.
Title: Re: error Paypal with coupon
Post by: AH on September 05, 2013, 10:29:05 AM
Thanks Alatak