Change The Color Of The Discount Item Price

Hello, We really need your help. We want to change the color of the item price to which the discount is worth. Tried to change in css styles, "ty-price", but it is applied and, for goods on which there is no discount. It is necessary that it was as in the screenshot. Please tell me how to implement it.

https://ibb.co/1Mmsk5K

Здравствуйте, нам очень нужна Ваша помощь. Мы хотим изменить цвет цены товара на, котором стоит скидка. Пробовали изменить в стилях css, "ty-price", но он применяется и, для товаров на, которых нету скидки. Нужно, чтоб было как на скриншоте. Подскажите пожалуйста, как это реализовать.

Unfortunately, discounted price does not have special CSS class. So it is required to change price template and add new class for such cases

Unfortunately, discounted price does not have special CSS class. So it is required to change price template and add new class for such cases

Thanks for the reply. Do not tell me how it will be better to implement. Can be added in this part of the code.

                                        
{assign var="old_price" value="old_price_`$obj_id`"} {if $smarty.capture.$old_price|trim}{$smarty.capture.$old_price nofilter}{/if}
                                        {assign var="price" value="price_`$obj_id`"}
                                        {$smarty.capture.$price nofilter}

                                        {assign var="clean_price" value="clean_price_`$obj_id`"}
                                        {$smarty.capture.$clean_price nofilter}

                                        {assign var="list_discount" value="list_discount_`$obj_id`"}
                                        {$smarty.capture.$list_discount nofilter}
                                    

Use the following condition in the class attribute

{if $product.discount || $product.list_discount}my-custom-class{/if}

Use the following condition in the class attribute

{if $product.discount || $product.list_discount}my-custom-class{/if}

Thank you very much, it worked, it works great.

You are welcome!