[Skip to main content](#vessel-content)

#   order discount tax

##

- **[pablop76](/forum/user/59854-pablop76 "View pablop76's Profile")**
- [![pablop76's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/59854-pablop76 "View pablop76's Profile") Topic Author
- [ Offline](/forum/user/59854-pablop76)

Less More

- Posts: 5
- Thank you received: 1
-
-

1 year 6 days ago [\#369165](#369165) by [pablop76](/forum/user/59854-pablop76 "View pablop76's Profile")  *[order discount tax](/forum/46-discount-coupon/909847-order-discount-tax#369165 "-- HikaShop version -- : HikaShop Starter: 6.1.0 -- Joomla version -- : 5.4.0 -- PHP version -- : 8.3 -- Browser(s) name and version -- : chrome -- Error-message(debug-mod must be tuned on) -- : &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,  Regardless of the VAT rate set for the coupon, I always see 0.00000 in the logs. &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,")* was created by *[pablop76](/forum/user/59854-pablop76 "View pablop76's Profile")*

-- HikaShop version -- : HikaShop Starter: 6.1.0
-- Joomla version -- : 5.4.0
-- PHP version -- : 8.3
-- Browser(s) name and version -- : chrome
-- Error-message(debug-mod must be tuned on) -- : "order_discount_tax": "0.00000",

Regardless of the VAT rate set for the coupon, I always see 0.00000 in the logs.
"order_discount_tax": "0.00000",

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDk4NDctb3JkZXItZGlzY291bnQtdGF4P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

1 year 5 days ago [\#369166](#369166) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[order discount tax](/forum/46-discount-coupon/909847-order-discount-tax#369166 "-- HikaShop version -- : HikaShop Starter: 6.1.0 -- Joomla version -- : 5.4.0 -- PHP version -- : 8.3 -- Browser(s) name and version -- : chrome -- Error-message(debug-mod must be tuned on) -- : &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,  Regardless of the VAT rate set for the coupon, I always see 0.00000 in the logs. &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,")*

Hi,

What logs are you referring to ? Do you see the correct value in the order_discount_tax column of the hikashop_order table in your database ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDk4NDctb3JkZXItZGlzY291bnQtdGF4P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[pablop76](/forum/user/59854-pablop76 "View pablop76's Profile")**
- [![pablop76's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/59854-pablop76 "View pablop76's Profile") Topic Author
- [ Offline](/forum/user/59854-pablop76)

Less More

- Posts: 5
- Thank you received: 1
-
-

1 year 5 days ago -  1 year 5 days ago [\#369172](#369172) by [pablop76](/forum/user/59854-pablop76 "View pablop76's Profile")  Replied by *[pablop76](/forum/user/59854-pablop76 "View pablop76's Profile")* on topic *[order discount tax](/forum/46-discount-coupon/909847-order-discount-tax#369172 "-- HikaShop version -- : HikaShop Starter: 6.1.0 -- Joomla version -- : 5.4.0 -- PHP version -- : 8.3 -- Browser(s) name and version -- : chrome -- Error-message(debug-mod must be tuned on) -- : &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,  Regardless of the VAT rate set for the coupon, I always see 0.00000 in the logs. &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,")*

I'm creating an integration with an external service and saving all order data to a file to check the values. The default tax category is 23. I'm adding a coupon with a fixed value of 10 and setting the Automatic Taxes to NO and the Tax Category to Default Tax Category. In the order data, my coupon has a value of 10, but the VAT rate is 0. The order_discount_tax in the Hikashop table is also 0.

Last edit: 1 year 5 days ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDk4NDctb3JkZXItZGlzY291bnQtdGF4P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

1 year 5 days ago [\#369173](#369173) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[order discount tax](/forum/46-discount-coupon/909847-order-discount-tax#369173 "-- HikaShop version -- : HikaShop Starter: 6.1.0 -- Joomla version -- : 5.4.0 -- PHP version -- : 8.3 -- Browser(s) name and version -- : chrome -- Error-message(debug-mod must be tuned on) -- : &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,  Regardless of the VAT rate set for the coupon, I always see 0.00000 in the logs. &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,")*

Hi,

Well, if the VAT rate is 0 in the cart, it's normal that the order_discount_tax value is also 0 when the order is created from the cart.
And thus, the problem has nothing to do with HikaShop not properly filling the order_discount_tax value when the order is created from the cart. The problem is that the tax is not calculated for the coupon.
And based on what you wrote, the issue is likely that your taxes are not configured properly for what you want to do.

I've checked your settings with the backend access you provided. I think the issue is with the "apply coupon" setting of the HikaShop configuration:
[ www.hikashop.com/support/documentation/5...nfig.html#main\_taxes](https://www.hikashop.com/support/documentation/54-hikashop-config.html#main_taxes)
Since that setting is set to "after taxes", it means that the taxes are calculated for the cart, and then the coupon applies to the cart.
You probably want to change that setting to "before taxes". And you also want to change the flat amount of your coupon as you want to provide the value without taxes: 8.13
I've made the changes for you and now the taxes properly updates based on the value of the coupon when added to the cart:
[ i.imgur.com/a3YiI0R.png](https://i.imgur.com/a3YiI0R.png)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDk4NDctb3JkZXItZGlzY291bnQtdGF4P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[pablop76](/forum/user/59854-pablop76 "View pablop76's Profile")**
- [![pablop76's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/59854-pablop76 "View pablop76's Profile") Topic Author
- [ Offline](/forum/user/59854-pablop76)

Less More

- Posts: 5
- Thank you received: 1
-
-

1 year 4 days ago [\#369189](#369189) by [pablop76](/forum/user/59854-pablop76 "View pablop76's Profile")  Replied by *[pablop76](/forum/user/59854-pablop76 "View pablop76's Profile")* on topic *[order discount tax](/forum/46-discount-coupon/909847-order-discount-tax#369189 "-- HikaShop version -- : HikaShop Starter: 6.1.0 -- Joomla version -- : 5.4.0 -- PHP version -- : 8.3 -- Browser(s) name and version -- : chrome -- Error-message(debug-mod must be tuned on) -- : &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,  Regardless of the VAT rate set for the coupon, I always see 0.00000 in the logs. &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,")*

Okay, that works, but I don't have a tax rate for the coupon. There's only a tax amount.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDk4NDctb3JkZXItZGlzY291bnQtdGF4P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

1 year 4 days ago [\#369191](#369191) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[order discount tax](/forum/46-discount-coupon/909847-order-discount-tax#369191 "-- HikaShop version -- : HikaShop Starter: 6.1.0 -- Joomla version -- : 5.4.0 -- PHP version -- : 8.3 -- Browser(s) name and version -- : chrome -- Error-message(debug-mod must be tuned on) -- : &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,  Regardless of the VAT rate set for the coupon, I always see 0.00000 in the logs. &quot;order&#95;discount&#95;tax&quot;: &quot;0.00000&quot;,")*

Hi,

Yes. That's the same for the other things. If you check the order_shipping_tax or the order_product_tax columns in the database or the corresponding attributes in the $order object, it's only the tax amount that is provided.
The details of what tax rate is applied, with which untaxed amount as base, etc is all stored in the order_tax_info for the whole order and the order_product_tax_info columns for each product.
The data in there in the database is serialized with PHP's serialize function:
[ www.php.net/manual/en/function.serialize.php](https://www.php.net/manual/en/function.serialize.php)
In plugins, you should have the data readily available in $order-&gt;order_tax_info as an array of objects with the keys of the array being the tax rate namekey provided when creating the tax rate via the "manage rates" button of the System&gt;Taxes menu.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDk4NDctb3JkZXItZGlzY291bnQtdGF4P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.049 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
