VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: malik0206 on April 10, 2013, 15:50:20 PM

Title: How to create new Product Details Page template
Post by: malik0206 on April 10, 2013, 15:50:20 PM
HI

I'm currently building a website for a wine seller and my issues is i need to create 2 different layout for the ITEM details page.

This was easily done on Virtuemart 1.1 but am not sure how this is now done on Virtuemart 2.0


In Views>productdetails>tmpl>default.php (this is used for all products details) but i want to be able to duplicate this and create different style layout.

Can anyone help me with this please i just need to know how i can create multiple products layout.

Please have a look at the attachments as i have duplicated the default.php and renamed it to default_winecases.php and duplicated the .xml but when i try to assign the layout in category is not showing the template which i created.


Any advise would be great help


thanks

[attachment cleanup by admin]
Title: Re: How to create new Product Details Page template
Post by: K&K media production on April 10, 2013, 16:42:09 PM
it is the same way like joomla template overrides...more info:

http://docs.virtuemart.net/tutorials/33-templating-layouts/78-introduction-template-system.html
Title: Re: How to create new Product Details Page template
Post by: malik0206 on April 10, 2013, 20:10:52 PM
Thanks but i would really like to use the feature within virtuemart so that i get a dropdown list of different styling when i create the Caetgory

Title: Re: How to create new Product Details Page template
Post by: K&K media production on April 10, 2013, 20:25:10 PM
You can choose it in this dropdown. Name the file e.g. mylayout.php ... look in the description for joomla template overrides ... for vm it is the same way like joomla item details page

"The new template system of virtuemart allows fine grained overrides for each category and product. Even the views can have different templates. We did not implement our own template system, it is based upon what is already there. So we have the joomla template system and some methods to override, but this leads to some limitations."
Title: Re: How to create new Product Details Page template
Post by: malik0206 on May 22, 2013, 18:51:32 PM
Hi

Can anyone help me creating multiple category and product details layout please

have created a template labelled 'item' and copied in to the html folder com_virtuemart/views/

i can see my template in product category and selected the template then made some modification to category/tmpl/default.php

when i refresh i still get system default layout.


Some help please


Thanks
Title: Re: How to create new Product Details Page template
Post by: K&K media production on May 28, 2013, 21:23:03 PM
you must store the template overrides here:

your_template/html/com_virtuemart/subfolder/default.php

it is the same way like joomla template overrides

http://docs.virtuemart.net/tutorials/33-templating-layouts/78-introduction-template-system.html
Title: Re: How to create new Product Details Page template
Post by: malik0206 on May 29, 2013, 14:18:04 PM
Hi i have followed instructions but still unable to do template override

please see the attached images

your help is much appreciated

Thanks

Am still little confused as to how i created the override and which files to copy over screen shots will show what i've done.


[attachment cleanup by admin]
Title: Re: How to create new Product Details Page template
Post by: K&K media production on May 29, 2013, 18:50:12 PM
example for category layout:

copy

components/com_virtuemart/views/category/tmpl/default.php

to

your_template/html/com_virtuemart/category/default.php
Title: Re: How to create new Product Details Page template
Post by: malik0206 on May 29, 2013, 19:18:38 PM
THANKS

Got the template to work.
Title: Re: How to create new Product Details Page template
Post by: rosciak on February 12, 2014, 04:01:45 AM
Hi. Can't get it to work. I just want to create ONE ADDITIONAL template for product details page. In fact i just want to remove ADD TO CART button for some products.

I created

mytemplate/html/com_virtuemart/category
mytemplate/html/com_virtuemart/productdetails

then i copied correct default.php with new name. Can't see it on the list of available templates for both, category and product. What i'm doing wrong? Im not a total newbie and i'm not asking for help often, but this confused me so much...

I see it working, because i can overwrite default.php with new default.php from mytemplate/html/com_virtuemart/productdetails but i need TWO different views for my products.

Title: Re: How to create new Product Details Page template
Post by: jenkinhill on February 12, 2014, 11:22:58 AM
Are you using the right selector for overrides? eg in Cat view it is Category Browse Page  not  Category Template. See pic


[attachment cleanup by admin]