VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: xamonix on November 27, 2016, 19:03:02 PM

Title: Set a default message for order status "Confirmed"
Post by: xamonix on November 27, 2016, 19:03:02 PM
Hi guys

Which files should I edit to set a default message on order update status "Confirmed"?
More specifically, I want to set a default message, so everytime I change the order status to "Confirmed" there is no need to type the same message over and over again.
I only need to know wich files should I edit.
Thank you for your help.

Joomla: 2.5
Virtuemart: 2.6.8
Title: Re: Set a default message for order status "Confirmed"
Post by: GJC Web Design on November 28, 2016, 10:04:00 AM
add directly in the

<textarea rows="6" cols="35" name="comments"></textarea>

administrator\components\com_virtuemart\views\orders\tmpl\order_editstatus.php
Title: Re: Set a default message for order status "Confirmed"
Post by: xamonix on November 28, 2016, 21:50:45 PM
No... it doesn't work that way.
This is the code I'm trying to implemnet:

<?php
        $confirmed 
"We received your order's payment confirmation.";
        if (
$order_status_name "Confirmed"
        {
        echo 
"<textarea rows='6' cols='35' name='comments'>"$confirmed."</textarea>";
}
?>


Somehow Virtuemart seems to ignore the text  when I try to set the text directly (no php) between <textarea> tags.
Any other solution? Thanks anyway.
Title: Re: Set a default message for order status "Confirmed"
Post by: Studio 42 on November 29, 2016, 01:49:38 AM
Hi,
Perhaps a better idea is to overide this file : ROOT\components\com_virtuemart\views\invoice\tmpl\mail_html_shopper.php
And do the changes near
line <?php echo  nl2br($this->orderDetails['history'][$nb-1]->comments); ?>
Title: Re: Set a default message for order status "Confirmed"
Post by: xamonix on November 29, 2016, 02:32:37 AM
Hummm... not sure about your sugestion.
I want to send the message at the same time I update the order. So, if I update the order to "confirmed" the message is sent  away.  The file you sugested to edit seems to read data from the database, so there is no chance to send anything at all. Correct me if I'm wrong!
Thanks for your time...
Title: Re: Set a default message for order status "Confirmed"
Post by: Studio 42 on November 29, 2016, 03:49:05 AM
This load comment, but what you add is the comment in the database, and this get send to the user.

So you can for eg, check the statut = confirmed(or other) + comment empty or not, and if it's empty, add your own comment(and why not using a language key for multilanguage sites)