diff --git a/includes/api/cart.php b/includes/api/cart.php index 9fbaf664..3e54e54d 100644 --- a/includes/api/cart.php +++ b/includes/api/cart.php @@ -252,6 +252,20 @@ function cartResponse($couponCode){ $response['config'] = $razorpay->getDisplayConfig(); + // Every hour post installation check + $getPostInstallationFlag = get_option('rzp_post_installation_update_at'); + if (empty($getPostInstallationFlag) == false) + { + if ($getPostInstallationFlag + 3600 < time()) + { + $razorpay->autoPostInstallationCheck(); + } + } + else + { + $razorpay->autoPostInstallationCheck(); + } + $response['enable_ga_analytics'] = get_option('woocommerce_razorpay_settings')['enable_1cc_ga_analytics'] === 'yes' ? true : false; $response['enable_fb_analytics'] = get_option('woocommerce_razorpay_settings')['enable_1cc_fb_analytics'] === 'yes' ? true : false; diff --git a/woo-razorpay.php b/woo-razorpay.php index 2ca59c76..684cfadc 100644 --- a/woo-razorpay.php +++ b/woo-razorpay.php @@ -466,7 +466,8 @@ public function __construct($hooks = true) (isset($_GET['tab']) === true) && ($_GET['tab'] === 'checkout') && (isset($_GET['section']) === true) && - ($_GET['section'] === 'razorpay')) + ($_GET['section'] === 'razorpay') && + ($checkout360Available !== 'yes')) { if (!empty($this->getSetting('key_id')) && !empty($this->getSetting('key_secret'))) { @@ -485,6 +486,16 @@ public function __construct($hooks = true) if (!empty($merchantPreferences['features']['one_click_checkout'])) { $is1ccAvailable = true; } + else + { + $optionKey = parent::get_option_key(); + $razorpay_settings = get_option($optionKey); + + $razorpay_settings['enable_1cc'] = 'no'; + $razorpay_settings['enable_1cc_mini_cart_checkout'] = 'no'; + $razorpay_settings['enable_1cc_pdp_checkout'] = 'no'; + update_option($optionKey, apply_filters('woocommerce_settings_api_sanitized_fields_' . $this->id, $razorpay_settings), 'yes'); + } if (!empty($merchantPreferences['features']['one_cc_store_account'])) { $isAccCreationAvailable = true; @@ -1072,7 +1083,7 @@ public function newTrackPluginInstrumentation($key, $secret) public function enqueue_checkout_js_script_on_checkout() { - if (is_checkout()) + if (is_checkout()) { wp_enqueue_script( 'razorpay-checkout-js', @@ -1385,21 +1396,6 @@ public function createOrGetRazorpayOrderId($order, $orderId, $is1ccCheckout = 'n { try { - // Every hour post installation check - $getPostInstallationFlag = get_option('rzp_post_installation_update_at'); - if (empty($getPostInstallationFlag) == false) - { - if ($getPostInstallationFlag + 3600 < time()) - { - $this->autoPostInstallationCheck(); - } - } - else - { - update_option('rzp_post_installation_update_at', $time); - $this->autoPostInstallationCheck(); - } - return $this->createRazorpayOrderId($orderId, $sessionKey); } // For the bad request errors, it's safe to show the message to the customer.