Answer the question
In order to leave comments, you need to log in
How to correct string in foreach variable and divide it by number?
There will be a denomination in Belarus soon and many customers ask to add another price, next to the main one. Due to some circumstances, there is no access to the source codes, there is only a template file, where the actual price is displayed. Bypassing the array of goods, we have the variable $module_data , we need to take the price from it ( $module_data.PRODUCTS_PRICE comes out ), remove the points and divide by 10000 - I tried 3 different ways, but nothing happened:
{($module_data.PRODUCTS_PRICE|replace:'.':'') / 10000}
{php} echo intVal(str_replace(".", "", $this->get_template_vars('module_data.PRODUCTS_PRICE'))) / 10000; {/php}
{math equation="x / y" x=$module_data.PRODUCTS_PRICE|replace:'.':'' y=10000}
Answer the question
In order to leave comments, you need to log in
you need to make an array in the controller, place a variable with the price there and call and divide this array inside the cycle
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question