| @@ -13,8 +13,9 @@ | ||
| 13 | 13 | use ShopEngine\Libs\License\License_Route; |
| 14 | 14 | use ShopEngine\Libs\Rating\Rating; |
| 15 | 15 | use ShopEngine\Libs\Updater\Init as Updater; |
| 16 | 16 | use ShopEngine\Modules\Manifest as Module_Manifest; |
| 17 | +use ShopEngine\Utils\Feedback\Plugin_Unsubscribe; | |
| 17 | 18 | use ShopEngine\Widgets\Manifest; |
| 18 | 19 | |
| 19 | 20 | |
| 20 | 21 | /** |
| @@ -84,8 +85,10 @@ | ||
| 84 | 85 | |
| 85 | 86 | if($error) { |
| 86 | 87 | return; |
| 87 | 88 | } |
| 89 | + | |
| 90 | + | |
| 88 | 91 | |
| 89 | 92 | add_filter("plugin_action_links_shopengine/shopengine.php", function ($links) { |
| 90 | 93 | $free = esc_html__("Go To Shopengine","shopengine"); |
| 91 | 94 | $pro = esc_html__("Go To ShopenginePro","shopengine"); |
| @@ -128,9 +131,11 @@ | ||
| 128 | 131 | * Routes initialization |
| 129 | 132 | * |
| 130 | 133 | */ |
| 131 | 134 | new License_Route(); |
| 132 | - | |
| 135 | + | |
| 136 | + // Initialize deactivation feedback modal | |
| 137 | + new \ShopEngine\Utils\Feedback\Plugin_Unsubscribe(); | |
| 133 | 138 | /** |
| 134 | 139 | * Run pro plugin updater here.... |
| 135 | 140 | * |
| 136 | 141 | */ |
| @@ -177,9 +182,16 @@ | ||
| 177 | 182 | } |
| 178 | 183 | |
| 179 | 184 | } |
| 180 | 185 | |
| 186 | + // Cart validation compatibility with WC Min Max Quantity plugin | |
| 181 | 187 | |
| 188 | + if ( function_exists( 'is_plugin_active' ) && is_plugin_active( 'woo-min-max-quantity-step-control-single/wcmmq.php' ) ) { | |
| 189 | + | |
| 190 | + add_filter( 'wcmmq_cart_validation_check', [ $this, 'shopengine_wcmmq_cart_validation_compat' ], 10, 2 ); | |
| 191 | + } | |
| 192 | + | |
| 193 | + | |
| 182 | 194 | //Loading public scripts and styles |
| 183 | 195 | add_action('wp_enqueue_scripts', [$this, 'js_css_public']); |
| 184 | 196 | |
| 185 | 197 | //woocommece theme support |
| @@ -364,8 +376,26 @@ | ||
| 364 | 376 | |
| 365 | 377 | //it will register an option in customizer for woocommerce products catelog. It's related with our Arcive Products widget. |
| 366 | 378 | Register_Settings::instance()->init(); |
| 367 | 379 | } |
| 380 | + | |
| 381 | + public function shopengine_wcmmq_cart_validation_compat( $check, $request ) { | |
| 382 | + | |
| 383 | + $cart_widget_flag = isset( $_REQUEST['shopengine_cart_widget'] ) | |
| 384 | + ? sanitize_text_field( wp_unslash( $_REQUEST['shopengine_cart_widget'] ) ) | |
| 385 | + : ''; | |
| 386 | + $cart_widget_nonce = isset( $_REQUEST['shopengine_cart_widget_nonce'] ) | |
| 387 | + ? sanitize_text_field( wp_unslash( $_REQUEST['shopengine_cart_widget_nonce'] ) ) | |
| 388 | + : ''; | |
| 389 | + | |
| 390 | + if ( $cart_widget_flag === '1' && wp_verify_nonce( $cart_widget_nonce, 'shopengine_cart_widget' ) ) { | |
| 391 | + return false; // Skip WC MMQ validation for verified ShopEngine cart widget requests | |
| 392 | + } | |
| 393 | + return $check; // Proceed with normal validation for other requests | |
| 394 | + } | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 368 | 398 | |
| 369 | 399 | |
| 370 | 400 | // add async and defer attributes to enqueued scripts |
| 371 | 401 | public function filter_load_type($tag, $handle, $src) { |