I'm trying to validate WooCommerce subscriptions and I need the userid to do it but it keeps returning 0 from $current_user->ID.
<?php
include('../wp-load.php');
$current_user = wp_get_current_user();
$SubCheck = WC_Subscriptions_Manager::user_has_subscription( $current_user->ID, 9, 'active' );
?>