Created
July 23, 2024 13:42
-
-
Save xlplugins/33158f8091c7bbf0a5d7272966f4a78c to your computer and use it in GitHub Desktop.
update side cart at page load #side cart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('fkcart_before_cart_items', 'custom_js_snippet'); | |
function custom_js_snippet() { | |
?> | |
<script> | |
jQuery(function($) { | |
$(window).on('load', function() { | |
$('body .cart-trigger').click(function() { | |
$('body').trigger('fkcart_open'); | |
}); | |
setTimeout(function() { | |
if (typeof jQuery === 'undefined') { | |
console.log('jQuery not found'); | |
return; | |
} | |
console.log("yesyys test") | |
$('body').trigger('fkcart_update_side_cart', [true]); | |
}, 300); | |
}); | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment