I am asking for help, because I am losing faith if I am able to solve the problem myself.
But to the point, is it possible to have two different templates for an email?
I have modified the file /components/com_virtuemart/views/cart/tmpl/mail_html.php ( so that in the e-mail sent after the purchase the customer received in the mail in the product field not only the product name but also all selected custom fields and their prices.
The problem is when I would like to change in the product price of the custom field (eg the price list has changed) in orders that have already been submitted at the time of changing the order status to customer will be sent mail not with prices after which the customer ordered but there will occur currently inserted prices (becausee VM does not have them ,,somewhere saved" but takes them directly from the database -> _virtuemart_product_customfields)
And that's why I would like to make/have two templates:
One, as it is now, with all data + custom fields and their prices
Second: for communication with the customer at the moment of changing the status, with only custom fields without prices in product field
Unfortunately, I do not know where to look for the code responsible for communication with client when changing the order status.
Joomla: 3.8.7
Virtuemart: 3.2.14
Hello,
you could make different mails per status name, confirmed, shipped and so on.
Just find out the status:
$statusname = $this->orderDetails['details']['BT']->order_status_name;
Then you tell your custom fields to appear for status XYZ and not for the rest.
Hope that helps
Stefan
The order status change mail is in the folder /components/com_virtuemart/views/invoice/tmpl/mail_html.php