From a50c908cf11ff6be1f0f5ef067f05d98d5a551e5 Mon Sep 17 00:00:00 2001 From: maksim Date: Wed, 11 Jun 2025 10:30:42 +0300 Subject: [PATCH] =?UTF-8?q?Fix=20|=20=D1=85=D0=B0=D1=80=D0=BA=D0=BE=D0=B4?= =?UTF-8?q?=20=D1=80=D1=83=D0=B1=D0=BB=D1=8F=20=D0=B2=20=D0=BE=D0=B1=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20=D1=86=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B2=20=D0=BA=D0=BE=D1=80=D0=B7=D0=B8=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/shop/components/cart/assets/js/cart.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 был корректен в следующий раз)