Category title in product listing grouped by cat

  • Posts: 6
  • Thank you received: 0
11 years 6 months ago #135108

-- url of the page with the problem -- : mywebsite.com/mypage
-- HikaShop version -- : x.x.x
-- Joomla version -- : x.x
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message

-- url of the page with the problem -- : duecaffeprova3.altervista.org/automobili/lubrificanti-racing
-- HikaShop version -- : 1310121420
-- Joomla version -- : 2.5.16
-- PHP version -- : 5.3
-- Browser(s) name and version -- : Every
-- Error-message(debug-mod must be tuned on) -- : None

I have a vertical menu with submenu in the left (it's a custom menu, since not all the items link to product pages).
In "Automobili" > "Lubrificanti racing", I show the products of category grouped by category.
I would like to show the title of the parent category ("Lubrificanti Racing") over the groups.
Is it possible?

Thanks in advance,
Marco

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

  • Posts: 12953
  • Thank you received: 1778
11 years 6 months ago #135123

Hi,

If you have set of title through the "title" option of the configuration page of your category listing content menu, you'll just have to add some code like :

<?php echo '<h1>'.$this->document->title.'</h1>'; ?>
At the beginning of your "listing_div" file of your "category" view of your front-end template via "Hikashop->Display->Views".

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

  • Posts: 6
  • Thank you received: 0
11 years 6 months ago #135210

Hi Mohamed,
I think that the file you suggested me is not correct: I added the line of code but nothing changed (actually, the structure of the resultant HTML is not consistent with the structure of the page: there is no DIV element with 'hikashop_subcategories' class, for example).

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

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
11 years 6 months ago #135277

I don't think that you need to edit any code. Simply turn on the component heading option of your menu item via the joomla menu manager and that should do it.

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

  • Posts: 6
  • Thank you received: 0
11 years 6 months ago #135298

Hi Nicolas,
what you suggest is what I did before contacting you, as you can see from the screenshot below.



Any other hints?
I can provide you access to the site, if you like.

Thanks.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 6 months ago #135342

Sending me a temporary access to your website through a private message will probably help me to understand your issue.
thanks :).

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

  • Posts: 12953
  • Thank you received: 1778
11 years 6 months ago #135770

Hi,
I just did some tests through your website, and the problem was coming from the way you configured your Sub elements filter option, when you set it to "All sub elements" it works fine.

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

  • Posts: 6
  • Thank you received: 0
11 years 6 months ago #135779

Hi Mohamed,

The soulution you provided is not so good for me: I do need grouping by category, but I would like to have a main title (i.e. the parent category) over the grouping.
Is it possible?

Thanks,
Marco

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

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #135882

Hi,

This will require a view edition so some custom code.
PHP skills are needed.

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

  • Posts: 6
  • Thank you received: 0
11 years 6 months ago #135884

Hi Xavier,

shoud I create a new view?
Isn't possible to edit the existing grouping-by-category view, adding a title?

Marco

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

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #136001

Hi,

The view to edit is "product / listing".
The desired part is in the "else":

} else if(!empty($this->rows) && !empty($this->categories)) {

The following user(s) said Thank You: 2caffe

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

  • Posts: 6
  • Thank you received: 0
11 years 6 months ago #136021

Got it!
Thanks!
Marco

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

Time to create page: 0.102 seconds
Powered by Kunena Forum