Advertisement
verygoodplugins

Untitled

Aug 18th, 2020
1,400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. function my_variation_is_purchaseable( $is_purchaseable, $variation ) {
  2.  
  3.     if ( ! function_exists( 'wp_fusion' ) ) {
  4.         return $is_purchaseable;
  5.     }
  6.  
  7.     if ( wpf_user_can_access( $variation->get_id() ) ) {
  8.         return false;
  9.     }
  10.  
  11.     return $is_purchaseable;
  12.  
  13. }
  14.  
  15.  
  16. add_filter( 'woocommerce_variation_is_purchasable', 'my_variation_is_purchasable', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement