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

#   Displaying the DISCOUNT CODE on All Order Emails

##

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

Less More

- Posts: 301
- Thank you received: 11
-
-

4 years 3 months ago -  4 years 3 months ago [\#343673](#343673) by [MSTACE](/forum/user/7448-mstace "View MSTACE's Profile")  *[Displaying the DISCOUNT CODE on All Order Emails](/forum/46-discount-coupon/904810-displaying-the-discount-code-on-all-order-emails#343673 "-- url of the page with the problem -- :   www.notable.au/new/  -- HikaShop version -- : 4.6.1 -- Joomla version -- : 4.1.5 -- PHP version -- : 8.0.21  I used to use this code to display the DISCOUNT CODE on all of the order emails:  However, with Joomla 4, this is no longer working and actually stops the &quot;Order administrator notification&quot; email from being sent.  Any ideas?  Thank you.")* was created by *[MSTACE](/forum/user/7448-mstace "View MSTACE's Profile")*

-- url of the page with the problem -- : [ www.notable.au/new/](https://www.notable.au/new/)
-- HikaShop version -- : 4.6.1
-- Joomla version -- : 4.1.5
-- PHP version -- : 8.0.21

I used to use this code to display the DISCOUNT CODE on all of the order emails:
Code:

&lt;!--{IF:DISCOUNT}--&gt; &lt;p&gt; &lt;span style="color:#1c8faf !important;font-weight:bold;"&gt;COUPON used :&lt;/span&gt; {VAR:order.order_discount_code} &lt;/p&gt; &lt;!--{ENDIF:DISCOUNT}--&gt;

However, with Joomla 4, this is no longer working and actually stops the "Order administrator notification" email from being sent.

Any ideas?

Thank you.

Last edit: 4 years 3 months ago by [MSTACE](/forum/user/7448-mstace "View MSTACE's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDQ4MTAtZGlzcGxheWluZy10aGUtZGlzY291bnQtY29kZS1vbi1hbGwtb3JkZXItZW1haWxzP3RtcGw9bWFya2Rvd24=) 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: 86556
- Thank you received: 14304
-
-

4 years 3 months ago [\#343677](#343677) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Displaying the DISCOUNT CODE on All Order Emails](/forum/46-discount-coupon/904810-displaying-the-discount-code-on-all-order-emails#343677 "-- url of the page with the problem -- :   www.notable.au/new/  -- HikaShop version -- : 4.6.1 -- Joomla version -- : 4.1.5 -- PHP version -- : 8.0.21  I used to use this code to display the DISCOUNT CODE on all of the order emails:  However, with Joomla 4, this is no longer working and actually stops the &quot;Order administrator notification&quot; email from being sent.  Any ideas?  Thank you.")*

Hi,

There is no Code:

&lt;!--{IF:DISCOUNT}--&gt; ... &lt;!--{ENDIF:DISCOUNT}--&gt;

available in the HikaShop emails by default.
So you must have also added some code in the "preload" of the email to add this.
So either you're missing that code from the preload, or the code you added in the preload has a problem, not the tag in the HTML.

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

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

Less More

- Posts: 301
- Thank you received: 11
-
-

4 years 3 months ago -  4 years 3 months ago [\#343678](#343678) by [MSTACE](/forum/user/7448-mstace "View MSTACE's Profile")  Replied by *[MSTACE](/forum/user/7448-mstace "View MSTACE's Profile")* on topic *[Displaying the DISCOUNT CODE on All Order Emails](/forum/46-discount-coupon/904810-displaying-the-discount-code-on-all-order-emails#343678 "-- url of the page with the problem -- :   www.notable.au/new/  -- HikaShop version -- : 4.6.1 -- Joomla version -- : 4.1.5 -- PHP version -- : 8.0.21  I used to use this code to display the DISCOUNT CODE on all of the order emails:  However, with Joomla 4, this is no longer working and actually stops the &quot;Order administrator notification&quot; email from being sent.  Any ideas?  Thank you.")*

Sorry, here is the original code that you all gave me years ago.
This one is not working either.
Code:

&lt;!--{IF:DISCOUNT}--&gt; &lt;?php if(!empty($data-&gt;order_discount_code)){ ?&gt; &lt;p&gt; &lt;span style="color:#1c8faf !important;font-weight:bold;"&gt;COUPON used :&lt;/span&gt; {VAR:order.order_discount_code} &lt;/p&gt; &lt;?php } ?&gt; &lt;!--{ENDIF:DISCOUNT}--&gt;

Last edit: 4 years 3 months ago by [MSTACE](/forum/user/7448-mstace "View MSTACE's Profile").

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

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

Less More

- Posts: 4820
- Thank you received: 652
-
-

4 years 3 months ago [\#343692](#343692) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Displaying the DISCOUNT CODE on All Order Emails](/forum/46-discount-coupon/904810-displaying-the-discount-code-on-all-order-emails#343692 "-- url of the page with the problem -- :   www.notable.au/new/  -- HikaShop version -- : 4.6.1 -- Joomla version -- : 4.1.5 -- PHP version -- : 8.0.21  I used to use this code to display the DISCOUNT CODE on all of the order emails:  However, with Joomla 4, this is no longer working and actually stops the &quot;Order administrator notification&quot; email from being sent.  Any ideas?  Thank you.")*

Hello,

Sorry for this returns, but in order to be sure, can you precise from which parts did you add this custom code (shown here).
In the HTML, TEXT or preload version ?
Did you just update your Joomla 4 version ? Or the HikaShop version too ?
Awaiting your returns to progress on your issue.

Regards

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

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

Less More

- Posts: 301
- Thank you received: 11
-
-

4 years 3 months ago [\#343750](#343750) by [MSTACE](/forum/user/7448-mstace "View MSTACE's Profile")  Replied by *[MSTACE](/forum/user/7448-mstace "View MSTACE's Profile")* on topic *[Displaying the DISCOUNT CODE on All Order Emails](/forum/46-discount-coupon/904810-displaying-the-discount-code-on-all-order-emails#343750 "-- url of the page with the problem -- :   www.notable.au/new/  -- HikaShop version -- : 4.6.1 -- Joomla version -- : 4.1.5 -- PHP version -- : 8.0.21  I used to use this code to display the DISCOUNT CODE on all of the order emails:  However, with Joomla 4, this is no longer working and actually stops the &quot;Order administrator notification&quot; email from being sent.  Any ideas?  Thank you.")*

I added this code to the HTML version.

This was a new Joomla 4 install.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDQ4MTAtZGlzcGxheWluZy10aGUtZGlzY291bnQtY29kZS1vbi1hbGwtb3JkZXItZW1haWxzP3RtcGw9bWFya2Rvd24=) 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: 86556
- Thank you received: 14304
-
-

4 years 3 months ago [\#343763](#343763) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Displaying the DISCOUNT CODE on All Order Emails](/forum/46-discount-coupon/904810-displaying-the-discount-code-on-all-order-emails#343763 "-- url of the page with the problem -- :   www.notable.au/new/  -- HikaShop version -- : 4.6.1 -- Joomla version -- : 4.1.5 -- PHP version -- : 8.0.21  I used to use this code to display the DISCOUNT CODE on all of the order emails:  However, with Joomla 4, this is no longer working and actually stops the &quot;Order administrator notification&quot; email from being sent.  Any ideas?  Thank you.")*

Hi,

This code should work for the order creation notification and the order admin notification: Code:

&lt;?php if(!empty($data-&gt;order_discount_code)){ ?&gt; &lt;p&gt; &lt;span style="color:#1c8faf !important;font-weight:bold;"&gt;COUPON used :&lt;/span&gt; {VAR:order.order_discount_code} &lt;/p&gt; &lt;?php } ?&gt;

This should work for the order status notification and the payment notification emails: Code:

&lt;?php if(!empty($data-&gt;cart-&gt;order_discount_code)){ ?&gt; &lt;p&gt; &lt;span style="color:#1c8faf !important;font-weight:bold;"&gt;COUPON used :&lt;/span&gt; {VAR:order.order_discount_code} &lt;/p&gt; &lt;?php } ?&gt;

The second code might also work for the order creation notification and the order admin notification but it would require some testing to verify that.

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

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

Less More

- Posts: 301
- Thank you received: 11
-
-

4 years 3 months ago [\#343775](#343775) by [MSTACE](/forum/user/7448-mstace "View MSTACE's Profile")  Replied by *[MSTACE](/forum/user/7448-mstace "View MSTACE's Profile")* on topic *[Displaying the DISCOUNT CODE on All Order Emails](/forum/46-discount-coupon/904810-displaying-the-discount-code-on-all-order-emails#343775 "-- url of the page with the problem -- :   www.notable.au/new/  -- HikaShop version -- : 4.6.1 -- Joomla version -- : 4.1.5 -- PHP version -- : 8.0.21  I used to use this code to display the DISCOUNT CODE on all of the order emails:  However, with Joomla 4, this is no longer working and actually stops the &quot;Order administrator notification&quot; email from being sent.  Any ideas?  Thank you.")*

Excellent. These work great.

Thank you very much.

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

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