Author Topic: Coupon bug with Paypal Pro and Authorize.net  (Read 10415 times)

seyi

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 401
    • AwoDev
Re: Coupon bug with Paypal Pro and Authorize.net
« Reply #15 on: January 14, 2014, 23:21:57 pm »
Hi Valerie,

I mentioned this on skype but it is still not addressed in the latest version.  The modifications you put in work for the most part but there is still a small problem.

In models/order.php, function _createorder, you comment out the old code and add the new coupon in session function:
   //CouponHelper::RemoveCoupon($_cart->couponCode);
  CouponHelper::setInUseCoupon($_cart->couponCode, true);

The problem is there is no trigger within function setInUseCoupon, so no way for 3rd party coupon module to run any processes on order create

I think you should add something like this at the top of function setInUseCoupon
Code: [Select]
<?php
JPluginHelper::importPlugin('vmcoupon');
$dispatcher JDispatcher::getInstance();
$returnValues $dispatcher->trigger('plgVmCouponInUse', array($code));
if(!empty($returnValues)){
foreach ($returnValues as $returnValue) {
if ($returnValue !== null  ) {
return $returnValue;
}
}
}
?>

Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2047
    • alatak.net
Re: Coupon bug with Paypal Pro and Authorize.net
« Reply #16 on: January 17, 2014, 14:04:38 pm »
Hello Seyi,

I have added your code to the top of the function setInUseCoupon()

seyi

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 401
    • AwoDev
Re: Coupon bug with Paypal Pro and Authorize.net
« Reply #17 on: January 21, 2014, 18:26:56 pm »
Thank you so very much.
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

seyi

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 401
    • AwoDev
Re: Coupon bug with Paypal Pro and Authorize.net
« Reply #18 on: February 10, 2014, 14:43:43 pm »
Hi Valerie,

I just looked in the latest version, 2.0.27, and I dont see the changes there.
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2047
    • alatak.net
Re: Coupon bug with Paypal Pro and Authorize.net
« Reply #19 on: February 11, 2014, 10:53:34 am »
Hello Seyi,
Yes you are right. I have done only in one of our version (the one called trunk)
and the code was not in 2.0.27.
I have added it now :)

seyi

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 401
    • AwoDev
Re: Coupon bug with Paypal Pro and Authorize.net
« Reply #20 on: February 11, 2014, 17:14:36 pm »
Ah great, thanks once again.
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Coupon bug with Paypal Pro and Authorize.net
« Reply #21 on: March 24, 2014, 22:01:17 pm »
seyi & alatak in 2.5.4 coupons only reapear when an order is "cancelled" so "pending" orders keep loosing coupons.

The logic that with "cancelled" status the coupon is avi again is good sadly many orders remain pending and those customers loose their coupon code.

Regards

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2047
    • alatak.net
Re: Coupon bug with Paypal Pro and Authorize.net
« Reply #22 on: April 01, 2014, 11:56:33 am »
Hello Manu

Quote
case 3:
create order=> coupon in use
client does not pay
order is pending the coupon stays in use
NOT OK

and this case 3 i do not really know how to solve it

Quote
The logic that with "cancelled" status the coupon is avi again is good sadly many orders remain pending and those customers loose their coupon code.

We knew that the solution was not perfect.
But in that case, you can set the order manually to "cancelled" and the coupon should be released.

lindapowers

  • Full Member
  • ***
  • Posts: 1335
  • If you're going through hell, keep going.
    • Venta de naranjas online y mandarinas
  • Skype Name: manu.gonzalez91
  • VirtueMart Version: Latest avi
Re: Coupon bug with Paypal Pro and Authorize.net
« Reply #23 on: December 23, 2016, 04:46:32 am »
Hi

Several issues regarding VM coupons and 3rd party extensions.

1 - I wonder why when a gift coupon is created with a 3rd party software it doesnt appear listed in VM backend/coupons
I noticed this in a previous component we used and recently in Seyi's AwoRewards too, the coupons are default vm gift coupons, they should appear no?

The gift coupons are created correctly and they work but VM doesn't show them in the backend. Only if you manually create a coupon from that same VM page you will see it listed.

2 -We had a custom created order status where payed orders were marked as "accepted". This was set in all payments too as a replacement for "confirmed".
In VM/Shopfront "Order Status to Delete a Gift Coupon" was set to accepted.
The result was that coupons were not being deleted and could be used again and again.

After changing from our custom "accepted" to the default "confirmed" VM coupons get deleted correctly once used.

This is working fine for us now but is just to let you know.

using vm 3.0.18.6 and j 3.6.5