Support

Account

Forum Replies Created

  • Hello John, was there any more resolution on this?

    I am having the same issue. When I run this code from inside a woocommerce hook it does not work, but when I run the same exact code from inside a function on another page that is not run from inside a woocommerce hook it works fine. The last line of code is not updating that particular meta field that I added with ACF. But again the same exact code is working when run outside of a woocommerce hook. Do you have any guidance on this?

    $user_id = get_current_user_id();
    $user_pickup_location_key = ‘default_pickup_location’;
    $subscription_pickup_location_key = ‘subscription_pickup_location’;
    $user_default_pickup_location = get_field($user_pickup_location_key, “user_{$user_id}”);

    update_field($subscription_pickup_location_key, $user_default_pickup_location, 6369);

    Thank you for your time,
    Josh

Viewing 1 post (of 1 total)