Author Topic: Issue with assigning categories  (Read 2773 times)

Offline Sam_78

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +42/-1
    • View Profile
Issue with assigning categories
« 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  :-[

Offline eCommerce Core

  • Administrator
  • Hero Member
  • *****
  • Posts: 1602
  • Karma: +93/-1
    • View Profile
Re: Issue with assigning categories
« Reply #1 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.
“If you’re in the luckiest one per cent of humanity, you owe it to the rest of humanity to think about the other 99 per cent.”
― Warren Buffett

Offline Sam_78

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +42/-1
    • View Profile
Re: Issue with assigning categories
« Reply #2 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.. .

Offline eCommerce Core

  • Administrator
  • Hero Member
  • *****
  • Posts: 1602
  • Karma: +93/-1
    • View Profile
Re: Issue with assigning categories
« Reply #3 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.



“If you’re in the luckiest one per cent of humanity, you owe it to the rest of humanity to think about the other 99 per cent.”
― Warren Buffett

 

Powered by SMFPacks Social Login Mod