VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: hazael on May 17, 2022, 10:03:25 AM

Title: No price override in the new template in VM4
Post by: hazael on May 17, 2022, 10:03:25 AM
No price overwriting in the new Virtuemart 4 template.
Generally, it is displayed in the old template, but not in the new one.
Title: Re: No price override in the new template in VM4
Post by: pinochico on May 17, 2022, 10:17:26 AM
sorry, I can't see, because I have PHP8.1 and on this I see error by edit product:

administrator/index.php?option=com_virtuemart&view=product&task=edit&virtuemart_product_id=156
ValueError
Missing format specifier at end of string

administrator/components/com_virtuemart/helpers/vmtext.php:154
return call_user_func_array('sprintf', $args);
Title: Re: No price override in the new template in VM4
Post by: jenkinhill on May 17, 2022, 11:38:13 AM
The price override function has been removed from VM, it was introduced years ago to solve a temporary problem following version upgrades, but now it is not required as it causes a lot of confusion. eg http://forum.virtuemart.net/index.php?topic=148293.msg528931#msg528931
Title: Re: No price override in the new template in VM4
Post by: pinochico on May 17, 2022, 13:57:21 PM
And how will the normal display on the e-shop be handled now please?:
- original price before discount - crossed out
- discounted sale price
- buy this product because you save 15%

P.S.
Maybe now it is time for new plugin into administration - override price :)
Title: Re: No price override in the new template in VM4
Post by: AH on May 17, 2022, 14:40:37 PM
That is a simple price display override for items with discounts
Title: Re: No price override in the new template in VM4
Post by: Roderic on May 17, 2022, 15:07:43 PM
It seems that the options are still there when you switch the template to the old template. In the new/beta template the options are gone. However, when you do the following:
- revert to the old template
- choose one of the overwrite options for a certain product
- switch back to the new template

It will still show the options for that product. So It just seems to be a templating issue.

If you rename  product_edit_price.php in administrator/templates/vmadmin/html/com_virtuemart/product, it will "fix" the issue for now. I for one definitely cannot do without this functionality and it would seem silly to me to remove it.


A similar issue is that you cannot select the option "No override" in the dropdown for the layout. The corresponding file is product_edit_information.php in administrator/templates/vmadmin/html/com_virtuemart/product on line 83.


Title: Re: No price override in the new template in VM4
Post by: pinochico on May 18, 2022, 00:01:46 AM
to Roderic

Thanks :)
I check template and prepare override for customer - we need this function too, sorry DEV :)
Title: Re: No price override in the new template in VM4
Post by: pinochico on May 18, 2022, 00:17:59 AM
My sincere apologies to DEV VM, you did great :)
and also info for Roderic, who preferred to use workaround and maybe for AH, who didn't mention this option in his reply, and I'm sure for others:

Override price is not going anywhere!!!

If you want this feature back, you need to already go into the configuration and enable Expert mode for pricing.

Then everything will be as before.
Title: Re: No price override in the new template in VM4
Post by: AH on May 18, 2022, 10:21:52 AM
Pinochio

I don't use the new backend template

However my option does not require the use of price override to achieve the result you outlined.  It can be achieved using a simple VM Tax and calculation rule for a discount and a productprices layout override.

- original price before discount - crossed out
- discounted sale price
- buy this product because you save 15%

Example of this in my screen grab below - This uses simple VM discount method.

Of course - If you have to use price overrides then that is up to you and the template needs modifying - However, I was trying to educate anyone reading this post, so that they can see there may be no need to use price overrides.
Title: Re: No price override in the new template in VM4
Post by: pinochico on May 18, 2022, 11:22:03 AM
yes, I don't use new admin too.

But for this answer, I installed VM4 on our new DEV server and try find solutions for this problem.
Title: Re: No price override in the new template in VM4
Post by: Roderic on May 18, 2022, 12:23:56 PM
Quote from: pinochico on May 18, 2022, 00:17:59 AM
My sincere apologies to DEV VM, you did great :)
and also info for Roderic, who preferred to use workaround and maybe for AH, who didn't mention this option in his reply, and I'm sure for others:

Override price is not going anywhere!!!

If you want this feature back, you need to already go into the configuration and enable Expert mode for pricing.

Then everything will be as before.

Great find, that indeed solves this issue. You don't tend to look there when you've seen that page many times before. There is also nothing in the changelog as far as I know.
Title: Re: No price override in the new template in VM4
Post by: Milbo on June 27, 2022, 10:45:44 AM
It shows set prices, even if disabled. And you can enable it.