Do you enter a parent category in your PrestaShop and do not see products?

3924 readings
In PrestaShop, if you want a product to appear within the parent category of its default category, you have to expressly mark it. This goes against nature, and requires extra work.
Image of Do you enter a parent...

The case is this: imagine that in your PrestaShop online store you have a "Pants" category, and within it a "Jeans" subcategory. When you register a jeans product, you will obviously associate it with "Jeans" as the main category.

But, if you don't associate it to the "Pants" category as an additional category, when you visit this category in your store that pants will not appear, nor will it count towards the count of products in this category. In fact, if you don't have any products associated with it, the legend "0 products in this category" will appear, even though in its subcategories, such as "Jeans", there are products.

This can be confusing for the visitor, and the most natural behaviour is that a product appears in its main category as well as in all the parent categories (upwards) of the main one.

PrestaShop gives freedom to show or not the products in the parent categories, in fact, by default it doesn't show them, but they must be specifically associated with them. This is a nuisance, since as we have said the natural thing is to want them to be shown, and therefore requires having fun checking the corresponding boxes when creating a product.

Thanks to PrestaImport, there is a specific module to alleviate this. This is "Recursive parent", a module that automatically associates the products to the parent categories of their main category when saving them. It also works for any additional categories the product is associated with. Also, if you have already created your store, and you have registered products yet, the module allows you to apply the process to them massively, all at once. And, from there, continue working on each product that is created or edited.

As you can see, this is a really useful module. You can get it very cheaply on the PrestaImport website:

Associate products to parent categories