• Resolved rasidrsd

    (@rasidrsd)


    Hey guys,

    how can I get the discount value of the order in my function.php?

    I want to use the value that is set by the admin in the order admin panel and then work with it in my functions.php.

    I would like to access it like:

    $order = new WC_Order($order_id);
    $discount=($order->DISCOUNTVALUE);
    
    //Then
    
    echo $discount;
    

    Can you help me on this issue?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Hermann LAHAMI

    (@mano88)

    Sorry we don’t keep track of that. We just apply the discount on the products directly or on the order as a negative fee. So i guess in this case, you’ll have to retrieve the original product prices and compare it to the prices used for the order items. Or if it’s a discount off order subtotal, just check all fees

    Thread Starter rasidrsd

    (@rasidrsd)

    So you dont know how the total cart discount value (image – 0,00€) is saved?
    Discount Image

    • This reply was modified 9 years, 1 month ago by rasidrsd.
    Plugin Author Hermann LAHAMI

    (@mano88)

    It’s saved as a negative fee. Check all the fees applied on the order and you should be able to find it.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Get discount value’ is closed to new replies.