fix: stopPropagation on floating button click to prevent Shoptimizer document handler closing cart
This commit is contained in:
@@ -45,6 +45,10 @@
|
|||||||
// --- Floating button click → open minicart -----------------------
|
// --- Floating button click → open minicart -----------------------
|
||||||
this.$btn.on( 'click', function ( e ) {
|
this.$btn.on( 'click', function ( e ) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
// Stop the click bubbling to document-level handlers.
|
||||||
|
// Shoptimizer closes the cart on any click outside .shoptimizer-cart,
|
||||||
|
// so without this the cart would open then instantly close again.
|
||||||
|
e.stopPropagation();
|
||||||
self.openMinicart();
|
self.openMinicart();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Plugin Name: CommerceKit Floating Cart
|
* Plugin Name: CommerceKit Floating Cart
|
||||||
* Plugin URI: https://www.commercegurus.com
|
* Plugin URI: https://www.commercegurus.com
|
||||||
* Description: Adds a floating cart icon (bottom-right) and auto-opens the CommerceKit minicart after add to cart. Requires CommerceGurus CommerceKit and WooCommerce.
|
* Description: Adds a floating cart icon (bottom-right) and auto-opens the CommerceKit minicart after add to cart. Requires CommerceGurus CommerceKit and WooCommerce.
|
||||||
* Version: 1.0.2
|
* Version: 1.0.3
|
||||||
* Author: CommerceGurus
|
* Author: CommerceGurus
|
||||||
* Author URI: https://www.commercegurus.com
|
* Author URI: https://www.commercegurus.com
|
||||||
* License: GPLv3
|
* License: GPLv3
|
||||||
@@ -19,7 +19,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
define( 'CGKIT_FC_VERSION', '1.0.2' );
|
define( 'CGKIT_FC_VERSION', '1.0.3' );
|
||||||
define( 'CGKIT_FC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
define( 'CGKIT_FC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
||||||
define( 'CGKIT_FC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
define( 'CGKIT_FC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user