правки test1

This commit is contained in:
2026-04-05 22:51:45 +03:00
parent f72b5b0a39
commit b82827f99a
3 changed files with 5 additions and 11 deletions

View File

@@ -22,6 +22,8 @@ const mobileToggle = document.getElementById('mobileToggle')
const orderSuccess = document.getElementById('orderSuccess')
const contactSuccess = document.getElementById('contactSuccess')
const wooCommerceConfig = window.test1WooCommerce || null
const cartPageUrl = (wooCommerceConfig && wooCommerceConfig.cartUrl) ? wooCommerceConfig.cartUrl : '/cart/'
const checkoutPageUrl = (wooCommerceConfig && wooCommerceConfig.checkoutUrl) ? wooCommerceConfig.checkoutUrl : '/checkout/'
const cartPanel = cartDrawer?.querySelector('.cart-panel')
const modalCard = modalBackdrop?.querySelector('.modal-card')
@@ -217,18 +219,10 @@ const mobileToggle = document.getElementById('mobileToggle')
})
cartCloseButton.addEventListener('click', closeCart)
viewCartButton.addEventListener('click', () => {
if (wooCommerceConfig && wooCommerceConfig.cartUrl) {
window.location.href = wooCommerceConfig.cartUrl
}
window.location.href = cartPageUrl
})
checkoutButton.addEventListener('click', () => {
if (wooCommerceConfig && wooCommerceConfig.checkoutUrl) {
window.location.href = wooCommerceConfig.checkoutUrl
return
}
closeCart()
openModal(checkoutButton)
window.location.href = checkoutPageUrl
})
orderButtons.forEach(button => {