Author Topic: error Paypal with coupon  (Read 9394 times)

MaxMi

  • Beginner
  • *
  • Posts: 13
error Paypal with coupon
« 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

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2047
    • alatak.net
Re: error Paypal with coupon
« Reply #1 on: September 04, 2013, 19:37:30 pm »
Hello
This is actually the fix
replace
Code: [Select]
$amount = $cart_prices['salesPrice'];
by

Code: [Select]
$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

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3456
  • VirtueMart Version: 3.8.9
Re: error Paypal with coupon
« Reply #2 on: September 04, 2013, 20:18:42 pm »
Alatak

Is this fixed in 2.0.22c ?
Regards
A

Joomla 3.9.27
php 7.4

MaxMi

  • Beginner
  • *
  • Posts: 13
Re: error Paypal with coupon
« Reply #3 on: September 05, 2013, 08:01:12 am »
Perfect! It works, I modified paypal.php and standard.php.
Thank you very much!

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2047
    • alatak.net
Re: error Paypal with coupon
« Reply #4 on: September 05, 2013, 10:08:46 am »
Hello
Code: [Select]
Is this fixed in 2.0.22c ?
No , not in that one.
It is fixed for the next one.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3456
  • VirtueMart Version: 3.8.9
Re: error Paypal with coupon
« Reply #5 on: September 05, 2013, 10:29:05 am »
Thanks Alatak
Regards
A

Joomla 3.9.27
php 7.4