Author Topic: Different Themes for Product details do not work  (Read 348 times)

tangouli

  • Beginner
  • *
  • Posts: 5
  • A beginner
  • Skype Name: Ulrich Heiwolt
Different Themes for Product details do not work
« on: July 25, 2020, 20:09:35 pm »
I use the actual virtuemart 3.8.4
Now I want creat a different theme for product details making a copy of the original ".../tmpl/default.php" as "lewtuch.php".
In the backend this new theme is displayed in category and product.
In the frontend ist becomes ignored!
Overriding the original "default.php" in template/html/... fine.
Thank you very much for a solution or a hint.

Please look at my correction below.

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3682
  • using Matomo instead of Google Analytics
Re: Different Themes for Product details do not work
« Reply #1 on: July 25, 2020, 23:03:34 pm »
Can you give a short description of what you want to change in the product details view? Maybe you will need to create a new sublayout.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27798
  • Always on vacation
    • Jenkin Hill Internet
Re: Different Themes for Product details do not work
« Reply #2 on: July 26, 2020, 12:47:17 pm »
Overriding modules/mod_virtuemart_product/tmpl/default.php can be used to alter the layout within the product module but would have no effect on the product details view within the VM component.  To change that you edit and override components/com_virtuemart/views/productdetails/tmpl/default.php and maybe also override the associated sublayout template files.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.8.4.10335 on Joomla 3.9.19 PHP 7.3.18

tangouli

  • Beginner
  • *
  • Posts: 5
  • A beginner
  • Skype Name: Ulrich Heiwolt
Re: Different Themes for Product details do not work
« Reply #3 on: July 26, 2020, 12:58:30 pm »
Thank you both,

I have seen my error and used the correct path:
 components\com_virtuemart\views\productdetails\tmpl
 templates\template\html\com_virtuemart\productdetails
as you have described.

But the problem is the same:
I have attached three images to describe the administration and the used files:
It is possible to select an save the new theme but it is not used by the frontend.


jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27798
  • Always on vacation
    • Jenkin Hill Internet
Re: Different Themes for Product details do not work
« Reply #4 on: July 26, 2020, 18:19:12 pm »
Are you sure that the edit you made to the template file will be visible in the product details display?

You have not shown what edit you made, but a simple step to check that the right template file is being used is to add a marker, eg add in some text that you know will be displayed.

eg this will place the word EDITED just above the product description.
Find:
Code: [Select]
if (!empty($this->product->product_desc)) {
?>
<div class="product-description" ><h1>EDITED</h1>
<?php /** @todo Test if content plugins modify the product description */ ?>


and change to:
Code: [Select]
if (!empty($this->product->product_desc)) {
?>
<div class="product-description" >
           <h1>EDITED</h1>
<?php /** @todo Test if content plugins modify the product description */ ?>

The product details page also includes sublayouts, you may need to override one or more of those as well.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.8.4.10335 on Joomla 3.9.19 PHP 7.3.18

tangouli

  • Beginner
  • *
  • Posts: 5
  • A beginner
  • Skype Name: Ulrich Heiwolt
Re: Different Themes for Product details do not work
« Reply #5 on: July 26, 2020, 19:18:45 pm »
Thank you for your answer,
of course, I did so.
(for testing, I took much different versions, an elder one, I used before and the actual one of original virtuemat 3.8.4.
you can see the difference in size in the file-image.)

Now I think, there is a general problem in my installation:
I tested the same mechanism with the categories. Also there it doesn't work.
That meens, you can select them in administration but in the frontend it will not displayed but the default-theme.

Do you know, where in general the selection-mechanism for these themes is?





GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9747
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Different Themes for Product details do not work
« Reply #6 on: July 27, 2020, 19:08:23 pm »
was just doing the the exact same thing ( over riding cat and prod views with new files from the admin) and confirm is working correctly in VM3.8.4

the logic is in   components\com_virtuemart\helpers\vmtemplate.php

static function setVmTemplate ($view, $catTpl = 0, $prodTpl = 0, $catLayout = 0, $prodLayout = 0) {
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

tangouli

  • Beginner
  • *
  • Posts: 5
  • A beginner
  • Skype Name: Ulrich Heiwolt
Re: Different Themes for Product details do not work
« Reply #7 on: August 02, 2020, 15:21:14 pm »
Thank you for your help.

Now I have found the problem.

It is depending of the configuration of virtuemart: if choosing "Layout Bootstrap Version" other than "none", the class VmView in components\com_virtuemart\helpers\vmview.php ads a token like "bs4_" ahead the theme name. So my theme "lewtuch" becomes "bs4_lewtuch" for execution.

It is a strange behavior, while you can choose a theme is the administration by picking a filename and then is becomes modyfied by the program and so is not used.

I have chosen "none" for "Layout Bootstrap Version" and now all seems to work well.
My template "outside" virtuemart is of course a modern bootstrap 4 template but I don't see any problem.

So I have the new question: what is the adjustment "Layout Bootstrap Version" made for and how should I use it?



jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27798
  • Always on vacation
    • Jenkin Hill Internet
Re: Different Themes for Product details do not work
« Reply #8 on: August 02, 2020, 17:48:27 pm »
It has been mentioned on this forum several times before, you should currently only use the Layout Bootstrap version None (Use legacy), but I would not expect new users to see those. The alternatives are likely to be useful when using Joomla 4 with appropriate templates. I thought this setting had been removed from view in earlier version, but see it is still there.  There are some bs4- sublayouts and one bs4- css file installed with current versions, still under development.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.8.4.10335 on Joomla 3.9.19 PHP 7.3.18

tangouli

  • Beginner
  • *
  • Posts: 5
  • A beginner
  • Skype Name: Ulrich Heiwolt
Re: Different Themes for Product details do not work
« Reply #9 on: August 02, 2020, 18:28:01 pm »
Thank you very much for the explanation.
I didn't kwow about and that coused me (and you) much time to search ...
Yes, it would be much better, if this setting would be removed unsless there is a proper functionality.