Skip to content

Commit

Permalink
Merge pull request #234 from razorpay/1cc-optimize
Browse files Browse the repository at this point in the history
[SI-5356] Loading magic checkout related css and js only incase of 1cc activated
  • Loading branch information
ChetanGN authored Mar 14, 2022
2 parents ffac51d + 61087c6 commit 2e59a6d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -1784,8 +1784,6 @@ function enqueueScriptsFor1cc()
wp_enqueue_script('btn_1cc_checkout');
}

add_action('woocommerce_cart_updated', 'enqueueScriptsFor1cc', 10);

//To add 1CC button on cart page.
add_action( 'woocommerce_proceed_to_checkout', 'addCheckoutButton');

Expand Down Expand Up @@ -1894,7 +1892,7 @@ function disable_coupon_field_on_cart($enabled)

if(is1ccEnabled())
{
add_filter( 'woocommerce_coupons_enabled', 'disable_coupon_field_on_cart' );
add_filter('woocommerce_coupons_enabled', 'disable_coupon_field_on_cart');
add_action('woocommerce_cart_updated', 'enqueueScriptsFor1cc', 10);
add_filter('woocommerce_order_needs_shipping_address', '__return_true');
}

add_filter('woocommerce_order_needs_shipping_address', '__return_true');

0 comments on commit 2e59a6d

Please sign in to comment.