Support » Plugin: Discount Rules for WooCommerce » Get sales price for custom calculation

  • Resolved alexhoogeboom


    Hi support,

    I would like to get the product price on a random page to make some custom calculations.

    With every product I see the “from” and “for” price based on your plugin (10% extra discount on all products), but when I want to only display the “for” price I unfortunately get nothing back because the product is not a real “sale” product.

    Output now:
    <del><ins><span class="woocommerce-Price-currencySymbol">&euro;</span>54,50</ins></del> <ins><span class="woocommerce-Price-currencySymbol">&euro;</span>49,05</ins>

    I only want to echo the value: 49,05

    Is this possible?

Viewing 1 replies (of 1 total)
  • Plugin Author flycart



    You can get the Sale price of the product using something like this

    You can adopt the code.
    The following lined does the actual work.

    global $flycart_woo_discount_rules;
    $discounted_price = $flycart_woo_discount_rules->pricingRules->getDiscountPriceOfProduct($product);

    Alternatively, you can also call by instantiating the Pricing Rules class.

    Hope this helps


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