News:

Support the VirtueMart project and become a member

Main Menu

Discount mistake in amount saved

Started by Greatdanes, June 27, 2014, 14:25:47 PM

Previous topic - Next topic

Greatdanes

How come my VM is showing the discount the costumer can save as a negative amount like "you save -400,00" instead of "you save 400,00"?

Greatdanes

Let me rephrase the question then - how do you fix it in the VM default template?

AH

You need to do a template override for the prices
Regards
A

Joomla 3.10.11
php 8.0

Greatdanes

So it's normal to type it "you save -400,00"?

AH

Regards
A

Joomla 3.10.11
php 8.0

GJC Web Design

that is standard - it changed around 2.0.20 something from a positive to a negative value - I know cos it broke a script we had to update a 3rd party DB..

I wrote a post here somewhere about the way to re-display it but buggered if I can find it - (is it just me or is this forum search bollocks? I rarely find anything I'm looking for.. hmmmm)
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

GJC Web Design

is this in the cart with coupon or a discount on a product page?
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

Greatdanes

It's on the product page like this

Old Price 1000,-
New Price 600,-
You save -400,-

That is for me looking strange.

GJC Web Design

there is no text "you save" in Vm - so you must be using a third party template

normally it would be

Old Price 1000,-
New Price 600,-
Discount  -400,-

but just find the generated figure and php abs it...

http://www.w3schools.com/php/func_math_abs.asp

something like

echo abs($this->currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices));

or what ever is rendering the discount
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

Greatdanes

True it's not "you save" it's show and it's done in the language fil "en-GB.com_virtuemart.ini" - COM_VIRTUEMART_CART_SUBTOTAL_DISCOUNT_AMOUNT="Discount"

"You save" is my version of it :)

But somewhere in the programmering there must be a place where it's set to show negativ discount if used and I want the alternativ to change it to a positiv nummer but can't find that place  ;D

GJC Web Design

it is buried in the helpers/calculationh.php but if you start messing in there your nuts ..  ;)

just abs() it in the template
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

Greatdanes

Sure I will do it the easy way - just need to learn and find that.

But thanks for the inputs - great to get enlightened  ;)