Zen Cart Frequency Discounts Updated for Edit Orders Interoperability

I have provided Edit Orders Integration patches for most of my Zen Cart mods, but for some reason, I just never did Frequency Discounts.  It could be that I just thought it was working properly.

But the good folks at nailessentialz pointed out a problem: if you edit an order placed before today, the lookback period should begin and the point of the order, not at the current date. (This would be relevant for stores that set a lookback period units value of “Days”, “Weeks” or “Months”, rather than “All.”)

For example, if the current day is September 12, and the Lookback Period Units is “Days” and the Period Count is “10”, for an order placed on Aug 27 20:43:50, the lookback window is from Aug 17 20:43:50 to Aug 27 20:43:50.  The old code would have computed the lookback window as September 2 – September 12.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.