Advertisement:

Author Topic: Show Only Parent category (SOLVED)  (Read 48383 times)

Ashok Bhamla

  • Full Member
  • ***
  • Posts: 126
  • Just ask me
Show Only Parent category (SOLVED)
« on: April 24, 2016, 09:06:57 am »
Hello guys

here i am using code in meta
<?php echo osc_item_category() ; ?>
for display category for listing.

My plan use only parent category instead of > Parent >> Child.

I have image
RED mar is wrong in image
i want show only one parent category,
« Last Edit: April 25, 2016, 05:30:44 am by Ashok Bhamla »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Show Only Parent category
« Reply #1 on: April 24, 2016, 01:44:46 pm »
Hi,

Hm... If you're using default categories scheme, those are all subcategories. ??? Do you mean you want there "For Sale / Vehicles / Vehicles" (real parent categories)?

Regards

Ashok Bhamla

  • Full Member
  • ***
  • Posts: 126
  • Just ask me
Re: Show Only Parent category
« Reply #2 on: April 24, 2016, 06:01:40 pm »
Hi,

Hm... If you're using default categories scheme, those are all subcategories. ??? Do you mean you want there "For Sale / Vehicles / Vehicles" (real parent categories)?

Regards

Vehicles >> Car

I want to show only Vehicles only.

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Show Only Parent category
« Reply #3 on: April 25, 2016, 12:03:25 am »
Wherever you want that transformation, replace

Code: [Select]
osc_item_category()
with:

Code: [Select]
Category::newInstance()->findRootCategory(osc_item_category_id())['s_name']
Regards

Ashok Bhamla

  • Full Member
  • ***
  • Posts: 126
  • Just ask me
Re: Show Only Parent category
« Reply #4 on: April 25, 2016, 12:21:11 am »
Wherever you want that transformation, replace

Code: [Select]
osc_item_category()
with:

Code: [Select]
Category::newInstance()->findRootCategory(osc_item_category_id())['s_name']
Regards
Cool thanks buddy, it works. :)

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Show Only Parent category
« Reply #5 on: April 25, 2016, 01:23:42 am »
You're welcome. :) Please add [SOLVED] to the title of this thread.

Regards