Skip to content
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 Coupon Removal Failure When Shipping/Tax Is Applied To Quote #512

Closed
wants to merge 1 commit into from

Conversation

SafrazSSears
Copy link

This pull request is based on Issue #508

In the Shopping Cart, when you use the estimate shipping/tax feature, apply the estimations to the order, add a coupon code to the order, and then remove the coupon, the Shopping Cart returns the "Coupon code was canceled." messages, however, the coupon remains attached to the quote/sale.
If you do not use the estimate shipping/tax feature, the coupon can be added and then removed without issue.

LAMP Stack
Linux: Ubuntu 16.04.10 (AWS Ubuntu 16.04 AMI)
Apache: Apache/2.4.18 (Ubuntu)
MySQL: Ver 15.1 Distrib 10.1.35-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
PHP: PHP 7.0.30-0ubuntu0.16.04.1 (cli)

Magento CE Version: 1.9.3.9

Modules Active In Local Pool:

Inchoo_PHP7
Modules Active In Community Pool:

Cm_RedisSession
Active Theme: base/default

This pull request is based on Issue OpenMage#508 

In the Shopping Cart, when you use the estimate shipping/tax feature, apply the estimations to the order, add a coupon code to the order, and then remove the coupon, the Shopping Cart returns the "Coupon code was canceled." messages, however, the coupon remains attached to the quote/sale.
If you do not use the estimate shipping/tax feature, the coupon can be added and then removed without issue.

LAMP Stack
Linux: Ubuntu 16.04.10 (AWS Ubuntu 16.04 AMI)
Apache: Apache/2.4.18 (Ubuntu)
MySQL: Ver 15.1 Distrib 10.1.35-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
PHP: PHP 7.0.30-0ubuntu0.16.04.1 (cli)

Magento CE Version: 1.9.3.9

Modules Active In Local Pool:

Inchoo_PHP7
Modules Active In Community Pool:

Cm_RedisSession
Active Theme: base/default
@@ -620,6 +620,7 @@ public function couponPostAction()
}
} else {
$this->_getSession()->addSuccess($this->__('Coupon code was canceled.'));
$this->_getSession()->setCartCouponCode($couponCode);
Copy link
Contributor

@Flyingmana Flyingmana Aug 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to do it above the message, to if something goes wrong with setting, it happens before we send out the message.

besides that I think it would make more sense, to directly set en empty string, or even Null(does Null work there?)
The empty string, because if the else is triggered, this means $codeLength did resolve to false

@tbaden tbaden added code change requested For Tickets where changes in code are needed, but seem mostly fine review needed Problem should be verified labels Jun 1, 2019
@sreichel sreichel added bug duplicate and removed review needed Problem should be verified code change requested For Tickets where changes in code are needed, but seem mostly fine labels May 31, 2020
@sreichel
Copy link
Contributor

Closed with #656

@sreichel sreichel closed this May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants