No OC version posted and incomplete code statement since the $price variable has not been indicated where it originates from due to variable replacement.
However,
Code: Select all
<div class="price2" style="font-size:17px;"><br>
{% if number %}
{{ number }}
{% endif %}
Then, in your catalog/controller/product/product.php file, in the index() method, you could add below $price variable IF condition:
Code: Select all
$data['number'] = $this->currency->format($price, $this->config->get('config_currency'), false, false);
instead of:
Code: Select all
$number = preg_replace("/[^0-9\.]/", '', $price);
Then,
Code: Select all
{% set total = number * 1.2 %}
List price: {{ total|number_format(2, '.', '') }}</div>
<h2>Your price: {{ price }}</h2>