• Resolved Bob

    (@shallway)


    Looking to load related products asynchronously, can I use [wt-related-products] in a custom REST API end point?

    Something like:

    register_rest_route( ‘nthapi/v1’, ‘/related_products/(?P\d+)’, [
    ‘methods’ => ‘GET’,
    ‘callback’ => function ($request) {
    echo do_shortcode(‘[wt-related-products id=xxx]’);
    },

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘load related products with rest api call’ is closed to new replies.