• Resolved Simon Frntic

    (@sim33on)


    I use plugin and it works ok. Problem is that points are deducted form neto price (without tax) and the on deducted price is added tax. Because of this customer gets more discount than it should.
    How can I change settings so it deduct from bruto price (with tax)

    I hope you can help me soon, cause this issue is very important to us.
    Best regards

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author WP Swings

    (@wpswings)

    Hello ,

    Thank you for using our plugin,

    In reference to your query, we would like to inform you that the points discount works similarly to how the woocommerce fixed discount coupon works, so the tax calculation will be exactly the same as it works for the woocommerce coupon.

    Regards

    Thread Starter Simon Frntic

    (@sim33on)

    I see so discount is calculated before tax as in woocommerce coupons.
    Do you know how can I change this. I tried to google it but didn’t find solution yet.

    Other options is, plugin is set to rewarded points on whole sum. So is it possible to change rewarded points to price without tax?

    Regards

    Plugin Author WP Swings

    (@wpswings)

    Hello,

    Thank you for your response.

    I recommend adjusting your current tax settings to see if that helps you reach your desired outcome. Please explore the options available to you and see if they align with your needs

    Thread Starter Simon Frntic

    (@sim33on)

    Tax setting didn’t help. But I found this code which does this:

    /**
    * Apply coupon discount after tax calculation in WooCommerce.
    */
    add_filter(‘woocommerce_coupon_get_discount_amount’, ‘apply_coupon_after_tax’, 10, 5);

    function apply_coupon_after_tax($discount, $discounting_amount, $cart_item, $single, $coupon) {
    // Calculate the discount on the price after tax
    if ( $coupon->get_discount_type() == ‘percent’ ) {
    $discount = ($cart_item[‘line_total’] + $cart_item[‘line_tax’]) * ($coupon->get_amount() / 100);
    }
    elseif ( $coupon->get_discount_type() == ‘fixed_cart’ || $coupon->get_discount_type() == ‘fixed_product’ ) {
    // Ensure discount is applied to total price including tax
    $discount = min( $discounting_amount + $cart_item[‘line_tax’], $coupon->get_amount() );
    }
    return $discount;
    }

    But problem is that Point and rewards add discount on price before discount coupon is applied. So it can give you more discount points than you are entitled.

    Plugin Author WP Swings

    (@wpswings)

    Hello,

    We suggest you reach out to our support team for assistance with this suggestion by submitting a ticket through the following link

    Thank you

    Thread Starter Simon Frntic

    (@sim33on)

    Just for info, above code isn’t ok, because it add’s discount on every product, so don’t use it.

    Plugin Author WP Swings

    (@wpswings)

    Hello ,

    After reviewing it, we’d like to clarify that the points discount operates in a manner similar to the fixed coupon discount in WooCommerce. As such, any updates to this functionality will depend on changes made by WooCommerce to their coupon system.

    Regards

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