VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: LePetitJardin on December 21, 2013, 18:24:31 PM

Title: Creating multiple different product pages
Post by: LePetitJardin on December 21, 2013, 18:24:31 PM
In VM1.x you could have multiple flypages and choose them on a per product or per category basis.

I see in VM2 that it has Default Product Pages for both categories and products. I can see a choice to use "no override", "default", "notify", "pdf"

I've also read about placing overrides in the template directory which I am happily doing already.

However I want to have a number of different products pages for different products/categories and the override approach is an all or nothing approach.

I've been reading the forums a while but all references seem to point to overriding the default in the template directory which is fine if you want the original product page ("no override") or the override one, but I need to be able to have several overrides/different product pages.

Thanks for reading.
Title: Re: Creating multiple different product pages
Post by: jenkinhill on December 21, 2013, 18:51:20 PM
Have you looked at the options on the individual products/categories pages?

You can set different overrides for each and every product and/or category. On each product information page the override selector is "Product Details Page"
And on each category general information page you can select the override as "Category Browse Page" and also set a default override for the product display pages which only applies to the products in that category, unless overridden at individual product level. It is totally flexible.
Title: Re: Creating multiple different product pages
Post by: LePetitJardin on December 21, 2013, 20:13:05 PM
Hi Kelvyn,

Thanks for the reply (and lucky you living in such a great part of the world!).

I'm a bit confused how I override each product with a different equivalent of the old flypage. For example within a product all I can select as the override at the Product Details Page drop down is:
What I'm hoping to be able to do is have a one "default.php" for some products and a different one for others. I've tried cloning the default.php (i.e. I created a new product view PHP file from the default, called e.g. my_default.php) with some minor tweaks to show the differences) in both the com_virtuemart and template branches but I can't seem to then select them in the back end Product Information view at the Product Details Page drop down - all I have are the same four options listed above and not any new ones of my own making.

Thanks again and have a good weekend.

Jezz.
Title: Re: Creating multiple different product pages
Post by: jenkinhill on December 21, 2013, 20:27:58 PM
Then you are not doing it right. A product details override should be placed in
templates/[your-joomla-template]/html/com_virtuemart/productdetails/

If you edit the VM  productdetails/tmpl/default.php and call it, for example prod6-default.php and add it to the override directory then it will show in the dropdown list.

Remember that the final product view is made up of elements from the VM default productdetails/tmpl/directory so you must be sure to override the element you want to change.

See http://docs.virtuemart.net/tutorials/33-templating-layouts.html and http://www.ostraining.com/blog/joomla/overrides

Title: Re: Creating multiple different product pages
Post by: LePetitJardin on December 27, 2013, 21:06:04 PM
Hi Kelvyn,

I tried what you suggested (it was what i was doing before) and it still didn't work.

However, after a bit of random tinkering i got it to work but I'm not sure how! Two things I did were:
I'm not sure which fixed it without going back over this but something did and I'm up and running now.

Thanks for the advice.
Title: Re: Creating multiple different product pages
Post by: spike2014 on November 24, 2014, 09:01:42 AM
I have a problem with virtuemart templating. My joomla version is 2.5.27 and virtuemart 2.6.12.2.I want to have a general view in category and in some specific products in the category another. The procedure that I have done is this :
I have created the override folder into mytemplates/html/com_virtuemart/productdetails/ and I have copy the files into components/com_virtuemart/views/productdetails/tmpl/. When I try to assign the different view into a product using Product Details Page into the product this action is not be accepted. Is any wrong in this procedure? Any advise will be very helpful.
Thanks.
Title: Re: Creating multiple different product pages
Post by: GJC Web Design on November 24, 2014, 11:27:38 AM
If your explanation is correct all you've done so far is globally over ride the default prod details template
Now you have to create 1 or more additionally over rides that you then can select

careful with the naming  - only hyphens - not underscores
e.g. from Jenks example ->  prod6-default.php