I am newbie at PHP.
I am trying to check if the user has a payment token or some other value that confirms they have made a payment.
I want to redirect the page if the payment status is empty 9they have not made payment yet).
I tried :
<?php
if(get_post_type()=="sfwd-lessons"){
$lesson_id=get_the_ID();
}else{
$lesson_id=get_post_meta(get_the_ID(),'lesson_id',true);
}
$value = get_field( "new_field", $lesson_id );
$user_status=get_wpmg_woocommerce_payment_tokens($user_id,'token_id',true);
//$user_status='';
if(!empty($value) && empty($user_status)){
header('Location: https://xx/checkouts/checkout-page/');
exit;
?>
but I dot think "get_wpmg_woocommerce_payment_tokens" is a valid call
is there another get_ call I can make to check if payment token_id is empty for that user?
or is there a way on the woo commerce thank you page to write new field "payment_status" complete to user_meta_data
thanks