Adding logic to "Order status notification" email

  • Posts: 38
  • Thank you received: 0
8 years 8 months ago #209791

-- url of the page with the problem -- : initiativeready.com
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- Error-message(debug-mod must be tuned on) -- : N/A

How do I have the "Order creation notification" email some something different depending on whether it is in "created" versus "confirmed" status?

I would like the THANK_YOU_FOR_YOUR_ORDER_BEGIN or ORDER_STATUS_CHANGED_TO to have some additional text when the order is "confirmed." If i change either one of those, then that text shows up on all orders.

I want to add something to the effect of "If it contains electronic material, you can now download that electronic material by clicking on the order number (above) to return to the site and download your order. Physical items will be shipped soon. If this is for a quote, Someone will reach out on the next US business day."

It seems that I only need to add some logic to the "Order status notification" email, but I am not that good a programmer anymore to make those changes.

Thanks,
Todd


Cheers,
Todd

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
8 years 8 months ago #209811

Hi,

Normally, you have the "order creation notification" email which is sent when the order is created, and the "order status notification" email which is sent when the order is confirmed.
As you have two different emails, if you only modify one, you won't see the change in the other one.
So if you only want to add some text when the order is confirmed, you can edit the order status notification in the menu System>Emails and in the preload area, you can replace the code:
'ORDER_BEGIN_MESSAGE' => JText::sprintf('THANK_YOU_FOR_YOUR_ORDER_BEGIN', HIKASHOP_LIVE),
by:
'ORDER_BEGIN_MESSAGE' => JText::sprintf('THANK_YOU_FOR_YOUR_ORDER_BEGIN', HIKASHOP_LIVE). 'If it contains electronic material, you can now download that electronic material by clicking on the order number (above) to return to the site and download your order. Physical items will be shipped soon. If this is for a quote, Someone will reach out on the next US business day.',

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

  • Posts: 38
  • Thank you received: 0
8 years 8 months ago #209870

I thought that the "order status notification" was also sent when the order was canceled or shipped. Does it only go out when it is confirmed?

Second, pardon my ignorance, but what is the "preload" area?


Cheers,
Todd

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
8 years 8 months ago #209872

Hi,

Yes the "order status notification" is used when the order have a status modification ; which is generally when the order is confirmed ; but it is also when the order is cancelled or shipped.

When you edit an email in the HikaShop backend, you have three sections.
- HTML content
- Text content
- Preload

The preload is where you can find the PHP, so the two other can just contain text (and tags) in order to not mix the PHP code with the rest.

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: 38
  • Thank you received: 0
8 years 8 months ago #209924

So by doing what you are suggesting on editing the "order status notification" will put that notice on other status changes. It would seem to me that people might want different content per status change. Even just changing the image at the top of the email to show a created, confirmed, canceled, or shipped icon would be nice visual queue to the reader.

Maybe I will look into that code after the kids are back in school.


Cheers,
Todd

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
8 years 8 months ago #209962

Hi,

You can use such kind of code in the HTML content area:

<?php if($data->order_status=='confirmed'){ ?>
here you can put some html and text that will only display when the order is being confirmed
<?php } ?>

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

Time to create page: 0.065 seconds
Powered by Kunena Forum