autoship_cart_has_valid_autoship_items()

(src/cart.php) function that checks the cart for items selected for Autoship, returns a boolean.

Example:

function detect_autoship_items(){
	return autoship_cart_has_valid_autoship_items() ? print_r("<h3>Autoship Items Detected</h3>") : print_r("<h3>No Autoship Items");
  }
  add_action( 'woocommerce_before_cart_contents', 'detect_autoship_items', 10, 1 );

Still need help? Contact Us Contact Us