Skip to main content

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

More
9 years 2 weeks ago - 9 years 2 weeks ago #278298 by MSTACE
-- HikaShop version -- : 3.1.1

This code works perfectly for adding the COUPON CODE to the order emails:
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 } ?>

But it does not work for adding the COUPON CODE to the INVOICE (order / invoice.php).

What code would work in this case?

Thank you.
Last edit: 9 years 2 weeks ago by MSTACE.

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

More
9 years 2 weeks ago #278328 by nicolas
Hi,

The tags system is only in the emails.
For view overrides you need to use PHP code instead.
So instead of:
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 } ?>
You can use:
Code:
<?php if(!empty($this->element->order_discount_code)){ ?> <p> <span style="color:#1c8faf !important;font-weight:bold;">COUPON used :</span> <?php echo $this->element->order_discount_code; ?> </p> <?php } ?>

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

More
9 years 2 weeks ago #278393 by MSTACE
That works great!
Thank you.

You might think about adding the Coupon Code Used on the email and invoice templates.
The retailers are asking to know which Coupon Code was used and the customers like to know that the Coupon Code was applied.
The following user(s) said Thank You: Philip

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

Time to create page: 0.179 seconds
Powered by Kunena Forum