Missing "No override" option from "Product Details Page" in the new vmadmin tmpl

Started by Abatap, January 31, 2024, 18:13:39 PM

Previous topic - Next topic

Abatap

Hello. There's a problem with VM versions 4.2.0 - 4.2.4 and the so-called "New Admin Template (vmadmin)". The option value of "No override" for the "Product Details Page" select box the product create / edit administration view is missing. This means that if a store has its own productdetails layout set in the global VM configuration then each and every created or edited product will have its productdetails layout switched back to the stock one (the "default" option value gets selected by default by the select element in question) unless you also have an override for that one or if you manually pick the needed layout for each product created/edited which is far from ideal.

Of course, to overcome the problem one could simply create a proxy override for the default layout (/templates/YOUR_TEMPLATE/html/com_virtuemart/productdetails/default.php) with the code similar to the following:


<?php

defined
('_JEXEC') or exit;

include 
join(DIRECTORY_SEPARATOR, [__DIR__'my-cool-alternative-layout.php']);


... or switch back to the original VM administration template.

VM Versions 4.2.0 and 4.2.4 running on Joomla! 4.4.2 and 5.0.2 with PHP 7.4 and PHP 8.1.

Milbo

Freaky, impossible!

But you are right. I  tested it. The crazy thing is, both use the same view.html.php and both use the same list ??
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Wow, this line here
$emptyOption = JHtml::_('select.option', vmText::_('COM_VIRTUEMART_ADMIN_CFG_NO_OVERRIDE'), '');

had the parameters switched so description was value and viceversa. The old chosen somehow fixed that. The new template uses the joomla chosen, imho. So thank you should be fixed.

just use the line above in /administrator/components/com_virtuemart/config.php line 98
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Abatap

While the proposed modification does return the "No override" option to the select field in question the option still gets placed the second (not pre-selected by default in other words) in the list of available options. And it also affects the old VM admin template now!

Oh, and the target file for your modifications should be /administrator/components/com_virtuemart/models/config.php I believe.

Milbo

Yes, the changes are a bit complexer. I had to resolve it by using the same HTML joomla function
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

webmanwebdesign

Hi there,

so is there a solution for this problem now?
I am just migrating a lot of old shops to Joomla 4 with VM4 and the classic admin template with Joomla 4 is not usable. (J 4.4.2 with VM 4.2.6)

But we had a layout override for the productdtails which had its own name (not default) and so, if I switch to the new template and change something, the layout of this product is set back to default and looks completely different than the other products.

I am really relying on this feature.
Kind regards
Tanja