• Resolved polys_a

    (@polys_a)


    Hello

    We are custom developing a woo site and we are using the following snippet to get the discount applied from your plugin

    //Get Discount price from Woo Discount Plugin
    $discount = apply_filters(‘advanced_woo_discount_rules_get_product_discount_price_from_custom_price’, $product->get_price(), $product, 1, $sale_price, ‘discounted_price’, true, true);
    if($discount !== false){
    $sale_price = $discount;
    }

    We need to have decimal when the price is un integer.

    From: €20
    To: €20.00

    Is there any way to do it?

Viewing 1 replies (of 1 total)
  • Hi,
    Thank you for reaching out.

    You can format price by using wc_price() or number_format()function.

    Something like this:
    wc_price(20) => $20.00
    number_format(20, 2, ‘.’, ”) => 20.00

    Hope this meets your requirement.

    Thanks
    Team Flycart

Viewing 1 replies (of 1 total)

The topic ‘Get sale price’ is closed to new replies.