How to sent a different order created email per warehouse

  • Posts: 165
  • Thank you received: 14
  • Hikashop Business
3 years 2 months ago #328137

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.20
-- PHP version -- : 7.3.25
-- Error-message(debug-mod must be tuned on) -- : none

Hi,
we've created a dedicated warehouse for a specific line of products that require a slightly different customer email. The new email will be the same for all of the line. Can you step us through how this would be done (e.g. creating a additional template, entering the alternate info, association with the warehouse)?

Thanks,
Ian and Stu

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
3 years 2 months ago #328139

Hi,

Well, before I can answer your questions, I would you to answer my questions on your project:
- You say that you want a new email to be sent to the customer for the new warehouse, but the normal email would still be sent.
So rather than creating a new email template, wouldn't it be better to modify the existing email ?
- The order creation notification email is sent for the whole order. And in an order you can potentially have products from different warehouses. What should happen in that case ?

Supposing that you're ok with modifying the current email, and that you won't have orders with products from different warehouses in the same order, then the best is to edit the order creation notification email via the menu System>Emails.
There, in the HTML code, you can directly write your PHP code. For example:

<?php
$firstProduct = reset($data->cart->products);
$productClass = hikashop_get('class.product);
$product = $productClass->get($firstProduct->product_id);
if($product->product_warehouse_id == XX) {
 echo 'text for purchase of products from the warehouse with the id XX';
} else {
 echo 'text for purchase of other products';
}
?>

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

  • Posts: 165
  • Thank you received: 14
  • Hikashop Business
3 years 2 months ago #328183

Hi,
We're not confident with coding this. If you can send me the exact changes for the order_creation_notification email it would be appreciated.

Many thanks,
Ian and Stu

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
3 years 2 months ago #328186

Hi,

Well, I already gave you the exact changes in my previous message, so I don't know what more you want ?
More than that would require us to know the id of your warehouses and the exact text you want to be different where etc.
But, this is custom work, not user support. If you want us to do the modification for you on your website, that's possible. Please use our contact form to request a quote along with precise information on what you want to be changed in the email and for which case precisely, along with a link to this thread for reference. We'll be able to give you a quote on the job.
www.hikashop.com/support/contact-us.html

The following user(s) said Thank You: smithshop123

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

  • Posts: 165
  • Thank you received: 14
  • Hikashop Business
3 years 2 months ago #328305

Hi,
we decided to create a custom field in the checkout restricted to the specific product (as per your original advice). This works well.

Many thanks,
Ian and Stu

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

Time to create page: 0.070 seconds
Powered by Kunena Forum