News:

Support the VirtueMart project and become a member

Main Menu

Different Themes for Product details do not work

Started by tangouli, July 25, 2020, 20:09:35 PM

Previous topic - Next topic

tangouli

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

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

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

Retired from forum life November 2023

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

tangouli

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

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:

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:

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

Retired from forum life November 2023

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

tangouli

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

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 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

tangouli

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

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

Retired from forum life November 2023

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

tangouli

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.