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

TOPIC: Removing the 'minus' in percentage discount

Removing the 'minus' in percentage discount 10 years 4 days ago #9809

Hi,

I'm wanting to show 20% OFF instead of -20% in the FlexiblePercentage box and have figured out how to add the 'OFF', but can't find how to remove the minus sign.

Any help with this would be greatly appreciated.
The administrator has disabled public write access.

Removing the 'minus' in percentage discount 10 years 2 days ago #9827

Hi,

Since the discount value is "minus", when CleanMArt do the math for calculation the percentage, the "minus" sign get carried.

It is easy to get right of it. I agree with you, there is no point to show the percentage with minus sign.
Follow my suggestion:

1- for Category Page: Open this PHP file:
/templates/YOUR_TEMPLATE/html/com_virtuemart/category/default.php
default.php or flexv2.php, depends on what layout you are using for the category page

look for this line:
$percentage = round($per, 0);

and replace it with this:
$percentage = abs(round($per, 0));

FYI: abs() is a PHP function that transform all the numbers to positive. If it is already positive, then it won't touch it

Then for adding the OFF expression next to percentage value:

Attachment Pasted_Image_5_16_14__6_55_PM.png not found




2- for Product Details Page: Open this PHP file:
/templates/YOUR_TEMPLATE/html/com_virtuemart/productdetails/default.php

Basically the same change

look for this line:
$percentage = round($per, 0);

and replace it with this:
$percentage = abs(round($per, 0));

For adding the OFF expression, follow the same idea.

Then you will get this look:

Attachment ScreenShot2014-05-16at7.01.18PM.png not found



TESTED and CONFIRMED.


If you like CleanMart and satisfied with the support you have received, please "write a review" on:
www.flexiblewebdesign.com/Virtuemart-2-Templates/CleanMart

Write couple of sentences to share your experience with the support team.
Just 2-3 sentences would be enough ;) It might sound simple to you, but it is extremely important. Potential customers care about product reviews very much.

Thanks in advance!

Regards,
Support
The administrator has disabled public write access.
Time to create page: 0.270 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