VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Graph_1802 on March 07, 2023, 11:47:59 AM

Title: Cannot override product layout in Joomla override section
Post by: Graph_1802 on March 07, 2023, 11:47:59 AM
Hi,
I'm using Joomla ‎4.2.8 ‎4.2.8 and Virtuemart 4.0.12.
Inside the override section of the template I'm trying to override virtuemart product layouts.
So I go to Create override -> com_virtuemart and click on "product".
The notice "Override created in /templates/shaper_helixultimate/html/com_virtuemart/product" appears.
BUT when I go inisde the override directory in FTP the product folder is empty.
The override of any other virtuemart layout works fine: this is the only one that doesn't work.
I have tried also on other domains and Joomla 4 installations: I always obtain the same result.
Can anyone help?
Thanks in advance!
Title: Re: Cannot override product layout in Joomla override section
Post by: jenkinhill on March 07, 2023, 12:20:49 PM
There is no default VM template for "product" so no override can be created - I don't know why that folder is present, it does not exist in VM3. You should create overrides for "productdetails" to change the product layout.
Title: Re: Cannot override product layout in Joomla override section
Post by: Graph_1802 on March 07, 2023, 15:20:14 PM
Ok, thank you very much.
So could you please indicate me which layout I have to override in order to modify the product thumbnail in category view? Inside the "productdetails" templates override I cannot find any!
Title: Re: Cannot override product layout in Joomla override section
Post by: pinochico on March 07, 2023, 16:31:19 PM
You find inside the"productdetails" templates for "Category" view?!
And how you find?

Pls find something about joomla templating and view (MVC), then you will know where find

view->template for view->load layout
Title: Re: Cannot override product layout in Joomla override section
Post by: Graph_1802 on March 07, 2023, 17:12:24 PM
Hi, thank you for the reply.
I'm not searching the templates for "category" view: I'm trying to guess which layout I have to override in order to modify the product thumbnail, inside the category view.
I don't find that portion of the code inside the category layout overrides, so I searched for the "product" overrides but, as I have learned above, they don't exist.
jenkinhill suggests to search inside "productdetails" overrides so I asked to kindly indicate if inside that directory I could find that layout.
Title: Re: Cannot override product layout in Joomla override section
Post by: pinochico on March 07, 2023, 18:40:21 PM
quote]I have to override in order to modify the product thumbnail in category view[/quote]

????
Why are you trying to trick me? :)

Sorry, you use category view, definitely, don't matther if you talk about products inside category view
If you know how function MVC Joomla (model, views, controllers), then you have to go inside category view

Hmmm, Why don't you look in the documentation joomla?

If you inside category view, the you see template default and inside you see which template is loaded for products.
It is not template for ProductDetails view.

Try self look inside PHP pls, don't wait to anybody.

Definitely is some layout from folder sublayouts.
Title: Re: Cannot override product layout in Joomla override section
Post by: GJC Web Design on March 07, 2023, 18:54:34 PM
Quote->->modify the product thumbnail, inside the category view

over ride views/sublayouts/product.php

to

html/com_virtuemart/sublayouts/product.php
Title: Re: Cannot override product layout in Joomla override section
Post by: Graph_1802 on March 08, 2023, 10:47:38 AM
Hi GJC Web Design, thank you for the reply.
the folder "sublayouts" is not inside the folder "view" but on the same level. Moreover the file inside "sublayouts" is not product.php but products.php.
In any case creating the folder html/com_virtuemart/sublayouts/products.php via FTP inside the template, and modifying it, doesn't produces the expected result.
Title: Re: Cannot override product layout in Joomla override section
Post by: jenkinhill on March 08, 2023, 11:49:34 AM
First you say:

Quote from: Graph_1802 on March 07, 2023, 11:47:59 AM
Inside the override section of the template I'm trying to override virtuemart product layouts.

Then you tell us you want to "modify the product thumbnail, inside the category view".

OK, the thumb display code is in vm-product-media-container div within the products.php sublayout. You say that modifying that code does not produce the "expected result".

Can you tell us what you are trying to do with the thumb image display?
Title: Re: Cannot override product layout in Joomla override section
Post by: Graph_1802 on March 08, 2023, 12:15:24 PM
Hi,
I have found which layout I had to modify: it is the bs3-products.php inside "sublayouts" folder.

It remains a question: why on the Joomla backend -> template -> create override -> com_virtuemart there is not the voice "sublayouts"?
And why, always inside "create override", the voice "product" is present but not working?
But perhaps it is better to leave this questions for another topic.

P.S. the expected result is to produce any kind of modification in the product thumbnail part of the category view.

Many thanks to everyone for your kind assistance!