Order creation e-mail only with bank transfer

  • Posts: 183
  • Thank you received: 10
  • Hikashop Business
4 years 7 months ago #310341

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.11
-- PHP version -- : 7.3.x
-- Browser(s) name and version -- : Chrome

Hi,

I only want to sent an order created e-mail when the bank transfer is used. I found this post: www.hikashop.com/forum/orders-management...-for-bank-trans.html

I created the following code:

<?php if($data->order_payment_method !== 'bank_transfer') $data->customer->user_email = ''; ?>
This code has to go on top in the order created e-mail template.

Is this still a valid way to sent the e-mail only on bank transfer skipping all others? Or is there an other smart way?

Regards!

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
4 years 7 months ago #310346

Hi,

Instead of $data->customer->user_email = ''; you should use $mail->published = false; in your code.

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

  • Posts: 183
  • Thank you received: 10
  • Hikashop Business
4 years 7 months ago #310376

Just to be complete. Dit some tweaking af found a little error. The correct code to block the mail is:

<?php if($data->order_payment_method !== 'banktransfer') $mail->published = false; ?>

Just for everyone who needs this kind of feature!

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

Time to create page: 0.055 seconds
Powered by Kunena Forum