-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for #443, catalog pricerules start and end date not respected (co… #444
Conversation
…cted (correct) Fix for OpenMage#443, catalog pricerules start and end date not respected (correct) Please validate my logic. 1. Fromtime and totime are now measured in GMT 2. And compared to GMT time (now) in $timestamp This way (if and) when the CRON runs the rules at that specific time are checked and activated (or disabled) - as this cron job runs per default at 2 AM as I understand. This would mean that all rules enabled and disable are in effect turned ON and OFF at 2AM during the night the rule is activated (1st day) and de-activated after the end date 2 hours after midnight. Reference 1: https://magento.stackexchange.com/questions/61045/catalog-price-rule-from-today-does-not-apply Reference 2: (under catalog rules) http://jokiruiz.com/magento/magento-timezones-timestamps/ Test data: - for a rule with start date 10 dec 2017 and end date 30 jan 2018 - we see the following comparison on Thu 1 feb 2018 @ 14:28 GMT TIMESTAMP: Thu, 01 Feb 2018 14:28:03 GMT START; Sat, 09 Dec 2017 23:00:00 GMT END: Tue, 30 Jan 2018 22:59:59 GMT So rule in this case is turned OFF Please confirm
+1 can someone review our logic? and/or test? Appreciate it ... |
Tested. 100% works. Start date,end date for catalog rules know works properly (tested on GMT+1). It can be due to cacheing or indexing, dont know - but special price end date can sometimes block catalog rule showing correctly on frontend. Maybe magento flush caches with different priority and special price end date trigger it, while catalog rules are not yet active during 00:00 day date changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested but makes sense, rule start/end dates must be adjusted by timezone offset since the cron job applying rules runs at midnight.
However, couldn't the second chunk be simply $timestamp = time();
?
Second chunk does give the same output for both
$timestamp = Mage::app()->getLocale()->date(null, null, null,
true)->get(Zend_Date::TIMESTAMP);
time();
(no rationale other than gut) going through Mage: app sounds better ....
anyways: it works! (finally because this has been a real culprit over the
years)
Powered by Gmelius <https://gmelius.com?ref=mail>
…On Thu, Feb 22, 2018 at 1:16 AM, Colin Mollenhour ***@***.***> wrote:
***@***.**** approved this pull request.
Haven't tested but makes sense, rule start/end dates must be adjusted by
timezone offset since the cron job applying rules runs at midnight.
However, couldn't the second chunk be simply $timestamp = time(); ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#444 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAn0a4fnFUxZ40YRWL8LXjzojzTK08B_ks5tXLHcgaJpZM4R1tWD>
.
|
…art/end date 1. Fromtime and totime are now measured in GMT 2. And compared to GMT time (now) in $timestamp This way (if and) when the CRON runs the rules at that specific time are checked and activated (or disabled) - as this cron job runs per default at 2 AM as I understand. This would mean that all rules enabled and disable are in effect turned ON and OFF at 2AM during the night the rule is activated (1st day) and de-activated after the end date 2 hours after midnight. Reference 1: https://magento.stackexchange.com/questions/61045/catalog-price-rule-from-today-does-not-apply Reference 2: (under catalog rules) http://jokiruiz.com/magento/magento-timezones-timestamps/ Test data: - for a rule with start date 10 dec 2017 and end date 30 jan 2018 - we see the following comparison on Thu 1 feb 2018 @ 14:28 GMT TIMESTAMP: Thu, 01 Feb 2018 14:28:03 GMT START; Sat, 09 Dec 2017 23:00:00 GMT END: Tue, 30 Jan 2018 22:59:59 GMT So rule in this case is turned OFF * @colinmollenhour Use simply 'time()' to get Unix timestamp.
…art/end date 1. Fromtime and totime are now measured in GMT 2. And compared to GMT time (now) in $timestamp This way (if and) when the CRON runs the rules at that specific time are checked and activated (or disabled) - as this cron job runs per default at 2 AM as I understand. This would mean that all rules enabled and disable are in effect turned ON and OFF at 2AM during the night the rule is activated (1st day) and de-activated after the end date 2 hours after midnight. Reference 1: https://magento.stackexchange.com/questions/61045/catalog-price-rule-from-today-does-not-apply Reference 2: (under catalog rules) http://jokiruiz.com/magento/magento-timezones-timestamps/ Test data: - for a rule with start date 10 dec 2017 and end date 30 jan 2018 - we see the following comparison on Thu 1 feb 2018 @ 14:28 GMT TIMESTAMP: Thu, 01 Feb 2018 14:28:03 GMT START; Sat, 09 Dec 2017 23:00:00 GMT END: Tue, 30 Jan 2018 22:59:59 GMT So rule in this case is turned OFF * @colinmollenhour Use simply 'time()' to get Unix timestamp.
…art/end date 1. Fromtime and totime are now measured in GMT 2. And compared to GMT time (now) in $timestamp This way (if and) when the CRON runs the rules at that specific time are checked and activated (or disabled) - as this cron job runs per default at 2 AM as I understand. This would mean that all rules enabled and disable are in effect turned ON and OFF at 2AM during the night the rule is activated (1st day) and de-activated after the end date 2 hours after midnight. Reference 1: https://magento.stackexchange.com/questions/61045/catalog-price-rule-from-today-does-not-apply Reference 2: (under catalog rules) http://jokiruiz.com/magento/magento-timezones-timestamps/ Test data: - for a rule with start date 10 dec 2017 and end date 30 jan 2018 - we see the following comparison on Thu 1 feb 2018 @ 14:28 GMT TIMESTAMP: Thu, 01 Feb 2018 14:28:03 GMT START; Sat, 09 Dec 2017 23:00:00 GMT END: Tue, 30 Jan 2018 22:59:59 GMT So rule in this case is turned OFF * @colinmollenhour Use simply 'time()' to get Unix timestamp.
…art/end date 1. Fromtime and totime are now measured in GMT 2. And compared to GMT time (now) in $timestamp This way (if and) when the CRON runs the rules at that specific time are checked and activated (or disabled) - as this cron job runs per default at 2 AM as I understand. This would mean that all rules enabled and disable are in effect turned ON and OFF at 2AM during the night the rule is activated (1st day) and de-activated after the end date 2 hours after midnight. Reference 1: https://magento.stackexchange.com/questions/61045/catalog-price-rule-from-today-does-not-apply Reference 2: (under catalog rules) http://jokiruiz.com/magento/magento-timezones-timestamps/ Test data: - for a rule with start date 10 dec 2017 and end date 30 jan 2018 - we see the following comparison on Thu 1 feb 2018 @ 14:28 GMT TIMESTAMP: Thu, 01 Feb 2018 14:28:03 GMT START; Sat, 09 Dec 2017 23:00:00 GMT END: Tue, 30 Jan 2018 22:59:59 GMT So rule in this case is turned OFF * @colinmollenhour Use simply 'time()' to get Unix timestamp.
…art/end date 1. Fromtime and totime are now measured in GMT 2. And compared to GMT time (now) in $timestamp This way (if and) when the CRON runs the rules at that specific time are checked and activated (or disabled) - as this cron job runs per default at 2 AM as I understand. This would mean that all rules enabled and disable are in effect turned ON and OFF at 2AM during the night the rule is activated (1st day) and de-activated after the end date 2 hours after midnight. Reference 1: https://magento.stackexchange.com/questions/61045/catalog-price-rule-from-today-does-not-apply Reference 2: (under catalog rules) http://jokiruiz.com/magento/magento-timezones-timestamps/ Test data: - for a rule with start date 10 dec 2017 and end date 30 jan 2018 - we see the following comparison on Thu 1 feb 2018 @ 14:28 GMT TIMESTAMP: Thu, 01 Feb 2018 14:28:03 GMT START; Sat, 09 Dec 2017 23:00:00 GMT END: Tue, 30 Jan 2018 22:59:59 GMT So rule in this case is turned OFF * @colinmollenhour Use simply 'time()' to get Unix timestamp.
…art/end date 1. Fromtime and totime are now measured in GMT 2. And compared to GMT time (now) in $timestamp This way (if and) when the CRON runs the rules at that specific time are checked and activated (or disabled) - as this cron job runs per default at 2 AM as I understand. This would mean that all rules enabled and disable are in effect turned ON and OFF at 2AM during the night the rule is activated (1st day) and de-activated after the end date 2 hours after midnight. Reference 1: https://magento.stackexchange.com/questions/61045/catalog-price-rule-from-today-does-not-apply Reference 2: (under catalog rules) http://jokiruiz.com/magento/magento-timezones-timestamps/ Test data: - for a rule with start date 10 dec 2017 and end date 30 jan 2018 - we see the following comparison on Thu 1 feb 2018 @ 14:28 GMT TIMESTAMP: Thu, 01 Feb 2018 14:28:03 GMT START; Sat, 09 Dec 2017 23:00:00 GMT END: Tue, 30 Jan 2018 22:59:59 GMT So rule in this case is turned OFF * @colinmollenhour Use simply 'time()' to get Unix timestamp.
…art/end date 1. Fromtime and totime are now measured in GMT 2. And compared to GMT time (now) in $timestamp This way (if and) when the CRON runs the rules at that specific time are checked and activated (or disabled) - as this cron job runs per default at 2 AM as I understand. This would mean that all rules enabled and disable are in effect turned ON and OFF at 2AM during the night the rule is activated (1st day) and de-activated after the end date 2 hours after midnight. Reference 1: https://magento.stackexchange.com/questions/61045/catalog-price-rule-from-today-does-not-apply Reference 2: (under catalog rules) http://jokiruiz.com/magento/magento-timezones-timestamps/ Test data: - for a rule with start date 10 dec 2017 and end date 30 jan 2018 - we see the following comparison on Thu 1 feb 2018 @ 14:28 GMT TIMESTAMP: Thu, 01 Feb 2018 14:28:03 GMT START; Sat, 09 Dec 2017 23:00:00 GMT END: Tue, 30 Jan 2018 22:59:59 GMT So rule in this case is turned OFF * @colinmollenhour Use simply 'time()' to get Unix timestamp.
…art/end date 1. Fromtime and totime are now measured in GMT 2. And compared to GMT time (now) in $timestamp This way (if and) when the CRON runs the rules at that specific time are checked and activated (or disabled) - as this cron job runs per default at 2 AM as I understand. This would mean that all rules enabled and disable are in effect turned ON and OFF at 2AM during the night the rule is activated (1st day) and de-activated after the end date 2 hours after midnight. Reference 1: https://magento.stackexchange.com/questions/61045/catalog-price-rule-from-today-does-not-apply Reference 2: (under catalog rules) http://jokiruiz.com/magento/magento-timezones-timestamps/ Test data: - for a rule with start date 10 dec 2017 and end date 30 jan 2018 - we see the following comparison on Thu 1 feb 2018 @ 14:28 GMT TIMESTAMP: Thu, 01 Feb 2018 14:28:03 GMT START; Sat, 09 Dec 2017 23:00:00 GMT END: Tue, 30 Jan 2018 22:59:59 GMT So rule in this case is turned OFF * @colinmollenhour Use simply 'time()' to get Unix timestamp.
…rrect)
Fix for #443, catalog pricerules start and end date not respected (correct)
Please validate my logic.
This way (if and) when the CRON runs the rules at that specific time are checked and activated (or disabled) - as this cron job runs per default at 2 AM as I understand. This would mean that all rules enabled and disable are in effect turned ON and OFF at 2AM during the night the rule is activated (1st day) and de-activated after the end date 2 hours after midnight.
Reference 1: https://magento.stackexchange.com/questions/61045/catalog-price-rule-from-today-does-not-apply
Reference 2: (under catalog rules) http://jokiruiz.com/magento/magento-timezones-timestamps/
Test data:
TIMESTAMP: Thu, 01 Feb 2018 14:28:03 GMT
START; Sat, 09 Dec 2017 23:00:00 GMT
END: Tue, 30 Jan 2018 22:59:59 GMT
So rule in this case is turned OFF
Please confirm