News:

Support the VirtueMart project and become a member

Main Menu

Order change status Notify User Email mot Include Comment

Started by Kousis-Underwear, July 19, 2024, 12:19:51 PM

Previous topic - Next topic

Kousis-Underwear

Hi, i noticed after the last update  that comments after change order status not included on clients email.
So if we want to change status to "Shipped" and include on comment the Tracking Number to inform client the comment is not included in the email!

VirtueMart 4.2.16 11030
Joomla! 4.4.6 Stable

Jumbo!

There is a bug in the recent VirtueMart releases that caused this problem. You can follow the steps below to fix it.

Open and edit - components/com_virtuemart/views/invoice/tmpl/mail_html_shopper.php

or override it in your template - templates/YOUR-TEMPLATE/html/com_virtuemart/invoice/mail_html_shopper.php

Find the following codes between lines 71 to 78:

  <?php $nb=count($this->orderDetails['history']);
  if(
$this->orderDetails['history'][$nb-1]->customer_notified && !(empty($this->orderDetails['history'][$nb-1]->comments))) { ?>

  <tr>
    <td colspan="3" align="left" style="border: 1px solid #CCCCCC;">
        <?php echo  nl2br($this->orderDetails['history'][$nb-1]->comments); ?>
    </td>
  </tr>
  <?php ?>

Replace the above by:

    <?php if (property_exists($this'newOrderData')) : ?>
        <?php if($this->newOrderData['customer_notified'] && !empty($this->newOrderData['comments'])) : ?>
            <tr>
                <td colspan="3" align="left" style="border: 1px solid #CCCCCC;">
                    <?php echo nl2br($this->newOrderData['comments']); ?>
                </td>
            </tr>
        <?php endif; ?>
    <?php else ?>
        <?php $nb count($this->orderDetails['history']); ?>
        <?php if($nb && $this->orderDetails['history'][$nb-1]->customer_notified && !empty($this->orderDetails['history'][$nb-1]->comments)) : ?>
            <tr>
                <td colspan="3" align="left" style="border: 1px solid #CCCCCC;">
                    <?php echo nl2br($this->orderDetails['history'][$nb-1]->comments); ?>
                </td>
            </tr>
        <?php endif; ?>
    <?php endif; ?>

Now, it should work fine.

Alternatively, you may want to consider using the VP Email Manager (https://www.virtueplanet.com/extensions/vp-email-manager). This tool not only resolves the issue but also provides advanced email management features.