AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: Sam_78 on July 18, 2017, 11:50:36 AM

Title: Issue with assigning categories
Post by: Sam_78 on July 18, 2017, 11:50:36 AM
Hello Admin,
I have one issue while assigning categories to my products
Example: I sell product lets say "polo tshirt"
while assigning category I have to manually select mens, then tshirts, then polo shirts
I select mens, then mens>thisrt, then mens>shirts>polo
rather then I can just select mens>tshirts>polo
so that it should be automatically available in mens and tshirt section..

I dont assign anything to sub-category where I dont want it in prime category.. I know I Can manually do that but sometimes I do forget assigning one category  :-[
Title: Re: Issue with assigning categories
Post by: eCommerce Core on July 21, 2017, 01:32:48 PM
If you want to show product in the parent category, you need to assign this product to parent category. Otherwise, it will be only included to leave category that you included.
Title: Re: Issue with assigning categories
Post by: Sam_78 on July 25, 2017, 12:20:17 PM
If you want to show product in the parent category, you need to assign this product to parent category. Otherwise, it will be only included to leave category that you included.

Is there easy fix to this. Because some times I have many sub-sub-categories and besides it doesn't make sense to add product in sub-category but not in parent category.. .
Title: Re: Issue with assigning categories
Post by: eCommerce Core on July 25, 2017, 01:31:09 PM
Is there easy fix to this.
I am trying to understand what is the fix that you are looking for?

Looks like you want to show all the products in the category tree down. AbanteCart does not work this way.
This can be customized with updating query in the below product model.

https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/model/catalog/product.php#L227
Code: [Select]
public function getProductsByCategoryId( ...
Keep in mind that this SQL operation will be slow if you have many categories.

Because some times I have many sub-sub-categories and besides it doesn't make sense to add product in sub-category but not in parent category.. .
You do not have to add products to parent category. Once you go to subcategory you will see all the products in that category.