How to extend woocommerce api to show bookable pro

2019-08-28 07:22发布

I've made a custom plugin with a custom api end point.

I would like to access my bookable products availability times so I can use the api with a react front end.

So far I have this function that my custom endpoint is attached to:

function get_data() {

               $args = array( 'limit' => 1, 'type' => 'booking',  );

               $products = wc_get_products( $args );


               return $products;
           }

When I call my end point in postman all I get is this:

enter image description here

Why is the array for availability_rules empty and why is there no other details about my bookable product being returned by the woocommerce wc_get_product() function, how can I fix this?

0条回答
登录 后发表回答