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

#   error in coupon display when the coupon is 100%

##

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

Less More

- Posts: 105
- Thank you received: 2
-
-

8 years 5 months ago [\#293639](#293639) by [rfonta](/forum/user/30933-rfonta "View rfonta's Profile")  *[error in coupon display when the coupon is 100%](/forum/27-checkout/894917-error-in-coupon-display-when-the-coupon-is-100#293639 "It seems there is an error in the show&#95;block&#95;cart file. when the coupon is 100%, the variable $taxes is calculated to 0 because the final price is 0, but not the price before the discount  ($taxes = round($cart-&gt;full&#95;total-&gt;prices&#91;0&#93;-&gt;price&#95;value&#95;with&#95;tax - $cart-&gt;full&#95;total-&gt;prices&#91;0&#93;-&gt;price&#95;value, $this-&gt;currencyClass-&gt;getRounding($cart-&gt;full&#95;total-&gt;prices&#91;0&#93;-&gt;price&#95;currency&#95;id));)  the consequence is that the coupon is displayed without tax, when the total before the coupon is displayed with tax; so it looks like there is an error (the final price after the discount is correctly displayed at 0;  I corrected it in the file by adding a condition (in orange) in these lines if(($taxes == 0 ) || empty($this-&gt;options)) echo $this-&gt;currencyClass-&gt;format(@$cart-&gt;coupon-&gt;discount&#95;value&#95;without&#95;tax &#42; -1, @$cart-&gt;coupon-&gt;discount&#95;currency&#95;id); else echo $this-&gt;currencyClass-&gt;format(@$cart-&gt;coupon-&gt;discount&#95;value &#42; -1, @$cart-&gt;coupon-&gt;discount&#95;currency&#95;id);  So now for me it works; but you may have a look at your code and verfiy the error I think I detected; if I am right you may modify it; if I am wrong, you may also tell me what is my error  kind regards")* was created by *[rfonta](/forum/user/30933-rfonta "View rfonta's Profile")*

It seems there is an error in the show_block_cart file.
when the coupon is 100%, the variable $taxes is calculated to 0 because the final price is 0, but not the price before the discount

($taxes = round($cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax - $cart-&gt;full_total-&gt;prices[0]-&gt;price_value, $this-&gt;currencyClass-&gt;getRounding($cart-&gt;full_total-&gt;prices[0]-&gt;price_currency_id))![;)](/media/kunena/emoticons/24.png ";)")

the consequence is that the coupon is displayed without tax, when the total before the coupon is displayed with tax; so it looks like there is an error (the final price after the discount is correctly displayed at 0;

I corrected it in the file by adding a condition (in orange) in these lines
if(($taxes == 0 &amp;&amp; $cart-&gt;coupon-&gt;discount\_percent\_amount\_orig&lt;100) &#124;&#124; empty($this-&gt;options))
echo $this-&gt;currencyClass-&gt;format(@$cart-&gt;coupon-&gt;discount_value_without_tax * -1, @$cart-&gt;coupon-&gt;discount_currency_id);
else
echo $this-&gt;currencyClass-&gt;format(@$cart-&gt;coupon-&gt;discount_value * -1, @$cart-&gt;coupon-&gt;discount_currency_id);

So now for me it works; but you may have a look at your code and verfiy the error I think I detected; if I am right you may modify it; if I am wrong, you may also tell me what is my error

kind regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NDkxNy1lcnJvci1pbi1jb3Vwb24tZGlzcGxheS13aGVuLXRoZS1jb3Vwb24taXMtMTAwP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

8 years 5 months ago [\#293643](#293643) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[error in coupon display when the coupon is 100%](/forum/27-checkout/894917-error-in-coupon-display-when-the-coupon-is-100#293643 "It seems there is an error in the show&#95;block&#95;cart file. when the coupon is 100%, the variable $taxes is calculated to 0 because the final price is 0, but not the price before the discount  ($taxes = round($cart-&gt;full&#95;total-&gt;prices&#91;0&#93;-&gt;price&#95;value&#95;with&#95;tax - $cart-&gt;full&#95;total-&gt;prices&#91;0&#93;-&gt;price&#95;value, $this-&gt;currencyClass-&gt;getRounding($cart-&gt;full&#95;total-&gt;prices&#91;0&#93;-&gt;price&#95;currency&#95;id));)  the consequence is that the coupon is displayed without tax, when the total before the coupon is displayed with tax; so it looks like there is an error (the final price after the discount is correctly displayed at 0;  I corrected it in the file by adding a condition (in orange) in these lines if(($taxes == 0 ) || empty($this-&gt;options)) echo $this-&gt;currencyClass-&gt;format(@$cart-&gt;coupon-&gt;discount&#95;value&#95;without&#95;tax &#42; -1, @$cart-&gt;coupon-&gt;discount&#95;currency&#95;id); else echo $this-&gt;currencyClass-&gt;format(@$cart-&gt;coupon-&gt;discount&#95;value &#42; -1, @$cart-&gt;coupon-&gt;discount&#95;currency&#95;id);  So now for me it works; but you may have a look at your code and verfiy the error I think I detected; if I am right you may modify it; if I am wrong, you may also tell me what is my error  kind regards")*

Hello,

When you create a thread in our forum please provide the basis requested details, including the HikaShop version number.
You can also use the tag [ code ] (without the spaces) to paste PHP code in the forum.

Thanks

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NDkxNy1lcnJvci1pbi1jb3Vwb24tZGlzcGxheS13aGVuLXRoZS1jb3Vwb24taXMtMTAwP3RtcGw9bWFya2Rvd24=) 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.045 seconds

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