-
-
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
Prevent duplicate entry when updating salesrule_coupon_usage #1117
Prevent duplicate entry when updating salesrule_coupon_usage #1117
Conversation
I haven't had a chance to look at this closely but is it related to #1031 which has already been merged? /cc @mattdavenport |
Yes it is, but #1031 caused some issues, especially #1116.
|
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.
Tested with latest 19.4.6
The new code has a second if clause that would addresses the concern.
* remove $timesUsed > 0 check to prevent duplicate entry * Prevent $timesUsed from going less than 0
* Remove $timesUsed > 0 check to prevent duplicate entry * Prevent $timesUsed from going less than 0 refs: OpenMage#1031
#1302) * bump version * Fix _addUrlRewrite() ignoring collection store scope. (#510) While Mage_Catalog_Model_Resource_Product_Collection::addUrlRewrite() does respect any set storeId on the collection it's helper that does the actual work is hard-coded to the current active store. * Add doc comments to image related classes (#1146) * Prevent duplicate entry when updating salesrule_coupon_usage (#1117) * remove $timesUsed > 0 check to prevent duplicate entry * Prevent $timesUsed from going less than 0 * Fix a bug where media upload via API are not possible anymore: #1178 * revert unwanted changes * Update lib/Varien/Io/File.php Co-authored-by: Flyingmana <flyingmana@googlemail.com> Co-authored-by: Colin Mollenhour <colin@mollenhour.com> Co-authored-by: Erik Dannenberg <ed@reshape.de> Co-authored-by: Tymoteusz Motylewski <t.motylewski@gmail.com> Co-authored-by: Dean Williams <me@deanwilliams.org> Co-authored-by: sv3n <github-sr@hotmail.com>
Description (*)
If you cancel a customer order with a promo code and try to place an order with the same promo code it fails because of an Integrity constraint violation: 1062 Duplicate entry on salesrule_coupon_usage since times_used goes to 0 when the order is canceled. I removed the check for $timesUsed > 0 so that it will run as an update instead of an insert.
Related Pull Requests
#1031
Fixed Issues (if relevant)
Manual testing scenarios (*)