[SOLVED] How to Show the COUPON CODE USED on the Notification Emails?

  • Posts: 284
  • Thank you received: 6
8 years 1 week ago #275661

-- HikaShop version -- : 3.1.1

How can I show which COUPON CODE was used by the customer on the Notification Emails?

This is especially important for the Order administrator notification so the retailer can see which code was used.

Thank you.

Last edit: 8 years 6 days ago by MSTACE.

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

  • Posts: 84219
  • Thank you received: 13671
  • MODERATOR
8 years 1 week ago #275672

Hi,

You can use such tag in the HTML version of the email: {VAR:order.order_discount_code}

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

  • Posts: 284
  • Thank you received: 6
8 years 1 week ago #275718

Thank you!

That works great.

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

  • Posts: 284
  • Thank you received: 6
8 years 1 week ago #275722

Is it possible to add the IF/ENDIF statement for Coupons in this HTML?

Something like:

<!--{IF:DISCOUNT_CODE}-->
<p>
	<span style="color:#1c8faf !important;font-weight:bold;">COUPON USED :</span> {VAR:order.order_discount_code}
</p>
<!--{ENDIF:DISCOUNT_CODE}-->

I have tried various words, but they don't seem to work: IF:DISCOUNT, IF:COUPON, etc...

Last edit: 8 years 6 days ago by MSTACE.

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

  • Posts: 84219
  • Thank you received: 13671
  • MODERATOR
8 years 6 days ago #275727

Hi,

To use a IF /ENDIF tag, you need to first have a variable defined with it in the preload.
So the simplest would be to use standard PHP:

<?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
}
?>

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

  • Posts: 284
  • Thank you received: 6
8 years 6 days ago #275782

Yes, excellent. This is working great.

Thank you.

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

Time to create page: 0.044 seconds
Powered by Kunena Forum