feat: refine price formatting and enable dynamic color updates in cart
All checks were successful
Build and Push Docker Image / build (push) Successful in 25s

- Updated price slider and backend formatting to round values instead of showing decimals
- Enhanced product detail page with active color selection display and automatic cart updates
- Adjusted swatch behavior to dynamically update the selected color in the cart via AJAX
- Improved consistency in slider steps and price formatting throughout templates and views
This commit is contained in:
2026-05-26 12:18:53 +02:00
parent bc14f3d429
commit d4fa91ac7f
4 changed files with 37 additions and 9 deletions

View File

@@ -1,11 +1,11 @@
document.addEventListener('DOMContentLoaded', function () {
const priceFormatter = new Intl.NumberFormat('ru-RU', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
minimumFractionDigits: 0,
maximumFractionDigits: 0,
});
const formatQueryValue = function (value) {
return value.toFixed(2).replace(/\.?0+$/, '');
return Math.round(value).toString();
};
document.querySelectorAll('[data-price-slider]').forEach(function (slider) {