Put coupon name in notification email?

  • Posts: 29
  • Thank you received: 0
10 years 7 months ago #150040

Latest Hikashop Business version...

What code can I add to the admin notification email to insert the name of the coupon used for an order?

For example, now it shows:

Coupon: -$7.00


And I want it to show:

Coupon (COUPON NAME): -$7.00


Thanks for your help as always.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 7 months ago #150271

Hi,
The solution will probably be to edit the Preload version code of your "Order administrator notification" email through "Hikashop->System->Emails" and change that lines :

    $cartFooters[] = array(
      'NAME' => JText::_('HIKASHOP_COUPON'),
      'VALUE' => $t
    );
By :
if(isset($data->cart->order_discount_code))
$coupon_name = JText::_('HIKASHOP_COUPON') . ' ('. $data->cart->order_discount_code . ')';
else
$coupon_name = JText::_('HIKASHOP_COUPON');
    $cartFooters[] = array(
      'NAME' => $coupon_name,
      'VALUE' => $t
    );

Note that the "Emails" section is only available through the business version of Hikashop

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

  • Posts: 6
  • Thank you received: 0
8 years 11 months ago #221678

ça marche pas !

il va écrire toujours Coupon: -$7.00

$coupon_name = JText::_('HIKASHOP_COUPON');

JText::_('HIKASHOP_COUPON'); = "Coupon";

alors rien n'a changer ?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 11 months ago #221679

Hi,

The code that Mohamed gave is working fine.
Please, write in English in an English thread or if you do not want to write in English ; please create a new French thread in the French section of the forum.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 6
  • Thank you received: 0
8 years 11 months ago #221734

oups, sorry

I found the solution :

replace :

$cartFooters[] = array(
	'NAME' => JText::_('HIKASHOP_COUPON'),
	'VALUE' => $t
);
by :
$cartFooters[] = array(
	'NAME' => JText::_('HIKASHOP_COUPON') . ' - ' . @$data->order_discount_code, 
	'VALUE' => $t 
);

sorry for my english is not so good

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

Time to create page: 0.078 seconds
Powered by Kunena Forum