SHARE
TWEET

Lottery remove add to cart check

wpgenie May 25th, 2020 (edited) 832 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  
  3. Removes add to cart check and basically allows guest user to add tickets to cart.
  4.  
  5. Code should go to your_child_theme_folder/functions.php or in custom plugin.
  6.  
  7. */
  8. add_action( 'woocommerce_init', 'custom_remove_lottery_check',90);
  9.  
  10. function custom_remove_lottery_check(){
  11.     global $wc_lottery;
  12.     remove_action( 'woocommerce_add_to_cart_validation',  array( $wc_lottery->plugin_public , 'add_to_cart_validation' ), 10 );
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top