PsychoZzzorD Posted June 21, 2016 Share Posted June 21, 2016 (edited) Hello guys,I got a page in my website were I call price of each product with this variable I created in FrontController : " public static function getProductPriceTI($id){ $product = new Product ($id,Context::getContext()->language->id); return $product->getPrice(); } (for Taxes included price) public static function getProductPriceTI($id){ $product = new Product ($id,Context::getContext()->language->id); return $product->getPrice(false); } (for Taxes excluded price) " I'd like to round the price with an INT, but I don't know where to put it Edited August 11, 2016 by PsychoZzzorD (see edit history) Link to comment Share on other sites More sharing options...
PsychoZzzorD Posted June 21, 2016 Author Share Posted June 21, 2016 (edited) Okay I got the answer x)When you call the function in your .tpl like that " {FrontController::getProductPriceTI(9)} " Just add "|intval" after the function like that " {FrontController::getProductPriceTI(9)|intval} "Edit : It's rounding down everything, bad method Edited June 21, 2016 by PsychoZzzorD (see edit history) Link to comment Share on other sites More sharing options...
PsychoZzzorD Posted June 21, 2016 Author Share Posted June 21, 2016 The solution is " |round " You can put in parameter the quantity of decimal you want like that " |round:2 " Link to comment Share on other sites More sharing options...
PsychoZzzorD Posted June 29, 2016 Author Share Posted June 29, 2016 I'd want to put this subject in Resolve pls, how can I ? Link to comment Share on other sites More sharing options...
rocky Posted June 30, 2016 Share Posted June 30, 2016 You can click "Mark Solved" on the post with the best answer, or you can edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now