Create and associate email with order status
- jameswadsworth
-
Topic Author
- Offline
Business 1.4.9 - joomla 1.5
1) is there any way to create a new email?
2) is there any way to manually associate which email gets sent according the order status??
Thanks
Please Log in or Create an account to join the conversation.
It's possible yes. There are two ways:
1. The easy way: Go in System->Emails and edit your order status notification email. There you can add an if statement in order to display different things in the email based on the status, like that:
if($data->order_status=="confirmed"){
echo 'Your order is confirmed';
}elseif($data->order_status=="cancelled"){
echo 'Your order is cancelled';
}
2. The hard way: You need to copy the files of the email in the folder media/com_hikashop/mail and also the corresponding configuration entries in the table hikashop_config. Then, build a hikashop plugin implementing the onAfterOrderUpdate method and set the $email variable to false in there so that the normal email is not sent by hikashop and then add your own code to load your email and send it, like it's done in the save function of the order class in the file administrator/components/com_hikashop/classes/order.php
I would recommend to go with option 1...
Please Log in or Create an account to join the conversation.
- jameswadsworth
-
Topic Author
- Offline
thanks for your reply. I had already built a hikashop plugin to meet my requirements. (I cloned the collect on delivery). I want to add extra status 'quote' before 'created'. The idea is that users can send in a quote request, the prices are review and the order status changed to created in the backend.
Couple of points. 1) There isn't any onAfterOrderUpdate. In fact none of the payment plugins have this function. (Only the history plugin). 1) I can't find the $email variable. Did you mean $order?
Thanks, James
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- jameswadsworth
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
If you have a payment plugin which is called requestaquote, you can just have such check in the order creation email:
if($data->order_payment_method=="requestaquote"){
echo 'mail content for a quote';
}else{
echo 'other mail content';
}
Please Log in or Create an account to join the conversation.
- jameswadsworth
-
Topic Author
- Offline
If the administrator changes the order status from 'quote' to 'created' will an email be sent automatically to the client?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- jameswadsworth
-
Topic Author
- Offline
I just have a couple of questions that may be you can help with me.
1) we don't have an image for the requestaquote payment plugin we have created. Current we have set
$element->payment_images = '';
However in IE there is always the horrible missing image icon. How can solve this little problem?
2) when the client requests a quote in the order history we first have order status 'created' then 'quotation'. Which is fine. We have changed the order_creation_notification email so that when the status is 'quotation' the text is different to created. Now when an administrator goes to the order with status 'quotation' and modifies the prices, adds the transport costs and other variations, how can we resend order_creation_notification email with all the modifications?
Thanks
Please Log in or Create an account to join the conversation.
In the zip file there are a png and gif versions
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
?>
<img src="<?php echo HIKASHOP_IMAGES .'payment/'. @$this->images_payment[$image];?>"/>
<?php
to:
if(!empty($image)){
?>
<img src="<?php echo HIKASHOP_IMAGES .'payment/'. @$this->images_payment[$image];?>"/>
<?php
}
in the file payment of the view checkout via the menu Display->Views.
2. You can't resend the order_created_notification. However, whenever you modify the status of an order, you can resend the order_status_notification.
Please Log in or Create an account to join the conversation.
- jameswadsworth
-
Topic Author
- Offline
I have another question. I have noticed that for all the payment plugins, the $element->payment_name and $element->payment_description are not language translatable. Is there a valid reason for this or can we add CText::_-('MYTEXT')? Any non-English sites then get presented on checkout with the payment name and description in English which is not ideal.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.