Magento Forum

   
getting the price of a product without the currency symbol using PHP
 
nikkstocks
Member
 
Total Posts:  47
Joined:  2008-06-08
 

hi, anyone know what method give the price of a product? i know getPriceHtml(...) will give “£xx.yy”, but can i get just the integer / long value - ie “xx.yy”. I want to make a php statement requiring the price to be > 0…

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikkstocks
Member
 
Total Posts:  47
Joined:  2008-06-08
 

bump, anyone know? I really want to be able to hide prices that equal £0 to clearly separate quote requests from purchases. just noticed i didnt say in the original post - its the PHP method I’m after

 
Magento Community Magento Community
Magento Community
Magento Community
 
kelvin
Jr. Member
 
Total Posts:  15
Joined:  2008-06-11
 

Is this what you’re after?

$_product->getPrice();

You’ll probably need to do a number_format on it to get rid of the trailing zeros.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top