Support

Account

Forum Replies Created

  • add to functions.php , I managed to achieve fields from ACF in the response

    add_filter('woocommerce_rest_prepare_product_object', 'include_acf_fields_in_api_response', 10, 3);
    
    function include_acf_fields_in_api_response($response, $post, $request) {
        $data = $response->get_data();
    	$acf_fields = get_fields($response->data['id']);
        $data['acf'] = $acf_fields;
        $response->set_data($data);
        return $response;
    }
Viewing 1 post (of 1 total)