plugin development - How to extend WooCommerce API to show bookable product availability rules?

admin2025-06-03  4

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 are there no other details about my bookable product being returned by the WooCommerce wc_get_product() function?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748905735a314698.html

最新回复(0)