diff --git a/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js b/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js index 5a401c2..22571c1 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js +++ b/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js @@ -25,9 +25,13 @@ $(document).on('change', '.counter__input', function () { const unitPrice = currentTotal / oldQuantity; const newTotal = unitPrice * quantity; - // Обновить цену + // Получаем текущий символ валюты из разметки + const currencySymbol = $priceElement.find('.woocommerce-Price-currencySymbol').text().trim(); + + // Формируем новую цену с тем же символом $priceElement.find('bdi').html( - newTotal.toLocaleString('ru-RU', { minimumFractionDigits: 0 }) + ' ' + newTotal.toLocaleString('ru-RU', { minimumFractionDigits: 0 }) + + ' ' + currencySymbol + '' ); // Обновить значение по умолчанию (чтобы расчёт unitPrice был корректен в следующий раз)