All products showing even if home category not in the association #2

Closed
opened 2023-12-28 09:26:39 -06:00 by selwynorren · 6 comments
selwynorren commented 2023-12-28 09:26:39 -06:00 (Migrated from github.com)

Howdy all,

I was testing this out today, and it seems that even if I don't have any products associated with the home category, all products loaded so far, still show up in the featured products on the home page.

I changed the category name in the database directly to read shop instead of home, however I did not change the ID at all, it still remains as ID of 2.

What could be the issue?

[Update]
If I select any other category, it will honour that category, however if I select 2 (Home) then it will select the first set of products loads, or random if selected, from any category, it does not explicitly select from category 2

So I am thinking something else is wrong here, maybe a database issue? however I have also tested this on a brand new install of 1.5.1 and I have the same issue

Howdy all, I was testing this out today, and it seems that even if I don't have any products associated with the home category, all products loaded so far, still show up in the featured products on the home page. I changed the category name in the database directly to read shop instead of home, however I did not change the ID at all, it still remains as ID of 2. What could be the issue? [Update] If I select any other category, it will honour that category, however if I select 2 (Home) then it will select the first set of products loads, or random if selected, from any category, it does not explicitly select from category 2 So I am thinking something else is wrong here, maybe a database issue? however I have also tested this on a brand new install of 1.5.1 and I have the same issue
selwynorren commented 2023-12-29 09:07:02 -06:00 (Migrated from github.com)

I managed to fix this, however I am unsure if this fix is correct as I have no reference for it.

In the database on the categories table then is a column called nLeft and nRight, with values of 2 and 168 respectively. I changed the 168 to a 2 and it started to works as expected.

@Traumflug can you confirm if this is an acceptable fix for this?

I managed to fix this, however I am unsure if this fix is correct as I have no reference for it. In the database on the categories table then is a column called nLeft and nRight, with values of 2 and 168 respectively. I changed the 168 to a 2 and it started to works as expected. @Traumflug can you confirm if this is an acceptable fix for this?
getdatakick commented 2024-01-03 00:50:44 -06:00 (Migrated from github.com)

In the database on the categories table then is a column called nLeft and nRight, with values of 2 and 168 respectively. I changed the 168 to a 2 and it started to works as expected.

This is most likely not the solution, and the issue will probably be reintroduced when you resave the home category.

Columns nleft and nright continains ids of first and last children

> In the database on the categories table then is a column called nLeft and nRight, with values of 2 and 168 respectively. I changed the 168 to a 2 and it started to works as expected. This is most likely not the solution, and the issue will probably be reintroduced when you resave the home category. Columns nleft and nright continains ids of first and last children
getdatakick commented 2024-01-03 00:53:28 -06:00 (Migrated from github.com)

When I read the original issue, I don't think this is a bug, but rather a misunderstanding how the module works. When you select home category, it will display any products associated with any category that is children of Home category. The product doesn't have to be associated with Home category explicitlly.

When I read the original issue, I don't think this is a bug, but rather a misunderstanding how the module works. When you select home category, it will display any products associated with any category that is children of Home category. The product doesn't have to be associated with Home category explicitlly.
selwynorren commented 2024-01-03 06:18:54 -06:00 (Migrated from github.com)

When I read the original issue, I don't think this is a bug, but rather a misunderstanding how the module works. When you select home category, it will display any products associated with any category that is children of Home category. The product doesn't have to be associated with Home category explicitlly.

Sure, that woudl make sense, however then the blockfeatured module would not make any sense then and would not teh same logic apply for any otehr subcategory then as well?

Meaning if I have grooming / beard oil, then if I choose grooming, then it would show products in grooming as well? because it does not do that.

I always have understood and taught customers, to get products into the featured category, you specifically tick the home category for that product. Always worked like that with PS 1.6 and every version of TB (Using it since the first version)

I never detected any other method that it would work?

> When I read the original issue, I don't think this is a bug, but rather a misunderstanding how the module works. When you select home category, it will display any products associated with any category that is children of Home category. The product doesn't have to be associated with Home category explicitlly. Sure, that woudl make sense, however then the blockfeatured module would not make any sense then and would not teh same logic apply for any otehr subcategory then as well? Meaning if I have grooming / beard oil, then if I choose grooming, then it would show products in grooming as well? because it does not do that. I always have understood and taught customers, to get products into the featured category, you specifically tick the home category for that product. Always worked like that with PS 1.6 and every version of TB (Using it since the first version) I never detected any other method that it would work?
getdatakick commented 2024-01-03 08:11:20 -06:00 (Migrated from github.com)

I believe it always worked this way.

If the category has set Display products from subcategories = true, then then method Category::getProducts will return even products associated with subcategories.

If you don't want this behaviour, you can edit Home category, and disable this option. Then, only products associated with this category will be displayed.

image

I believe it always worked this way. If the category has set **Display products from subcategories** = true, then then method **Category::getProducts** will return even products associated with subcategories. If you don't want this behaviour, you can edit Home category, and disable this option. Then, only products associated with this category will be displayed. ![image](https://github.com/thirtybees/homefeatured/assets/34651851/dfec15b2-ef6c-47bf-b876-efbcb670c270)
selwynorren commented 2024-01-03 10:19:18 -06:00 (Migrated from github.com)

Brilliant, I have done this and it works perfectly, thanks so much. Its great that in general products form sub categories will show, but just the home category its disabled

Brilliant, I have done this and it works perfectly, thanks so much. Its great that in general products form sub categories will show, but just the home category its disabled
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-thirtybees/homefeatured#2
No description provided.