Title: wrong calculation
Last modified: October 25, 2016

---

# wrong calculation

 *  Resolved [tom.durcak](https://wordpress.org/support/users/freshmaker/)
 * (@freshmaker)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/wrong-calculation-2/)
 * I create a product as a gift card with amount 10€.
    My tax is set to 20%. When
   I bought this cart, the checkout shows me price: 10€ (includes 1.67€ tax). [http://iduri.php5.sk/ine/wp/gift-cards/001_buy-a-gift-card.png](http://iduri.php5.sk/ine/wp/gift-cards/001_buy-a-gift-card.png)
   Then, if I want to buy a product with same amount (10€), after using my gift 
   card the final price should be 0. But, it writes me I should pay another 1.67
   € (includes 0.28€ tax). [http://iduri.php5.sk/ine/wp/gift-cards/002_aply-a-gift-card.png](http://iduri.php5.sk/ine/wp/gift-cards/002_aply-a-gift-card.png)
   So I think your calculation works as a basic coupon, whitch is not good. Couse
   its discount price without tax.
    -  This topic was modified 9 years, 10 months ago by [tom.durcak](https://wordpress.org/support/users/freshmaker/).

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

 *  Thread Starter [tom.durcak](https://wordpress.org/support/users/freshmaker/)
 * (@freshmaker)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/wrong-calculation-2/#post-8354111)
 * in:
    yith-woocommerce-gift-cards/lib/class.yith-woocommerce-gift-cards.php line
   584 I changed this: `$amount = $order_item_data["line_total"];` with this: `$
   amount = $order_item_data["line_total"] + $order_item_data["line_tax"];` and 
   now it works for me
 *  Thread Starter [tom.durcak](https://wordpress.org/support/users/freshmaker/)
 * (@freshmaker)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/wrong-calculation-2/#post-8354280)
 * and it also has to be edited on line: 711
 *     ```
       				$value = $discount_amount + $discount_amount_tax;
       				$gift->deduct_amount_from_gift_card( $value );
       ```
   
 *  [gpriya9876](https://wordpress.org/support/users/gpriya9876/)
 * (@gpriya9876)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/wrong-calculation-2/#post-8391319)
 * When I add gift card in cart, on cart page the price is showing £0.00 for corresponding
   gift card. Can anyone please tell me, why the price is showing zero?
 *  [BrandDoctor](https://wordpress.org/support/users/bdmk/)
 * (@bdmk)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/wrong-calculation-2/#post-8470865)
 * Tom, I had exactly same problem – thanks for the solution!
 *  Plugin Author [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * (@yithemes)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/wrong-calculation-2/#post-8502608)
 * Hi [@freshmaker](https://wordpress.org/support/users/freshmaker/),
    thanks for
   your feedbacks and help.

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

The topic ‘wrong calculation’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-gift-cards/assets/icon-256x256.gif?rev=
   3227932)
 * [YITH WooCommerce Gift Cards](https://wordpress.org/plugins/yith-woocommerce-gift-cards/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-gift-cards/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-gift-cards/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-gift-cards/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-gift-cards/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-gift-cards/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/wrong-calculation-2/#post-8502608)
 * Status: resolved