Skip to main content

Displaying the DISCOUNT CODE on All Order Emails

More
4 years 1 month ago - 4 years 1 month ago #343673 by MSTACE
-- 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:
Code:
<!--{IF:DISCOUNT}--> <p> <span style="color:#1c8faf !important;font-weight:bold;">COUPON used :</span> {VAR:order.order_discount_code} </p> <!--{ENDIF:DISCOUNT}-->

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 1 month ago by MSTACE.

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #343677 by nicolas
Hi,

There is no
Code:
<!--{IF:DISCOUNT}--> ... <!--{ENDIF:DISCOUNT}-->
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 or Create an account to join the conversation.

More
4 years 1 month ago - 4 years 1 month ago #343678 by MSTACE
Sorry, here is the original code that you all gave me years ago.
This one is not working either.
Code:
<!--{IF:DISCOUNT}--> <?php if(!empty($data->order_discount_code)){ ?> <p> <span style="color:#1c8faf !important;font-weight:bold;">COUPON used :</span> {VAR:order.order_discount_code} </p> <?php } ?> <!--{ENDIF:DISCOUNT}-->
Last edit: 4 years 1 month ago by MSTACE.

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #343692 by Philip
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 or Create an account to join the conversation.

More
4 years 1 month ago #343750 by MSTACE
I added this code to the HTML version.

This was a new Joomla 4 install.

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #343763 by nicolas
Hi,

This code should work for the order creation notification and the order admin notification:
Code:
<?php if(!empty($data->order_discount_code)){ ?> <p> <span style="color:#1c8faf !important;font-weight:bold;">COUPON used :</span> {VAR:order.order_discount_code} </p> <?php } ?>
This should work for the order status notification and the payment notification emails:
Code:
<?php if(!empty($data->cart->order_discount_code)){ ?> <p> <span style="color:#1c8faf !important;font-weight:bold;">COUPON used :</span> {VAR:order.order_discount_code} </p> <?php } ?>
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 or Create an account to join the conversation.

More
4 years 1 month ago #343775 by MSTACE
Excellent. These work great.

Thank you very much.

Please Log in or Create an account to join the conversation.

Time to create page: 0.233 seconds
Powered by Kunena Forum