Im trying to show the value of a product field created with AFC I can see the full product object and the value is displayed correctly. Foolowing the doc I should use
$value = get_field( "geolocation" );
or
$value = get_fields( "geolocation" );
But value is always empty I have also tried to pass the product id and the item id like
$value = get_field( "geolocation", $item->get_id() );
I have printed the full object, below is the relevant part
{
"id":176,
"key":"geolocation",
"value":{
"address":"Test address",
"lat":"20.5271494",
"lng":"-1.6597097999999733"
}
}
What im trying to print is the address, lat and lng