правки test1
This commit is contained in:
BIN
2026-04-05_22-37-48.png
Normal file
BIN
2026-04-05_22-37-48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 473 KiB |
14
index3.js
14
index3.js
@@ -22,6 +22,8 @@ const mobileToggle = document.getElementById('mobileToggle')
|
|||||||
const orderSuccess = document.getElementById('orderSuccess')
|
const orderSuccess = document.getElementById('orderSuccess')
|
||||||
const contactSuccess = document.getElementById('contactSuccess')
|
const contactSuccess = document.getElementById('contactSuccess')
|
||||||
const wooCommerceConfig = window.test1WooCommerce || null
|
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 cartPanel = cartDrawer?.querySelector('.cart-panel')
|
||||||
const modalCard = modalBackdrop?.querySelector('.modal-card')
|
const modalCard = modalBackdrop?.querySelector('.modal-card')
|
||||||
|
|
||||||
@@ -217,18 +219,10 @@ const mobileToggle = document.getElementById('mobileToggle')
|
|||||||
})
|
})
|
||||||
cartCloseButton.addEventListener('click', closeCart)
|
cartCloseButton.addEventListener('click', closeCart)
|
||||||
viewCartButton.addEventListener('click', () => {
|
viewCartButton.addEventListener('click', () => {
|
||||||
if (wooCommerceConfig && wooCommerceConfig.cartUrl) {
|
window.location.href = cartPageUrl
|
||||||
window.location.href = wooCommerceConfig.cartUrl
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
checkoutButton.addEventListener('click', () => {
|
checkoutButton.addEventListener('click', () => {
|
||||||
if (wooCommerceConfig && wooCommerceConfig.checkoutUrl) {
|
window.location.href = checkoutPageUrl
|
||||||
window.location.href = wooCommerceConfig.checkoutUrl
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
closeCart()
|
|
||||||
openModal(checkoutButton)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
orderButtons.forEach(button => {
|
orderButtons.forEach(button => {
|
||||||
|
|||||||
@@ -438,7 +438,7 @@ function twentytwentyfour_test1_assets() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_page( 'test1' ) && file_exists( $js_file ) ) {
|
if ( ( is_front_page() || is_page( 'test1' ) ) && file_exists( $js_file ) ) {
|
||||||
wp_enqueue_script(
|
wp_enqueue_script(
|
||||||
'twentytwentyfour-test1-script',
|
'twentytwentyfour-test1-script',
|
||||||
home_url( '/index3.js' ),
|
home_url( '/index3.js' ),
|
||||||
|
|||||||
Reference in New Issue
Block a user