cilecek Posted February 16, 2017 Share Posted February 16, 2017 hello, need little help to modify tools.php for setting price rounding of specific currency. what must be instead of CURRENCY_ID? if ( CURRENCY_ID == 5) { switch (Tools::$round_mode) { case PS_ROUND_UP: return Tools::ceilf($value, $precision); case PS_ROUND_DOWN: return Tools::floorf($value, $precision); case PS_ROUND_HALF_DOWN: case PS_ROUND_HALF_EVEN: case PS_ROUND_HALF_ODD: return Tools::math_round($value, $precision, Tools::$round_mode); case PS_ROUND_HALF_UP: default: return Tools::math_round($value, 0, PS_ROUND_HALF_UP); } } Link to comment Share on other sites More sharing options...
joseantgv Posted February 16, 2017 Share Posted February 16, 2017 hello, need little help to modify tools.php for setting price rounding of specific currency. what must be instead of CURRENCY_ID? if ( CURRENCY_ID == 5) { switch (Tools::$round_mode) { case PS_ROUND_UP: return Tools::ceilf($value, $precision); case PS_ROUND_DOWN: return Tools::floorf($value, $precision); case PS_ROUND_HALF_DOWN: case PS_ROUND_HALF_EVEN: case PS_ROUND_HALF_ODD: return Tools::math_round($value, $precision, Tools::$round_mode); case PS_ROUND_HALF_UP: default: return Tools::math_round($value, 0, PS_ROUND_HALF_UP); } } Try with "$this->context->cart->id_currency" Link to comment Share on other sites More sharing options...
cilecek Posted February 17, 2017 Author Share Posted February 17, 2017 doesnt work, everything starting with $this-> ends in error500 on frontoffice Link to comment Share on other sites More sharing options...
cilecek Posted February 17, 2017 Author Share Posted February 17, 2017 (edited) SOLVED, working with if ( (int)Context::getContext()->currency->id == 5 ) Edited February 17, 2017 by cilecek (see edit history) 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