Can different product displays be assigned to different categories

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
8 years 7 months ago #255077

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 5.6

So that products displayed in on ecategory can have a completely different layout to products in another category.

Is it possible?

Thanks, James

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

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
8 years 7 months ago #255094

Hi,

Yes. In the settings of your categories, you can find the "layout on product page" setting which allows you to select a specific layout to use on the product page of the products of that category.

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

  • Posts: 846
  • Thank you received: 92
8 years 7 months ago #255127

Hi
Does this layout ll be use in all the extension that need to rendering this product ?
i think of all the menu item type that manage product content ?
is there a way to apply different layout to same product ?
regard's

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

  • Posts: 26253
  • Thank you received: 4040
  • MODERATOR
8 years 7 months ago #255131

Hi,

- It is not possible to understand your question.
- sorry, that's not a question.
- no

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
8 years 7 months ago #255367

I think Lionel75 is asking the some question as myself. It is clear that under each category it is possible to choose 4 options.

1) inherit
2) default
3) reversed
4) tabular

And for each category it is possible to assign a different layout.

However is it possible to add custom layouts to this list to then assign on a per category basis? So if a product is in 2 different categories would it be possible to display the same product with a different layout according to the category it is in?

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

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
8 years 7 months ago #255375

Hi,

Yes, you can add custom layouts to this list.
Edit "show_default" view file via the menu Display>Views, change the name "default" at the top and save and you'll the new layout with your file name based on the default one.
If the product is in two categories and that you have different layouts selected in the category and no layout selected in the product, it's the layout of the first category of the product which will be used.
Now having different layouts for a product based of where from you're accessing the product page is possible with some small custom code provided that the information from where you come is known (for example, by turning off the "simplified breadcrumbs" setting and having the "category_pathway" parameter in the URLs.

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
8 years 7 months ago #255454

Thanks for the reply. I remember reading in another thread the code that needs to be added, but doing a search I am unable to find it . Could you point me in the right direction please?

J

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

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
8 years 7 months ago #255468

Hi,

If you look at the code of the "show" view file, you can see this code which loads the product page with the product layout selected:
$this->setLayout($this->productlayout);
echo $this->loadTemplate();
So just change the value of $this->productlayout before these to lines with the name of your view file for your layout based on the criteria you want.

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
8 years 6 months ago #256394

If a products has different variants, would there be a way to assign a particular variant to a specific layout?

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

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
8 years 6 months ago #256396

Hi,

With complex coding changes, anything is possible.
But the way the system is built, it's not meant to have a different layout for different variants.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum