fix: correct minicart trigger selector to .shoptimizer-cart .cart-contents

This commit is contained in:
2026-03-05 08:14:08 +01:00
parent 022d782ec7
commit 2b565758f5
2 changed files with 8 additions and 10 deletions

View File

@@ -95,13 +95,11 @@
}
// --- 2. Shoptimizer direct panel toggle --------------------------
// Shoptimizer opens its cart panel by adding the 'active' class to
// .site-header-cart and showing the child .widget_shopping_cart.
// Try that directly if we couldn't find the button.
var $panel = $( '.site-header-cart' );
if ( $panel.length ) {
$panel.toggleClass( 'active' );
$panel.find( '.widget_shopping_cart' ).toggleClass( 'cart-open' );
// Shoptimizer's cart anchor is a.cart-contents inside .shoptimizer-cart.
// If the selector loop above somehow missed it, grab it directly.
var $directBtn = $( '.shoptimizer-cart a.cart-contents' );
if ( $directBtn.length ) {
$directBtn[ 0 ].click();
return;
}