{ open = false }, 5000)" @update-working-state.window="is_working = $event.detail.is_working" @update-minicart-nonce.window="nonce = $event.detail.nonce" @update-minicart-qty-silent.window="qty = $event.detail.count" @update-minicart-details.window="
if (is_cart_page) return;
let cart_total = $event.detail.total;
let e=document.createElement('div');
let r=document.createRange();
r.selectNodeContents(e);
let f=r.createContextualFragment(cart_total);
e.appendChild(f);
e = e.firstElementChild;
$el.querySelector('.woocommerce-mini-cart__total .woocommerce-Price-amount.amount').replaceWith(e);
" @update-minicart-items-html.window="
if (is_cart_page) return;
let products_html = $event.detail.html;
let e=document.createElement('div');
let r=document.createRange();
r.selectNodeContents(e);
let f=r.createContextualFragment(products_html);
e.appendChild(f);
e.classList.add('woocommerce-mini-cart', 'cart_list', 'product_list_widget', 'space-y-4', 'pb-4');
$el.querySelector('.woocommerce-mini-cart.cart_list').replaceWith(e);
" @remove-minicart-item.window="
let is_gift = $event.detail.is_gift;
let can_undo_delete = !is_gift;
ajaxOptions.body = new URLSearchParams({
action: 'woo_amc_delete_item',
key: $event.detail.key,
name: $event.detail.name,
can_undo_delete: can_undo_delete,
security: nonce
});
fetchMiniCart( ajaxurl, ajaxOptions )
.catch((error) => {
let restore_unremovable = new CustomEvent('cart-item-' + $event.detail.key + '-unremove', {
bubbles: true,
cancelable: true
});
window.dispatchEvent(restore_unremovable);
});
" @undo-remove-minicart-item.window="
ajaxOptions.body = new URLSearchParams({
action: 'woo_amc_undo_delete_item',
key: $event.detail.key,
security: nonce
});
fetchMiniCart( ajaxurl, ajaxOptions )
.catch((error) => {
let restore_undo_remove = new CustomEvent('cart-item-' + $event.detail.key + '-undo-show', {
bubbles: true,
cancelable: true
});
window.dispatchEvent(restore_undo_remove);
});
" @update-minicart-item-qty.window="
ajaxOptions.body = new URLSearchParams({
action: 'woo_amc_quanity_update',
key: $event.detail.key,
security: nonce,
quantity: $event.detail.quantity
});
fetchMiniCart( ajaxurl, ajaxOptions )
.catch((error) => {
let restore_origin_qty = new CustomEvent('cart-item-' + $event.detail.key + '-restore-qty', {
bubbles: true,
cancelable: true
});
window.dispatchEvent(restore_origin_qty);
});
" @add-gift-product-to-cart.window="
ajaxOptions.body = new URLSearchParams({
action: 'woo_amc_add_gift_product_via_mini_cart',
fgf_gift_product: $event.detail.fgf_gift_product,
fgf_rule_id: $event.detail.fgf_rule_id,
security: nonce
});
fetchMiniCart( ajaxurl, ajaxOptions )
.catch((error) => {
console.log(error);
});
" @apply-coupon-code.window="
ajaxOptions.body = new URLSearchParams({
action: 'woo_amc_apply_coupon_code',
coupon_code: $event.detail.coupon_code,
security: nonce
});
fetchMiniCart( ajaxurl, ajaxOptions )
.catch((error) => {
});
" @remove-coupon-code.window="
ajaxOptions.body = new URLSearchParams({
action: 'woo_amc_remove_coupon_code',
coupon_code: $event.detail.coupon_code,
security: nonce
});
fetchMiniCart( ajaxurl, ajaxOptions )
.catch((error) => {
action_error_msg = error.toString().replace('Error: ', '');
action_error = true;
});
" @add-related-product-to-cart.window="
ajaxOptions.body = new URLSearchParams({
action: 'woo_amc_add_related_product',
product_id: $event.detail.pid,
security: nonce,
quantity: $event.detail.quantity
});
fetchMiniCart( ajaxurl, ajaxOptions )
.catch((error) => {
});
" @mouseenter="timeout && clearTimeout(timeout)" @click.away="open = false" x-on:keydown.escape="open = false" class="site-header-cart menu header-actions__link relative py-5">
Mini-cart