diff --git a/Includes/Modules/FlyCart/Includes/EnqueueScript.php b/Includes/Modules/FlyCart/Includes/EnqueueScript.php index 099d9da9..fc3284cd 100644 --- a/Includes/Modules/FlyCart/Includes/EnqueueScript.php +++ b/Includes/Modules/FlyCart/Includes/EnqueueScript.php @@ -189,6 +189,7 @@ private function frontend_widget_script() { 'checkoutRedirect' => $is_checkout_redirect, 'quickCartRedirect' => $is_add_to_qcart_redirect, 'cartLayoutType' => $cart_layout_type, + 'checkoutUrl' => wc_get_checkout_url(), 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'sgsb_frontend_ajax' ), 'isPro' => is_plugin_active( 'storegrowth-sales-booster-pro/storegrowth-sales-booster-pro.php' ), diff --git a/Includes/Modules/FlyCart/assets/js/wfc-script.js b/Includes/Modules/FlyCart/assets/js/wfc-script.js index 2f97ae93..340d5a3e 100644 --- a/Includes/Modules/FlyCart/assets/js/wfc-script.js +++ b/Includes/Modules/FlyCart/assets/js/wfc-script.js @@ -181,7 +181,7 @@ jQuery(".wfc-overlay").removeClass("wfc-hide"); jQuery(".wfc-widget-sidebar").removeClass("wfc-slide"); setDynamicHeight(); - getCartContents(); + openCheckoutPageCallback(sgsbFrontend?.checkoutUrl); }, error: (error) => console.log(error), }); @@ -218,12 +218,16 @@ var quantityInput = $(this).siblings(".quantity").find(".qty"); var maxValue = quantityInput.attr("max"); var currentValue = parseInt(quantityInput.val()); - - if (!isNaN(currentValue) && !isNaN(maxValue) && currentValue >= maxValue) { + + if ( + !isNaN(currentValue) && + !isNaN(maxValue) && + currentValue >= maxValue + ) { showNotification("Stock limit reached"); return; // Stop further execution if the limit is reached } - + updateProductQuantity.bind(this, "plus").call(); } );