Author Topic: Include order status description in notification email  (Read 784 times)

AzMandius

  • Jr. Member
  • **
  • Posts: 57
  • AzBlog.me | Mentally healthy content & lnks.
    • Eugen G. Blog
  • Skype Name: az0000000
Include order status description in notification email
« on: February 10, 2016, 12:16:01 pm »
Hello,
Joomla! 2.5.18 & VirtueMart 2.0.26 here.

I need to include specified comments on banking details in order status in email sent to customer.
I tried to accomplish this by applying this method:
editing two files:
The first file.
[mail_html_shopper.php]
Code: [Select]
<?php echo JText::sprintf('COM_VIRTUEMART_MAIL_ORDER_STATUS',$this->orderDetails['details']['BT']->order_status_description) ; ?>
and second file
[orders.php] from the / administrator / components / com_virtuemart / models / orders.php on line 130 i changed

Code: [Select]
s.order_status_name to
Code: [Select]
s.order_status_description
Thread link: http://forum.virtuemart.net/index.php?topic=101447.msg373035#msg373035

Unfortunately it did not work, order status space simply empty now in email.

I tried to include my personalized comments into the status name, but taht field is limited to certain number of characters, so lifting up that limit would be another solution.

Any help appreciated,
Thank you!
AzBlog.me | Mentally healthy content & lnks.

sirius

  • Jr. Member
  • **
  • Posts: 63
    • OCTeam
  • VirtueMart Version: 3.8.6
Re: Include order status description in notification email
« Reply #1 on: December 11, 2020, 18:53:54 pm »
Hi all,
just an update to make it works with VM3.8.6

in /administrator/components/com_virtuemart/models/orders.php line 229

Code: [Select]
// Get the order details
$q = "SELECT  o.*, o.created_on as order_created, o.modified_on as order_modified, u.*, s.order_status_name
changed to
Code: [Select]
// Get the order details
$q = "SELECT  o.*, o.created_on as order_created, o.modified_on as order_modified, u.*, s.order_status_name, s.order_status_description

now in /components/com_virtuemart/views/invoice/tmpl/mail_html_shopper.php

Between line 75 and 76 just added

Code: [Select]
  <?php if(!empty($this->orderDetails['details']['BT']->order_status_description)){ ?>
  <tr>
    <td colspan="3" align="left" style="border: 1px solid #CCCCCC;">
<?php echo nl2br(html_entity_decode($this->orderDetails['details']['BT']->order_status_description)); ?>
    </td>
  </tr>
  <?php ?>
J3.9.24 | PHP7.4.13 + APC + Opcode

AzMandius

  • Jr. Member
  • **
  • Posts: 57
  • AzBlog.me | Mentally healthy content & lnks.
    • Eugen G. Blog
  • Skype Name: az0000000
Re: Include order status description in notification email
« Reply #2 on: December 11, 2020, 21:59:05 pm »
Nice! Thanks!
AzBlog.me | Mentally healthy content & lnks.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3358
  • VirtueMart Version: 3.8.8
Re: Include order status description in notification email
« Reply #3 on: December 12, 2020, 10:25:09 am »
sirius - nice :-)

Not wanting to be rude - but maybe simpler to get all orderstates data

Code: [Select]
$q = "SELECT  o.*, o.created_on as order_created, o.modified_on as order_modified, u.*, s.*
I will suggest to core - to see if we can stop having to override this at every VM update
regards
A

Joomla 3.9.23
php 7.3