News:

Support the VirtueMart project and become a member

Main Menu

Coupon bug with Paypal Pro and Authorize.net

Started by seyi, December 15, 2013, 17:25:25 PM

Previous topic - Next topic

seyi

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

<?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

Hello Seyi,

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

seyi

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

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

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

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

#21
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

Hello Manu

Quotecase 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

QuoteThe 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

#23
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