# Discount count towards delivery cost?

**URL:** <https://forum.litium.com/t/discount-count-towards-delivery-cost/236>\
**Category:** Questions\
**Tags:** campaign\
**Created:** [September 10, 2018, 8:05am UTC](https://forum.litium.com/t/discount-count-towards-delivery-cost/236 "2018-09-10T08:05:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefan.gross](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@stefan.gross](https://forum.litium.com/u/stefan.gross)\
**Post date:** [September 10, 2018, 8:05am UTC](https://forum.litium.com/t/discount-count-towards-delivery-cost/236/1 "2018-09-10T08:05:19Z")

</div>

Lets say we have a order with 2 products for 749 each adding up to 1498 plus a delivery cost of 49. The user then adds a campaign code with 1500 in discount. The overlapping amount of 2 from the campaign code then goes towards the delivery cost which ends up being 47 instead of 49 which also lowers the VAT for the delivery.  
Is that as intended or is it a bug?  
If it’s not a bug which calculator should I override to fix this in the best way ?

Litium version: 5.6.2

---

<div class="post-metadata">

**Author:** ![stefan.gross](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@stefan.gross](https://forum.litium.com/u/stefan.gross)\
**Post date:** [September 11, 2018, 3:27pm UTC](https://forum.litium.com/t/discount-count-towards-delivery-cost/236/2 "2018-09-11T15:27:34Z")

</div>

Would be grateful for an answer soon 🙂

---

<div class="post-metadata">

**Author:** ![marten](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/marten/32/11_2.png) [@marten](https://forum.litium.com/u/marten)\
**Post date:** [September 11, 2018, 7:33pm UTC](https://forum.litium.com/t/discount-count-towards-delivery-cost/236/3 "2018-09-11T19:33:17Z")

</div>

There is a description with examples of delivery and fee vat on docs that you can look at: [https://docs.litium.com/documentation/litium-documentation/sales/pricing\_rules\_1/calculating\_vat](https://docs.litium.com/documentation/litium-documentation/sales/pricing_rules_1/calculating_vat)

`IVatCalculator` has the method `CalculateTotalDeliveryVat` that you could look at depending on what you want to do.

And if that does not answer your question, what is the grand total of your order after the discount and how does that differ from your expected grand total?

---

<div class="post-metadata">

**Author:** ![stefan.gross](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@stefan.gross](https://forum.litium.com/u/stefan.gross)\
**Post date:** [September 14, 2018, 8:30am UTC](https://forum.litium.com/t/discount-count-towards-delivery-cost/236/4 "2018-09-14T08:30:41Z")

</div>

Well the original question was. Should a campaign of type “lower ordervalue with x amount” actually lower the delivery cost if the campaign amount is bigger than the total value of the order? I feel it shouldn’t and before I start overriding and experementing I would like to know if thats intended or not.

---

<div class="post-metadata">

**Author:** ![anusha.ganegoda](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/anusha.ganegoda/32/58_2.png) [@anusha.ganegoda](https://forum.litium.com/u/anusha.ganegoda)\
**Post date:** [September 14, 2018, 9:39am UTC](https://forum.litium.com/t/discount-count-towards-delivery-cost/236/6 "2018-09-14T09:39:40Z")

</div>

This is by design. The order discount is given on the total order, and the delivery cost is treated as part of it.  
The actual calculation is done in the order discount campaign action, and it looks at the order grand total, not excluding the delivery costs.  
If you instead wants to discount only the order row totals, you would need to write a action that operates only on row totals.  
Note that, the action does not have any idea of what conditions enables a campaign as per current design of campaign engine.
