Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Joomla Virtuemart Template - DarkMart (SKU# FLEX-00011)

TOPIC: Decimal percentage not working

Decimal percentage not working 10 years 7 months ago #5742

The decimal percentage won't show on my product discount, it only shows the amount of percentage but without coma decimal.

I have taken pictures as examples.

If you need more information or pictures let me know.

Thanks in advance


Attachment decimal-not-working.jpg not found

The topic has been locked.

Decimal percentage not working 10 years 7 months ago #5746

This is core VM stuff - we just make the templates that display what VM has calculated....

Have you checked your currency setup for that currency in admin - and how your writing the discount

looks to me like VM thinks it is 2.2 -150 which is aprox. 6800% discount? or?
The topic has been locked.

Decimal percentage not working 10 years 7 months ago #5750

Thank you for fast respon :)

yes, i have checked currency setup in admin as per attachment.

in Indonesia currency, decimal symbol is comma ( , ) and thousands separator is dot ( . )
so we write the discount like your script (discount amount / price before discount * 100) = (150 / 2.200 *100)


Attachment currency-in-admin-1.jpg not found



Attachment currency-in-admin-2.jpg not found

The topic has been locked.

Decimal percentage not working 10 years 7 months ago #5753

OK,
so getting rid of the dot should fix this

try adding this just after line 501 in templates/flexible_darkmart/html/com_virtuemart/productdetails/default.php

so just before
$per = ($PerDiscountAmount / $PerBeforeDiscount * 100);

//change for Indonesia
				$PerBeforeDiscount = str_replace('.','',$PerBeforeDiscount);
				 $PerBeforeAmount = str_replace('.','',$PerBeforeAmount);
 
 

should work

Cheers
The topic has been locked.

Decimal percentage not working 10 years 7 months ago #5757

Woow :) very fast respond and the script running well... Thanks alot John :)
The topic has been locked.

Decimal percentage not working 10 years 7 months ago #5758

Excellent

topic marked solved
The topic has been locked.
Time to create page: 0.185 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo