• Please let me know why this plugin is not working with wp rest custom routes,
    here is a simple example:

    register_rest_route('my_plguin/v1/, '/products/check_sale', [
    'methods' => 'GET',
    'callback' => function() {
    $product_id = 139843;
    $product = wc_get_product($product_id);
    $sale_price = $product->get_sale_price();
    return rest_ensure_response(['sale_price' => $sale_price]);
    },
    'permission_callback' => '__return_true',
    ]);


    it returns regular price event if there is a configured one discount for this product
    any ideas for this issue?

Viewing 1 replies (of 1 total)
  • Plugin Author Donald FALY

    (@donaldlaly)

    Hello @zielsko ,

    The discounts are configured to be applied either in the cart or directly on the product pages. What type of discount have you configured?

    Could you provide more details about what you are trying to achieve?

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.