Describe the bug
If you have the function show products from categories disabled you will in FO get no products in category if you have subcategories.
This apply if you have products in the main category, but none of the products in the category is default to the main category.
To Reproduce
Steps to reproduce the behavior:
Go BO
Disable the show products from categories
Add a rule and choose a main category with subcategories.
Add some products to the main category which are default to other categories.
You will in FO get no producs in category
Take the same products and make them default to the main category and there are showing in the FO.
This worked in faceted search 2.2.1
Additionnal information
Testet on Prestashop 1.7.4.2 and 1.7.5.1 with same result
PHP version: 7.2
Hi @tjorgensborg,
Thanks for your report.
Yes, I have the same behavior with PS1.7.6.0beta1 & ps_factedseach v3.0.2
with ps_facetedsearch v2.2.0
@marionf, what do you think, this is bug fix from v2 or regression in the v3?
You can follow this comment https://github.com/PrestaShop/PrestaShop/issues/13949#issuecomment-496119757.
Thanks!
Hi @tjorgensborg
Take the example of "clothes" category, by default you have 2 products in this category:
If you disable "show products from subcategories" in ps_facetedsearch and display "Clothes" category in FO, it's normal to not see these products because they belong to Men and Women categories as main.
If you display "Men" category you will see Hummingbird printed t-shirt and if you dislpay "Women" category you will see "Hummingbird printed sweater"
Hello @marionf
Yes its true what you have testet, BUT if you try to add some products from Women to Clothes you still will not be able to see it if you dont make Clothes your default category. With version 2.2.1 you can have products that does not have cloths as default category and still see them. If you have disabled the show products from subcategories you cant even see products in main categories that are not using faceted search. I will give you some examples.
Here is example 1
No faceted search filter in backend.
Result
Should have shown
Only way to make that happen is to disable the faceted search
Example 2.
Im creating a layer for facetet search displaying a main category with some subcat and I am only using the main category for faceted search in this example. And Show subcategory is still disabled.
Here you see only 2 products the reson is because they have "abc utstyr" as default category
but in "abc utstryr" there is 6 products, again only way to show those six products is to disable the module OR use show products from subcategories set to enabled BUT then you show all products in all subcat (which its right)
In faceted search 2.2.1 when show products from subcategories was disabled it show products in the category, it did not matter if it was default or not to that category.
The bug is that its only showing default category products not all products in the specific category.
We can confirm this is an issue since the update. If we choose to show a product in multiple categories( subcategories) then the faceted search doesn't need to interfere if the switch 'Show subcategory' is set to off.
Hi @marionf,
This issue is reproduced if:
In the FO with ps_factedsearch v3
In the "Clothes" category Hummingbird printed t-shirt
is displayed => OK
In the "Men" category Hummingbird printed t-shirt
is not displayed => it is not the same behavior with ps_factedsearch v2
Thanks!
Yes, it's not the same, but it was a bug.
The button "Show products from subcategories" is here to only display products which are in the "Main category" not the latest one.
Otherwise where it should be displayed if you have this:
Yes, as @PierreRambaud said, I think there was an issue before and it's the correct behavior now
Hello, I have the same problem on my shop after upgrading to ps_factedsearch v3..
@marionf could you explain how it is the correct behavior now ? If a product is selected in a category (other than the main category). The product should be visible in the FO even if the setting of ps_factedsearch v3 is "Show subcategory" is off ?
Thanks for the explanation :)
Hello @marionf and @PierreRambaud
I dont know how to explain it better but I will try.
When show products from subcategories is enabled/Yes every thing is working the way its intended to do, so we dont to put more time on that function, its OK.
This is only when show products from subcategories is disabled/off and I will try to give you some examples of the bug.
When you have disabled show products from subcategories it should show all products in the category not only the one defaulted to the category.
I'm not able to reproduce your behavior:
No product with main category in Clothes:
But I've one for Men:
And one for women:
Exactly like in the BO:
Hello @PierreRambaud
If I understand correctly you are reproducing the error the error in this case is that is not showing the products in Clothes. In you example If I see right it should have shown Hummingbird sweater and printed T shirt. It should not ONLY taking the main category products like its doing now. It should show all products in Clothes. Only way to show all products in cloths (2 products in your case) is to disable the faceted search module.
Faceted search should not check after main category products in a category it should show all products in that category (main and other) like its done without the faceted search module installed. When you have Show products from subcategories disabled This is how it works in 2.2.1.
Hello @PierreRambaud
If I understand correctly you are reproducing the error the error in this case is that is not showing the products in Clothes. In you example If I see right it should have shown Hummingbird sweater and printed T shirt. It should not ONLY taking the main category products like its doing now. It should show all products in Clothes. Only way to show all products in cloths (2 products in your case) is to disable the faceted search module.
Faceted search should not check after main category products in a category it should show all products in that category (main and other) like its done without the faceted search module installed. When you have Show products from subcategories disabled This is how it works in 2.2.1.
And should work in version 3.0.X. Somebody fixed something that wasn't broken. Undo this fix plz!
Hello, I understand that the 3.0.X may work as intended, but since 2.2.1 worked in a certain way, the update broke two of my shops (Some plugins also need that the option "show products from subcategories" is disabled)
For example, after the update, one of my main categories went from "1260 products" to only four products. If I activate "show products from subcategories", they went back, but the plugin that I use to sort the product wasn't working anymore. So I had to recompile the 2.2.1 in order to fix my shop...
You should make a warning in the changelog that appear on the B.O.
Have a nice day
Hello all,
I can see there's a lot of interest with this topic ! :-)
Let me try to synthetise what you all said and what i understand :
- the new faceted search version fixes something which we considered a bug but :
1. some of you prefered the previous behaviour with the "show products from subcategories" option
2. some plugins are working according to the behaviour of the previous faceted search version, and with the new one, they no longer work.
3. For some of you, the new version brings important changes in the product results.
- i feel that there is a misunderstanding of the difference between default / main category, subcategories, and parent / child categories.
My questions are :
Thanks for your feedbacks !
Have a nice day,
Coline from Product team
Hello @colinegin
I will once again try to explain but first we need to add try to use same words every one, so I am trying to define some words here so will all use same syntax.
Main category is the category is the top category and can have subcategories but dosen麓t need to have subcategories.
Subcategories is categories under main categories
Default catalog is the catalog if make a search from FO you will be redirected to or in other word home/default/main catalog for the spesific product.
In faceted search when show subcategories are enabled everything works (can麓t say anything about modules), so I dont think thats an issue.
In faceted search when show subcategories are disabled problem starts.
Problem one.
It will only show default catalog products so in the image I have subbmitted I would get "error" no products in catalog, because all my products in that main catalog have other default categories.
Of course right way is to show all products in that category (default category products and non default categories product if they are pined to the catalog.
Example: If you create a catalog where you want to show cool products and add products from other catalogs to cool products catalog.You will get no products in catalog in FO.
Problem 2.
If you dont want to use faceted search in above examples you still get "no products in catalog EVEN if faceted search is not applied. ONLY way too see the products in a specific catalog (default or not) is to disable faceted search module. Faceted search is overriding prestashop core function even on catalogs you dont want to use faceted search.
Solution.
Make faceted search great again :-).
When show subcategories disabled faceted search should not make a any diffrence on default category products and not default categories products only show products in that specfic catalog.
This function is in version 2.2.1
To answer your question.
_you used to leave the option for subcategories disabled, but can't you just enable it in the new version? What does it change for you (except the issue with added plugins) ?__
Yes that work work execpt I cant controll the layout of products meaning, I cant move products up and down to get the optimized result to promote what I want to promote. If you have subcategories, you cant controll how the products are displayed.
Example. we are selling diving lights and we want to have spareparts in the bottom but now it using position from each sub cat to display I think it looks like this pos1 sub1, pos1 sub2 pos1 sub3, pos 2 sub 1 etc etc. here is a real live example
https://fue.no/dykkerutstyr/lykter/
This not the way we want to display the products
_isn't it possible to just change the default category of your products ? Does it have any impact for you ?_
No but its lot of work when you move products like in my example with a catalog with cool stuff. If like we have 3000 products it will take a looooot of time.
As you can see on the top right corner, it's write Main category
not Default category
.
You're talking about how you manage your categories, with only one level of category
In my situation, and if I take your definitions.
Clothes
is the main category for Women
but not for Men
and is not a subcategory of Home
Men
is the Main category
for Awesome subcategory
and not a subcategory for Men
Women
is a subcategory for Clothes
it's really confusing :thinking:
With your definition, if I understand well, the "home" category should be the main category of ABC utstyr, right ?
To be able to take the right decision on this feature, we need more feedbacks from other types of usage. Once we agree on the best option behaviour, we will update the module. In the meantime, if the 2.2.1 version of the module suits your needs, we advise you to stay with it.
Thanks again for your feedback and your understanding !
I cannot update from v.2 to v.3 due to this problem, when will be solved?
I cannot update from v.2 to v.3 due to this problem, when will be solved?
Well, the main question will it be solved or not?
I spent a day trying to understand what broke my shop. Backed to 2.2.1. It helped but it seems abnormal at PS 1.7.6.1
Hi @deadbloger,
In my case, I did not manage to reproduce the issue with PS1.7.6.1 & ps_facetedsearch v3.4.0 using the theme by default.
I attached a screen record
https://drive.google.com/file/d/1m-i6czzZSg9QqHA7a-NaH46FJJ1PbuSu/view
Thanks!
Hi @colinegin, @marionf,
We need also to specify those cases: (reproduced with PS1.7.6.2 & ps_facetedsearch v3.4.0)
I have two products set in this way
I want to show "t-shirt" in both "men and clothes categories".
Instead, I want to show "sweater" only on the "women category".
Unfortunately "clothes" category shows both products
The second product shouldn't be displayed in the Clothes category because it is not selected for this product
https://github.com/PrestaShop/PrestaShop/issues/16925#issuecomment-569062534
Thanks!
Hi, @khouloudbelguith
I need to say a clarification.
It shows correctly both products, when "Show products from subcategories" is enabled.
The problem is when "Show products from subcategories" is disabled, because it doesn't show any product. In this specific case it should only show "t-shirt".
@marionf @PierreRambaud
So is it going to be fixed or it is not an issue?
Ok. No one wants to change this, so I did 馃榿
Here is pull request: https://github.com/PrestaShop/ps_facetedsearch/pull/158
I hope @marionf @PierreRambaud will approve it, cause other way I will always need to update it my self after new release 馃榿
@gadnis This option is the same as Show products from subcategories
only the wording differ :thinking:
@PierreRambaud are you talking about php code or just formulation of the switch button title?
Talking about the behaviour
@PierreRambaud, behaviour is different.
With my option on, merchant can add product to whatever category they want and the product will be shown in those categories only (not in all the tree with subcategories).
Hello @gadnis
Your option seems to do exactly the same thing as "show products from subacategories", only the wording is different
Display product from subcategories on yes:
Display product from subcategories on no:
Show products only from default category on no:
Show products only from default category on yes:
@marionf
I believe that you have none products in accessories category at all, only in the main category. Like the example here:
Try do this:
And then with options:
Go to category "Stationery" and than "Art". You will see there is that product inside both of categories. But none in subcategories (unless they checked).
Ok @gadnis I get it, your option make sens but we have to make the 2 options work together
@PierreRambaud will have a look to adapt your PR
Hello @tjorgensborg @venditdevs @Multipage @chrisvanberg @deadbloger @AndreaC71 @francct
Could you test the PR https://github.com/PrestaShop/ps_facetedsearch/pull/158 of @gadnis and tell us if it meets your needs ?
Thank you
Hi @marionf @gadnis,
I was able to do the test (I merged the PR with branch 1.7.7.x), and it works correctly.
There is just an issue, because I can easily force both the "show from subcategory" and "only from default category" status to YES, and of course it's a wrong condition.
As a merchant I can say it's an important feature, so thank you!
@francct you probably forgot to run terminal command: npm run build
? There is changes in js files made but you have to build assets manually
Hi @gadnis
I'm sorry, I initially forgot to run npm run build
.
Now I have run npm install
and npm run build
inside ps_facetedsearch
directory, but i can still set YES on both buttons.
Maybe I'm doing something wrong.
@francct you need to clear cache in performance section and clear browser cache. Maybe that鈥檚 the case
@gadnis I cleared the cache from the performance section and cleared the browser cache.
I attach the video https://youtu.be/hStKB2blFZw
@francct You maybe need to read the notice under the Switch button :roll_eyes:
@PierreRambaud I underlined it in this comment
Anyway, the functionality is perfect! Thank you so much @gadnis!
Thank you for your feedback @francct, it should be ok now
When "Show products only from default category" is on Yes then "Display products from subcategories" goes on No and becomes disabled
Fixed by PrestaShop/ps_facetedsearch#158
Most helpful comment
Fixed by PrestaShop/ps_facetedsearch#158