VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: lydianp18 on November 23, 2015, 03:04:09 AM

Title: Coupon Expiration Date NOT Working.
Post by: lydianp18 on November 23, 2015, 03:04:09 AM
VM 2.0.26d | J  2.5.18 (before you even ask - NO, we can't upgrade the site.  Too many core mods - and they weren't our idea...)

Coupons are still usable after their expiration dates... even if we "unpublish" them (click the checkbox and hit "unpublish" at the top).

Any idea as to why?
Title: Re: Coupon Expiration Date NOT Working.
Post by: GJC Web Design on November 23, 2015, 10:26:39 AM
well.. could be a bug that has been fixed in the 100 or so versions since 2.0.26d

when u get hacked will you update then?   ;)
Title: Re: Coupon Expiration Date NOT Working.
Post by: lydianp18 on November 27, 2015, 22:06:18 PM
Thank you for being absolutely NO help.  It's not my choice not to upgrade - it's the clients.
Title: Re: Coupon Expiration Date NOT Working.
Post by: jenkinhill on November 28, 2015, 00:10:22 AM
FFS nobody here would run such an old and insecure version to check, but since coupon expiry works with current versions somewhere down the line if it was a bug then it has been fixed.
Now you maybe see why we do not support core hacks.

You had this same problem a year ago so I guess it is not important. In any case z-analysts provided a workaround.    http://forum.virtuemart.net/index.php?topic=122378.msg435642#msg435642
Title: Re: Coupon Expiration Date NOT Working.
Post by: lydianp18 on November 28, 2015, 01:01:21 AM
That was a different client, we'd forgotten about it.  We ended up completely redoing their cart in a different system.  VM is never our first choice for a shopping cart system.

And let me stress, YET AGAIN, this was NOT our idea!  We're simply trying to find a solution for the client for an existing site they refuse to upgrade.
Title: Re: Coupon Expiration Date NOT Working.
Post by: GJC Web Design on November 28, 2015, 02:10:23 AM
And I assume they are happy with their Windows 98, their php 4.0 and Android 2 on their phone.....

Tyres are bald and brakes shot but what the hell, will do for another year....

(must get that gas leak fixed one day)

You realise of course when they are hacked it will be u they blame?
Title: Re: Coupon Expiration Date NOT Working.
Post by: trilogic.cz on July 08, 2019, 16:31:38 PM
here is the fix:
components/com_virtuemart/helpers/coupon.php
line 51
change
IFNULL( 0, IF( NOW() > `coupon_expiry_date`, 1, 0 )) AS ended
to
IFNULL( IF( NOW() > `coupon_expiry_date`, 1, 0 ), 0) AS ended
Title: Re: Coupon Expiration Date NOT Working.
Post by: jenkinhill on July 08, 2019, 17:28:41 PM
@trilogic I have no idea what version your "fix" applies to, but this thread is 4 years old and the code you mention is considerably different in current versions.