-
-
Notifications
You must be signed in to change notification settings - Fork 446
Added check for coupon expiration date #3029
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* PHP-CS-Fixer fixes Signed-off-by: Sven Reichel <github-sr@hotmail.com> * Updated workflow Signed-off-by: Sven Reichel <github-sr@hotmail.com> * Added php-cs-fixer workflow Signed-off-by: Sven Reichel <github-sr@hotmail.com> * Added PHPCompatibility check * PHPCompatibility check can fail * Fixes: Node.js 12 actions are deprecated * Fixes: PSR12.ControlStructures.ControlStructureSpacing.LineIndent * Fixes: PSR12.ControlStructures.ControlStructureSpacing.CloseParenthesisLine * Dond check CM_Redis every time * Add .php-cs-fixer.cache to .gitignore * Fixes class name (wrong place ... i know) * Minor fixes * Combined workflows * Added app/Mage.php and files from root to rulesets * Remove unused phpstan_experimental_level.neon * Updated phpstan.neon (for upcoming commits) * Set PhpStan level to 5 (from 3) * Update phpstan to v1.9.2 * Updated phpstan-baseline.neon * Updated phpstan-baseline.neon * Update app/code/core/Mage/Tag/Model/Resource/Tag.php Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com> * Update lib/Varien/Db/Adapter/Pdo/Mysql.php Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com> * Set workflow include paths (skip other files) * Updated labeler.yml * Removed travis label * Improved workflow (#26) * Fixed grep modifier to get correct count * Updated ECG sniff baseline * Added Mage_Centinal to PhpStan checks * Added Mage_PaypalUk to PhpStan checks * Update app/code/core/Mage/Paypal/Model/Config.php Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com> Signed-off-by: Sven Reichel <github-sr@hotmail.com> Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
Co-authored-by: sv3n <github-sr@hotmail.com>
…is and Pelago_Emogrifier to composer (#2411)
* Just updated docs ... * ... and updated phpstan baseline. * Apply suggestions from code review Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com> * Update app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com> Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component: Adminhtml
Relates to Mage_Adminhtml
Component: Api
PageRelates to Mage_Api
Component: Api2
Relates to Mage_Api2
Component: Authorizenet
Relates to Mage_Authorizenet
Component: Bundle
Relates to Mage_Bundle
Component: Captcha
Relates to Mage_Captcha
Component: Catalog
Relates to Mage_Catalog
Component: CatalogIndex
Relates to Mage_CatalogIndex
Component: CatalogInventory
Relates to Mage_CatalogInventory
Component: CatalogRule
Relates to Mage_CatalogRule
Component: CatalogSearch
Relates to Mage_CatalogSearch
Component: Centinel
Relates to Mage_Centinel
Component: Checkout
Relates to Mage_Checkout
Component: Cms
Relates to Mage_Cms
Component: ConfigurableSwatches
Relates to Mage_ConfigurableSwatches
Component: Contacts
Relates to Mage_Contacts
Component: Core
Relates to Mage_Core
Component: Cron
Relates to Mage_Cron
Component: CurrencySymbol
Relates to Mage_CurrencySymbol
Component: Customer
Relates to Mage_Customer
Component: Dataflow
Relates to Mage_Dataflow
Component: Directory
Relates to Mage_Directory
Component: Downloadable
Relates to Mage_Downloadable
Component: Eav
Relates to Mage_Eav
Component: SalesRule
Relates to Mage_SalesRule
documentation
environment
JavaScript
Relates to js/*
translations
Relates to app/locale
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mage_SalesRule_Model_Validator::_canProcessRule() checks the validity of a coupon code that is in the process of being added to the cart, but it doesn't check for the single coupon expiration date. This PR adds this check.
Manual testing scenarios (*)
Now, what we're about to check isn't really supported by the core but I think it's still worth fixing.
salesrule_coupon
table, you'll find a record with the coupon code you just created aboveexpiration_date
column for that specific coupon and set it in the pastIt is true that the core wouldn't manage the expiration_date column but, since it exists, I know extensions (actually I was developing one today when I found this bug) that set the expiration_data for a single coupon (let's say you want a coupon to be usable only for 7 days after its generation), and it doesn't make sense to me that the core doesn't check for the expiration_date of a coupon.
After applying this PR you'll notice that the expiration_date gets correctly checked, if present.