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

Calculate the number of available products with the stock management #132

Merged
merged 8 commits into from Sep 13, 2019

Conversation

@PierreRambaud
Copy link
Contributor

commented Sep 4, 2019

Fixes: PrestaShop/PrestaShop#15056


This change is Reviewable

@PierreRambaud PierreRambaud removed the WIP label Sep 5, 2019
@@ -456,7 +456,7 @@ private function hideUselessFacets(array $facets, $totalProducts)
(
count($facet->getFilters()) === 1
&& $totalFacetProducts < $totalProducts
&& $usefulFiltersCount > 1
&& $usefulFiltersCount > 0

This comment has been minimized.

Copy link
@matks

matks Sep 9, 2019

Contributor

This can lead to massive changes in the behavior, sure about it ?

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Sep 9, 2019

Author Contributor

image
As you can see in this image, you have only one Color which is not Not available, without the change, it doesn't display it.
More, because the facet doesn't have the same number of products than the total, it means the filter is useful and can be used.

@matks
matks approved these changes Sep 9, 2019
@matrixino

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

@PierreRambaud I'm still getting products that shouldn't show after applying this diff.
If I set for example Size 43 in a shoe shop, I'm still getting some products which don't have size 43 as an option.
Does this only works if the product has the size 43 combination set at 0 qty?
Is it possible to hide all the product which don't have that attribute value size at all, without having to add that size/attribute value to products that will never have it?
I think I should not add lots of unuseful combination just to set their qty to 0. It should automatically remove products which don't have that attribute value set.

Edit: Actually I'm getting the opposite. I have 2 shoes. One has Size 43 set to 0 qty, the other one doesn't have size 43 at all (just 41 and 42). If I select size 43 in faceted, the one with 43=0 remains, while the one which doesn't have it at all disappears. Shouldn't both disappear?

@marionf

This comment has been minimized.

Copy link

commented Sep 10, 2019

@matrixino This is another improvement request, please follow this issue: PrestaShop/PrestaShop#14518 (comment)

@matrixino

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

@matrixino This is another improvement request, please follow this issue: PrestaShop/PrestaShop#14518 (comment)

Thanks, I fixed it myself

@PierreRambaud PierreRambaud added the bug label Sep 12, 2019
@PierreRambaud PierreRambaud added this to the 3.3.0 milestone Sep 12, 2019
@sarahdib sarahdib added QA approved and removed Waiting for QA labels Sep 13, 2019
@PierreRambaud PierreRambaud merged commit b8e4a49 into PrestaShop:master Sep 13, 2019
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
@PierreRambaud PierreRambaud deleted the PierreRambaud:fix/15056 branch Sep 13, 2019
PierreRambaud added a commit to PierreRambaud/ps_facetedsearch that referenced this pull request Sep 13, 2019
Calculate the number of available products with the stock management
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.