Different display for a category

Phoca Cart - complex e-commerce extension
AlainR
Phoca Member
Phoca Member
Posts: 15
Joined: 24 Jul 2018, 16:33

Different display for a category

Post by AlainR » 06 Jun 2020, 15:12

>>>>>>>>>>>> english below <<<<<<<<<<<<

Bonjour.
Merci beaucoup pour ce composant tellement pratique et fourmillant de possibilité (à s'y perdre parfois...).

Un client aimerait avoir un affichage différent pour une catégorie, comment faire cela ?
Je m'explique : la plupart des produits ont l'affichage "grid". Une catégorie de produits n'aura aucune photo et nous souhaitons un affichage en liste. Est-ce possible de faire cela ? Comment ?

>>>>>>>>>>>> english version <<<<<<<<<<<<

Hello.
Thank you very much for this component so practical and teeming with possibility (to be lost sometimes...).

A customer would like to have a different view for a category, how to do that?
Let me explain: most products have the "grid" display. A product category will not have a photo and we want a list display. Is it possible to do this? How?

Best regards,
AlainR

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42650
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Different display for a category

Post by Jan » 07 Jun 2020, 20:06

Hi, the category view has for now three types of views:

- grid
- list
- gridlist

and you can switch between them.

See e.g. here:
https://www.phoca.cz/jtd/

Image

You can override it with your template. The layouts for these outpus you can find here:

components\com_phocacart\layouts\items_grid.php
components\com_phocacart\layouts\items_gridlist.php
components\com_phocacart\layouts\items_list.php

Such outputs can be set in your template so your customized output will be not overwritten when updating Phoca Cart.

Jan
If you find Phoca extensions useful, please support the project

AlainR
Phoca Member
Phoca Member
Posts: 15
Joined: 24 Jul 2018, 16:33

Re: Different display for a category

Post by AlainR » 08 Jun 2020, 17:50

Thank you very much.
I know this possibility.

What we need :
- for all Phoca Cart products pages : grid (this is defined by general Phoca Cart config and it's OK)
- for one category : list

Could we imagine an option in the menu link?

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42650
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Different display for a category

Post by Jan » 11 Jun 2020, 13:18

Hi, there is a possibility in Joomla! to copy parameters from Options (components parameters) to menu link parameters. So the parameter for setting the default view:

Image

can be copied and set for different menu links.

But menu links can access different categories, so maybe better solution is to make some hack in core view and set the view by category ID

Something like ... if category ID = XX then set the parameter to list view ... etc. :idea:

Jan
If you find Phoca extensions useful, please support the project

AlainR
Phoca Member
Phoca Member
Posts: 15
Joined: 24 Jul 2018, 16:33

Re: Different display for a category

Post by AlainR » 12 Jun 2020, 09:11

Thank you very much for your answer.
I don't understand how to copy from Options to menu link...

I create a menu link Category View (list Products) but I only have to parameters : Display Pagination et Display Pagination (on top).
Do I have to choose another menu link type ?

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42650
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Different display for a category

Post by Jan » 12 Jun 2020, 12:24

Hi, copying options is about copy the XML parameters from global options XML file to menu link XML file. See this guide (it is guide for Joomla! 2.5 but should be valid for Joomla! 3):

https://www.phoca.cz/documents/16-jooml ... a-25-17-16

Jan
If you find Phoca extensions useful, please support the project

AlainR
Phoca Member
Phoca Member
Posts: 15
Joined: 24 Jul 2018, 16:33

Re: Different display for a category

Post by AlainR » 12 Jun 2020, 18:05

Fantastic! Thank you very much.
I try to copy default.xml in templates/my_template/html/com_phocacart/category/default.xml but it doesn't work to display option in menu link.

So I did it in components/com_phocacart/views/category/tmpl/default.xml. I think it will be lost in the next update of you component.

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42650
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Different display for a category

Post by Jan » 15 Jun 2020, 13:02

Hi, yes, unfortunately, XML cannot be set as override, so it will be lost when updating - so backup is needed and after update just overwrite the default XML :-(

Jan
If you find Phoca extensions useful, please support the project

AlainR
Phoca Member
Phoca Member
Posts: 15
Joined: 24 Jul 2018, 16:33

Re: Different display for a category

Post by AlainR » 15 Jun 2020, 13:22

Perhaps could you add to the ToDoList adding more options in category settings and/or menu link settings to resume or override general settings... ;-)

Thank you very very much for your help and your work.

Is there a easiest possibility to translate all your work ? I do this work for some of your component but I don't know where to drop the french files...

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42650
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Different display for a category

Post by Jan » 16 Jun 2020, 17:34

Hi, just let me know your ideas about the parameters, so I can write them to feature request list.

What do you mean with "drop the french files"?

See here:
https://www.phoca.cz/download/category/ ... -component

there is french translation made partialy by user and partialy by machine translation. So such file can be downloaded and improved.

Jan
If you find Phoca extensions useful, please support the project

Post Reply