Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   Display Price as a Percentage? (/showthread.php?t=7794)

owncoop September 29th, 2012 12:07 PM

Display Price as a Percentage?
 
Hi,

Is it possible to modify my site so that the price I enter for custom products displays as a percentage?

Thanks,

Ron


Store ID:
Website URL: consumer.coop
URL to page in question:

Eric September 29th, 2012 12:52 PM

I guess you could add the price in the format of 0.25 and when you display it on your site, you could have 0.25%.

In your views you could have:

PHP Code:

<?php
if ($product->price 1) {
echo 
"$".$product->price
} else {
echo 
$product->price."%"
}
?>


owncoop September 29th, 2012 01:04 PM

Hi,

Thanks for the reply. I am experimenting and trying to find a way to display the price without the forced "0." beginning the number, or the ".00" ending the number.

Ideally what I want is the price to appear as "25%".

Any additional advice would be greatly appreciated.

Cheers,

Ron

Eric September 29th, 2012 01:08 PM

If price is 0.25, then use this:
PHP Code:

<?php echo ($product->price*100)."%"?>



All times are GMT -5. The time now is 01:04 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.