VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: Cr3ativ3 on April 15, 2014, 21:11:37 PM

Title: How to add m² to specific product prcies.
Post by: Cr3ativ3 on April 15, 2014, 21:11:37 PM
Hi guys really need some help here please.

J 2.5.16 + VM2.0.26d

I have built a site for a client but have had some pretty odd issues trying to add m² to product prices. I am no coding genious but have some idea what i am doing....i am sure some of you legends in here can help as you always do...

Ok, i have a few categories that require m² added to the end of all product prcies, in default category view AND on default showprices, BUT, i have a category i do NOT want this to show in.

My problems are:

1: How do i add m² to the end of ALL prices?
2:How do i do this selecting specific categories?

I have tried some crude hacks and language overrides but it's just not the correct way to do this and i REALLY need some help here please.

Your help, as always, is VERY much appreciated.


Title: Re: How to add m² to specific product prcies.
Post by: JoomTut on April 16, 2014, 05:54:32 AM
If it applies to all prices, simply by configuring your currency to add m². But in your case, you need to customize the code.
Title: Re: How to add m² to specific product prcies.
Post by: Cr3ativ3 on April 16, 2014, 16:55:32 PM
Thanks for reply, yes agreed, as noted in my first post i need to apply to selected categories so i cannot apply to ALL just by adding code in the default_showprices.php file as this applies to everything available which is not the case.

Just need help with how to apply the correct code to apply to specific categories. Was thinking if i created another .php file that i could then assign to the correct category, but this is where i am struggling.

I can happily apply the correct code to default_showprices.php and add correct style to the template CSS override which puts the text exactly where i would like, but as stated, it puts it on EVERY product and this is not what i want to do.


Having a nightmare, trouble with clients who want options/features that aren't as easy as you would like to impliment.

Thanks for your reply though.
Title: Re: How to add m² to specific product prcies.
Post by: Cr3ativ3 on April 16, 2014, 18:47:41 PM
OK, i have answered one of my own questions to a certain point.

To add measurements/letters to all prices does not in fact require any kind of hack, it is simply added by going to the currency and adding it into the "positive format" field your desired output.

So in short:

Goto:
Admin ares::Components::Virtuemart::Configuration::Currencies

Find field: "Positive Format"

Amend as required, for example, as i wanted i just add this £{number}m² which provides ALL my prices with at the end.

I was hoping i could simply create another currency for GBP and publish "without" the m² and simply assign this currency to the products i do not wish to show but this so far has not worked.

For anyone who may require this or look at this post in future i will update as soon as i find a solution.