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

#   Apply Discount After Taxes config not working

##

- **[PolishedGeek](/forum/user/8378-polishedgeek "View PolishedGeek's Profile")**
- [![PolishedGeek's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8378-polishedgeek "View PolishedGeek's Profile") Topic Author
- [ Offline](/forum/user/8378-polishedgeek)
- Official HikaShop Development Partner

Less More

- Posts: 329
- Thank you received: 94
-
- [](http://PolishedGeek.com/?utm_source=hikashop)
-

12 years 2 months ago -  12 years 2 months ago [\#169298](#169298) by [PolishedGeek](/forum/user/8378-polishedgeek "View PolishedGeek's Profile")  *[Apply Discount After Taxes config not working](/forum/40-taxes/870688-apply-discount-after-taxes-config-not-working#169298 "-- HikaShop version -- : HikaShop Business: 2.3.2 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.3 (dev server) -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : Website is in offline mode during development. I am attaching screenshots of the problem.  Our client offers employer-subsidized healthcare items, vitamins, etc. The employer pays 80% of the retail cost of the products. Their employees (the store customers) must pay the full amount of taxes, calculated on the retail price.  Not all products are subsidized, so we can't simply do a discount at checkout, it must be by product category.  So we need to configure this for example: ---- Retail price = $11.70 each Tax (8%) = $0.94 Less 80% discount on retail price = -$9.36 each ---- Final price of the item = $2.34 each Taxes based on retail, before discount = $0.94 Total paid by customer at checkout = $3.28 each ---- In summary, what we need is Retail Price + (Retail Price x Tax) - (Retail Price x Discount) = Final price --- What we are getting in the checkout, however, is Retail Price + &#91;(Retail Price - Discount) x Tax&#93; = Final price  We have a test product set up (see screenshots) that shows the full retail and the discounted price, and you can see with the math in the checkout that discounts are being applied differently than what we are trying to achieve.  How can this be done, so we will get Retail Price + (Retail Price x Tax) - (Retail Price x Discount) = Final price ?")* was created by *[PolishedGeek](/forum/user/8378-polishedgeek "View PolishedGeek's Profile")*

-- HikaShop version -- : HikaShop Business: 2.3.2
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.3 (dev server)
-- Browser(s) name and version -- : All
-- Error-message(debug-mod must be tuned on) -- : Website is in offline mode during development. I am attaching screenshots of the problem.

Our client offers employer-subsidized healthcare items, vitamins, etc. The employer pays 80% of the retail cost of the products. Their employees (the store customers) must pay the full amount of taxes, calculated on the retail price.

Not all products are subsidized, so we can't simply do a discount at checkout, it must be by product category.

So we need to configure this for example:
----
Retail price = $11.70 each
Tax (8%) = $0.94
Less 80% discount on retail price = -$9.36 each
----
Final price of the item = $2.34 each
Taxes based on retail, before discount = $0.94
Total paid by customer at checkout = $3.28 each
----
**In summary, what we need is Retail Price + (Retail Price x Tax) - (Retail Price x Discount) = Final price**
---
What we are getting in the checkout, however, is
**Retail Price + \[(Retail Price - Discount) x Tax\] = Final price**

We have a test product set up (see screenshots) that shows the full retail and the discounted price, and you can see with the math in the checkout that discounts are being applied differently than what we are trying to achieve.

How can this be done, so we will get Retail Price + (Retail Price x Tax) - (Retail Price x Discount) = Final price ?

---

~ Deb Cinkus, CEO

Polished Geek: more with monday․com
eCommerce Business Process Automation Experts

- [ ![Productwithdiscount.png](/forum/attachment/19258) ](/forum/attachment/19258 "...thdiscount.png") [ ](/forum/attachment/19258?download=1 "...thdiscount.png")
- [ ![hikashoptaxconfiguration.png](/forum/attachment/19259) ](/forum/attachment/19259 "...figuration.png") [ ](/forum/attachment/19259?download=1 "...figuration.png")
- [ ![productincartwrongtax.png](/forum/attachment/19260) ](/forum/attachment/19260 "...rtwrongtax.png") [ ](/forum/attachment/19260?download=1 "...rtwrongtax.png")

Last edit: 12 years 2 months ago by [PolishedGeek](/forum/user/8378-polishedgeek "View PolishedGeek's Profile"). Reason: adding attachments

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzg3MDY4OC1hcHBseS1kaXNjb3VudC1hZnRlci10YXhlcy1jb25maWctbm90LXdvcmtpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

12 years 2 months ago [\#169367](#169367) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Apply Discount After Taxes config not working](/forum/40-taxes/870688-apply-discount-after-taxes-config-not-working#169367 "-- HikaShop version -- : HikaShop Business: 2.3.2 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.3 (dev server) -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : Website is in offline mode during development. I am attaching screenshots of the problem.  Our client offers employer-subsidized healthcare items, vitamins, etc. The employer pays 80% of the retail cost of the products. Their employees (the store customers) must pay the full amount of taxes, calculated on the retail price.  Not all products are subsidized, so we can't simply do a discount at checkout, it must be by product category.  So we need to configure this for example: ---- Retail price = $11.70 each Tax (8%) = $0.94 Less 80% discount on retail price = -$9.36 each ---- Final price of the item = $2.34 each Taxes based on retail, before discount = $0.94 Total paid by customer at checkout = $3.28 each ---- In summary, what we need is Retail Price + (Retail Price x Tax) - (Retail Price x Discount) = Final price --- What we are getting in the checkout, however, is Retail Price + &#91;(Retail Price - Discount) x Tax&#93; = Final price  We have a test product set up (see screenshots) that shows the full retail and the discounted price, and you can see with the math in the checkout that discounts are being applied differently than what we are trying to achieve.  How can this be done, so we will get Retail Price + (Retail Price x Tax) - (Retail Price x Discount) = Final price ?")*

Hi,

The discounts in percentage of the products will be calculated the same way regardless of the "apply discount" option of the configuration.
If you want to change the behavior of that, you need to look at the function addDiscount of the file administrator/components/com_hikashop/classes/currency.php
I guess that you'll want to avoid the calls to the getTaxedPrice function which recalculates the taxes after the discount is applied to the product price.

The following user(s) said Thank You: [PolishedGeek](/forum/user/8378-polishedgeek "View PolishedGeek's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzg3MDY4OC1hcHBseS1kaXNjb3VudC1hZnRlci10YXhlcy1jb25maWctbm90LXdvcmtpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) 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.052 seconds

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