Page 1 of 1

How can I set a predefined comment on setting an Order status

Posted: Sun Nov 04, 2018 6:59 pm
by urdubazaronline
Hello. I need to set a predefined comment on changing the order status. E.g I have an order status "Out for delivery" , so when i set this status, comment field should populate with a predefined comment.

Re: How can I set a predefined comment on setting an Order status

Posted: Tue Nov 06, 2018 5:38 am
by straightlight
No OC version posted. Forum rules.

Re: How can I set a predefined comment on setting an Order status

Posted: Tue Nov 06, 2018 6:04 am
by thekrotek
By default there's no such functionality, so the only way to achieve this is with custom modification. For starters, Try to search the Marketplace for one. Task seems pretty trivial to me.

Re: How can I set a predefined comment on setting an Order status

Posted: Tue Nov 06, 2018 11:12 am
by urdubazaronline
Opencart version is 2.03

Re: How can I set a predefined comment on setting an Order status

Posted: Tue Nov 06, 2018 12:35 pm
by IP_CAM
Well, for OC v.1.5.6.x Versions, this nice-n-easy VqMod achieved something like
this, and it could possibly be made work in your Version too, if you have a little
knowledge on such.
Good Luck! ;)
Ernie
---
admin_order_status_notify_comment.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id><![CDATA[Admin Order Status Notify Comment]]></id>
<version><![CDATA[OS v.1.5.6.5]]></version>
<vqmver><![CDATA[2.4.1]]></vqmver>
<author><![CDATA[hakim_jz]]></author>

<file name="admin/view/template/sale/order_info.tpl">
<operation error="log">
<search position="after"><![CDATA[<td><textarea name="comment" cols="40" rows="8" style="width: 99%"></textarea>]]></search>
<add><![CDATA[			
<div style="margin-top: 10px;">
<a id="button-template-notify-a" class="button">A Comment</a>&nbsp;
<a id="button-template-notify-b" class="button">B Comment</a>&nbsp;
<a id="button-template-notify-c" class="button">C Comment</a>&nbsp;
<a id="button-template-notify-d" class="button">D Comment</a>&nbsp;
<a id="button-template-notify-e" class="button">E Comment</a>
<script type="text/javascript"><!--
	$('#button-template-notify-a').live('click', function() {
	var template_msg = 'Dear <?php echo $firstname; ?> <?php echo $lastname; ?>,\n\nThis is the  message A you need to replace\n\nThank You';
	$('textarea[name=\'comment\']').val(template_msg);
	});
						
	$('#button-template-notify-b').live('click', function() {
	var template_msg = 'Dear <?php echo $firstname; ?> <?php echo $lastname; ?>,\n\nThis is the  message B you need to replace\n\nThank You';
	$('textarea[name=\'comment\']').val(template_msg);
	});
					
	$('#button-template-notify-c').live('click', function() {
	var template_msg = 'Dear <?php echo $firstname; ?> <?php echo $lastname; ?>,\n\nThis is the  message C you need to replace\n\nThank You';
	$('textarea[name=\'comment\']').val(template_msg);
	});
					
	$('#button-template-notify-d').live('click', function() {
	var template_msg = 'Dear <?php echo $firstname; ?> <?php echo $lastname; ?>,\n\nThis is the  message D you need to replace\n\nThank You';
	$('textarea[name=\'comment\']').val(template_msg);
	});
				
	$('#button-template-notify-e').live('click', function() {
	var template_msg = 'Dear <?php echo $firstname; ?> <?php echo $lastname; ?>,\n\nThis is the  message E you need to replace\n\nThank You';
	$('textarea[name=\'comment\']').val(template_msg);
	});
//--></script>
</div>
]]></add>
</operation>	
</file>	
</modification>
---
Image

Re: How can I set a predefined comment on setting an Order status

Posted: Tue Nov 06, 2018 3:57 pm
by xxvirusxx
And with small changes, work on 3.0.2.0