News:

Support the VirtueMart project and become a member

Main Menu

Creating multiple different product pages

Started by LePetitJardin, December 21, 2013, 18:24:31 PM

Previous topic - Next topic

LePetitJardin

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.

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

LePetitJardin

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:

  • "No override" which I think uses the template in "com_virtuemart/views/productdetails/tmpl/default.php"
  • "default" which I understand to mean the override in "templates/some_template/html/com_virtuemart/productdetails/default.php"
  • "notify" which I assume means the "com_virtuemart/views/productdetails/tmpl/notify.php"
  • "pdf" which is "com_virtuemart/views/productdetails/tmpl/pdf.php" (or "com_virtuemart/views/productdetails/tmpl/default_pdf.php" ?)
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.

jenkinhill

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

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

LePetitJardin

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:

  • Change the naming convention of the files I was creating and overriding. Previously I'd used underscores and I changed to using hyphens.
  • I flushed the cache.
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.

spike2014

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.

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation