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

fixes #10849 Wrong visitor group assumed on multistore #14702

Merged

Conversation

@matthieu-rolland
Copy link
Contributor

commented Jul 17, 2019

Questions Answers
Branch? develop
Description? Default group should not be id 1 but the visitor group set by the shop owner.
Type? bug fix
Category? CO
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #10849
How to test? Follow steps in above ticket

This change is Reviewable

@matthieu-rolland matthieu-rolland requested a review from PrestaShop/prestashop-core-developers as a code owner Jul 17, 2019
classes/Product.php Outdated Show resolved Hide resolved
classes/Product.php Outdated Show resolved Hide resolved
classes/Product.php Outdated Show resolved Hide resolved
@matthieu-rolland

This comment has been minimized.

Copy link
Contributor Author

commented Jul 17, 2019

This is a remake of this PR: #10851

I fixed the conflicts, and made a new PR because I didn't want to push on @Flowster's own develop branch, since he made the fix on his develop branch.

@@ -2863,8 +2863,8 @@ public static function getPricesDrop(
if (Group::isFeatureActive()) {
$groups = FrontController::getCurrentCustomerGroups();
$sql_groups = ' AND EXISTS(SELECT 1 FROM `' . _DB_PREFIX_ . 'category_product` cp
JOIN `' . _DB_PREFIX_ . 'category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` ' . (count($groups) ? 'IN (' . implode(',', $groups) . ')' : '=' . (int) Configuration::get('PS_UNIDENTIFIED_GROUP')) . ')
WHERE cp.`id_product` = p.`id_product`)';
JOIN `' . _DB_PREFIX_ . 'category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` ' . (count($groups) ? 'IN (' . implode(',', $groups) . ')' : '=' . (int) Group::getCurrent()->id) . ')

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Jul 17, 2019

Contributor

No tabs please :)

This comment has been minimized.

Copy link
@matthieu-rolland

matthieu-rolland Jul 17, 2019

Author Contributor

done !

@@ -138,7 +138,7 @@ public static function getBestSales($idLang, $pageNumber = 0, $nbProducts = 10,
if (Group::isFeatureActive()) {
$groups = FrontController::getCurrentCustomerGroups();
$sql .= ' AND EXISTS(SELECT 1 FROM `' . _DB_PREFIX_ . 'category_product` cp
JOIN `' . _DB_PREFIX_ . 'category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` ' . (count($groups) ? 'IN (' . implode(',', $groups) . ')' : '=' . (int) Configuration::get('PS_UNIDENTIFIED_GROUP')) . ')
JOIN `' . _DB_PREFIX_ . 'category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` ' . (count($groups) ? 'IN (' . implode(',', $groups) . ')' : '=' . (int) Group::getCurrent()->id) . ')

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Jul 17, 2019

Contributor

No tabs please :)

This comment has been minimized.

Copy link
@matthieu-rolland

matthieu-rolland Jul 17, 2019

Author Contributor

done !

@matthieu-rolland matthieu-rolland force-pushed the matthieu-rolland:flowster-develop branch from 83737e5 to 38b8598 Jul 17, 2019
@matthieu-rolland matthieu-rolland force-pushed the matthieu-rolland:flowster-develop branch from 38b8598 to d0ed9b8 Jul 17, 2019
@matks
matks approved these changes Aug 21, 2019
@matks matks added this to the 1.7.7.0 milestone Aug 21, 2019
@sarahdib sarahdib added QA ✔️ and removed waiting for QA labels Aug 22, 2019
@matthieu-rolland matthieu-rolland merged commit 269afab into PrestaShop:develop Aug 26, 2019
2 checks passed
2 checks passed
PrettyCI Code formatting
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.