L
L
ligisayan2020-12-15 18:11:29
PHP
ligisayan, 2020-12-15 18:11:29

How to isolate a number from the price and write it to a variable in the cs cart template?

Hello! There is an online store on CS cart ,

where using the record

{$product.price|format_price:$currencies.$secondary_currency  nofilter}


displaying the price in the template Now I need to pass the net price (only a number without a span, space and currency symbol) to a variable for processing in js , but, unfortunately, it is weak in this php syntax - please tell me how to do this?
<span>5&nbsp;838</span>&nbsp;грн.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
ligisayan, 2020-12-16
@ligisayan

Finally won!
Like this:

{assign var="my_price" value=fn_format_price_by_currency($product['base_price'], CART_PRIMARY_CURRENCY, 'UAH')}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question