Last active
October 24, 2025 08:07
-
-
Save xlplugins/91caef1f86628d42f811d56802e90558 to your computer and use it in GitHub Desktop.
Funnelkit Cart: Slide Cart Trigger when add to cart clicked
This file contains hidden or 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( 'wp_footer', function () { | |
| ?> | |
| <script> | |
| (function () { | |
| window.addEventListener('load', function () { | |
| (function ($) { | |
| $(document.body).on('added_to_cart', function (e, v) { | |
| jQuery('body').trigger('fkcart_open'); | |
| }); | |
| $(document).ajaxComplete(function (event, jqxhr, settings) { | |
| if (settings.url.indexOf("wc-ajax=fkcart_add_item") > -1) { | |
| jQuery('body').trigger('fkcart_open'); | |
| } | |
| }); | |
| })(jQuery) | |
| }) | |
| })(); | |
| </script> | |
| <?php | |
| }, 999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment