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';
}
?>