问题
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