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 conditionals check in DiscountController #8337

Merged
merged 1 commit into from Nov 30, 2017

Conversation

Projects
None yet
7 participants
@Matt75
Contributor

Matt75 commented Sep 15, 2017

Questions Answers
Branch? 1.6.1.x
Description? DiscountController : Fix type checking in conditionals
Type? bug fix
Category? FO
BC breaks? no
Deprecations? no
Fixed ticket? #8178 (comment)
How to test? Create a cart rule associate to a customer without gift product attribute and go to FO -> My Account -> My Vouchers

This change is Reviewable

@prestonBot

This comment has been minimized.

Show comment
Hide comment
@prestonBot

prestonBot Sep 15, 2017

Collaborator

Hello Matt75!

This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community!

Collaborator

prestonBot commented Sep 15, 2017

Hello Matt75!

This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community!

$product = new Product((int) $discount['gift_product'], false, (int)$this->context->language->id);
if (!Validate::isLoadedObject($product) || !$product->isAssociatedToShop() || !$product->active) {
unset($cart_rules[$key]);
}
if (Combination::isFeatureActive() && $discount['gift_product_attribute'] !== 0) {
if (Combination::isFeatureActive() && (int)$discount['gift_product_attribute'] !== 0) {

This comment has been minimized.

@hibatallahAouadni

hibatallahAouadni Sep 15, 2017

Contributor

@eternoendless it looks neat 👍

@hibatallahAouadni

hibatallahAouadni Sep 15, 2017

Contributor

@eternoendless it looks neat 👍

@eternoendless eternoendless added this to the 1.6.1.18 milestone Sep 15, 2017

@Quetzacoalt91

Some changes were also suggested in #8539

@Quetzacoalt91 Quetzacoalt91 merged commit c4b19c4 into PrestaShop:1.6.1.x Nov 30, 2017

2 checks passed

codacy/pr Good work! A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Quetzacoalt91

This comment has been minimized.

Show comment
Hide comment
@Quetzacoalt91
Member

Quetzacoalt91 commented Nov 30, 2017

Thank you @Matt75

@eternoendless eternoendless changed the title from FO: Fix conditionals check in DiscountController to Fix conditionals check in DiscountController Jan 29, 2018

@Matt75 Matt75 deleted the Matt75:PSCSX-9217 branch Oct 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment