• Resolved ghros

    (@ghros)


    Hey,
    I’m trying to add custom fields (registered by woocommerce_default_address_fields filter) to WC REST API orders. I tried lots of hooks and actions but never worked. The problem is when an order created by API, it fires set_order_addresses method in includes/legacy/api/v2/class-wc-api-orders.php to set order’s billing/shipping addresses but there is no way to manipulate this function. It’s required to extend WC_Order class to write extra functions like get_shipping_latitude, get_shipping_longitude. Is there any other way to register custom address fields to REST API? Thanks in advance.

    • This topic was modified 3 years, 5 months ago by ghros.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding custom address fields to WC REST API’ is closed to new replies.