Created
January 27, 2012 02:22
-
-
Save clarklab/1686586 to your computer and use it in GitHub Desktop.
PHP/WordPress find discount
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$deal_price = get_post_meta($post->ID, 'deal_price', true); | |
$old_price = get_post_meta($post->ID, 'old_price', true); | |
$discount = round(((1-($deal_price / $old_price))*100),0); | |
echo $discount.'%'; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment