Prestashop: Wrong visitor group assumed on multistore

Created on 4 Oct 2018  路  2Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

Every time the FrontController::getCurrentCustomerGroups() method is called and returns an empty array, the customer group is assumed to be 1 by default. But In Group admin page, you've got the choice to define visitor group to a different id than 1.

We should be using Group::getCurrent()->id instead.

To Reproduce

  • Create a new group and define it as the visitor group.
  • Create a category only visible by that group.
  • Link a product to this category.
  • Make a search call on this product name in frontend.
  • The product will not show.

Additionnal information
PrestaShop version: all versions
PHP version: all versions

1.7.4.3 Bug Categories Customer groups FO Fixed Minor

Most helpful comment

@Flowster @colinegin @marionf
Hi Flowster, your PR had conflicts with the current state of our develop branch.
I fixed the conflicts, but I didn't push on your repository because you used the branch 'develop'.

So here is the new PR:
https://github.com/PrestaShop/PrestaShop/pull/14702

Don't worry, the commits are still yours.

All 2 comments

Hi @Flowster,

Thanks for your report.
I manage to reproduce the issue with the last version 1.7.4.3.
We will see how to fix it.
https://drive.google.com/file/d/16uTliauIC5QSaAjxlTgHy_ILy2HnXz9n/view
Thanks!

@Flowster @colinegin @marionf
Hi Flowster, your PR had conflicts with the current state of our develop branch.
I fixed the conflicts, but I didn't push on your repository because you used the branch 'develop'.

So here is the new PR:
https://github.com/PrestaShop/PrestaShop/pull/14702

Don't worry, the commits are still yours.

Was this page helpful?
0 / 5 - 0 ratings