Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Created April 26, 2024 11:36
Show Gist options
  • Save xlplugins/3ec21e4a2ac290a486812a83fb74e352 to your computer and use it in GitHub Desktop.
Save xlplugins/3ec21e4a2ac290a486812a83fb74e352 to your computer and use it in GitHub Desktop.
Funnelkit Cart: Add or remove class when funnelkit cart open or closed
add_action('wp_footer',function (){
?>
<script>
window.addEventListener('load', function () {
jQuery(document.body).on('fkcart_cart_open',function(){
if(jQuery('body').hasClass('mm-wrapper--position-left')){
jQuery('body').removeClass('mm-wrapper--position-left')
}
});
jQuery(document.body).on('fkcart_cart_closed',function(){
if(!jQuery('body').hasClass('mm-wrapper--position-left')){
jQuery('body').addClass('mm-wrapper--position-left')
}
});
});
</script>
<?php
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment