Remove Category Image from Product Listing

  • Posts: 2
  • Thank you received: 0
11 years 3 months ago #157457

I have recently started to work with HikaShop and I am trying to figure out how it is possible to do the following.

I have created a category listing menu, which have 2 levels of categories. Similar as described in here:http://www.hikashop.com/support/documentation/67-hikashop-content-display-front-end.html#categories_menu

When I click on top level Category the page displays:
1) Category Image
2) Category Description
3) All direct subcategories
And that is all fine.

But the when I click any of the subcategories it also shows Category Image and Description + products list.

Changing image setting for the menu item either shows or hides on both pages, but i want to show only on top category.

How can I remove Category Image and Description in product listing page? Which way should I be looking?
I had a look into CSS, but all the classes are the same and I don't see a way to do it with CSS.

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 84298
  • Thank you received: 13694
  • MODERATOR
11 years 3 months ago #157482

Hi,

There is no option to do that and you can't do it in CSS.
You need to edit the file "listing" of the view "category" of the frontend via the menu Display>Views and change the code:

if(($this->params->get('show_image') && !empty($this->element->file_path))|| ($this->params->get('show_description')&&!empty($this->element->category_description))){
to:
if(in_array($this->element->category_id, array(XXX,YYY,ZZZ)) && ($this->params->get('show_image') && !empty($this->element->file_path))|| ($this->params->get('show_description')&&!empty($this->element->category_description))){
where XXX,YYY and ZZZ are to be replaced with the id of the categories where you want to display the description and image.

The following user(s) said Thank You: gatis

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
11 years 3 months ago #157510

I was really looking for a solution where I don't need to specify category IDs as they might change.

I went through the category table and found that I could use category_depth, which I have added to the same if condition you mentioned. If the number of category levels will remain the same I will go with it. If not will use your solution provided.

Anyway thank you for a quick response.

Please Log in or Create an account to join the conversation.

Time to create page: 0.048 seconds
Powered by Kunena Forum