How to extend woocommerce api to show bookable product availability rules?

半腔热情 提交于 2019-12-24 19:49:53

问题


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:

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?

来源:https://stackoverflow.com/questions/54673763/how-to-extend-woocommerce-api-to-show-bookable-product-availability-rules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!