VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: marcoj on April 17, 2012, 23:03:14 PM

Title: Include Order Status Description on email to client or...
Post by: marcoj on April 17, 2012, 23:03:14 PM
Hi guys,

I need help to solve something here

I want to include the order status description in the email sent to the client. I tried something like <?php echo JText::sprintf('COM_VIRTUEMART_MAIL_ORDER_STATUS',$this->orderDetails['details']['BT']->order_status_description) ; ?> on mail_html_shopper.php, but that didn't work.
Another option would be to detect the order status id or code and if it was equal to something show the content I want.

Any help on this?

Thanks in advance!
Title: Re: Include Order Status Description on email to client or...
Post by: slammy on July 02, 2012, 18:24:03 PM
Would appreciate any information on that too.
Title: Re: Include Order Status Description on email to client or...
Post by: loke on December 17, 2012, 10:21:12 AM
I solved this problem by editing two files.

The first file.
[mail_html_shopper.php] like you did.
<?php echo JText::sprintf('COM_VIRTUEMART_MAIL_ORDER_STATUS',$this->orderDetails['details']['BT']->order_status_description) ; ?>

and second file i edit was.
[orders.php] from the / administrator / components / com_virtuemart / models / orders.php on line 130 i changed

s.order_status_name
to
s.order_status_description

it can not print the order status name out now. but I've written order status name in the description field. I can now insert bank account and conditions for bank payment in a separate order status like pending. and choose to only customers who pay by bank transfer are the only ones who get information about bank transfer with bank account number and payment details for this kind of payment.
Title: Re: Include Order Status Description on email to client or...
Post by: majkelm on September 18, 2013, 13:55:20 PM
Maybe someone knows how to make these two parameters available ?
I'm trying but ....
Title: Re: Include Order Status Description on email to client or...
Post by: Maxim Pishnyak on September 18, 2013, 20:25:17 PM
Quote from: loke on December 17, 2012, 10:21:12 AM
[orders.php] from the / administrator / components / com_virtuemart / models / orders.php on line
Probably here?
Title: Re: Include Order Status Description on email to client or...
Post by: majkelm on October 02, 2013, 15:14:14 PM
i made it
in \administrator\components\com_virtuemart\models\orders.php line 179
// Get the order details
$q = "SELECT  u.*,o.*,
   s.order_status_name

changed to
// Get the order details
$q = "SELECT  u.*,o.*,
   s.order_status_name,
   s.order_status_description


now in \components\com_virtuemart\views\invoice\tmpl\mail_html_shopper.php
just added
<?php echo $this->orderDetails['details']['BT']->order_status_description ?>

Title: Re: Include Order Status Description on email to client or...
Post by: Maxim Pishnyak on October 03, 2013, 16:51:29 PM
Thank you for sharing.
Title: Re: Include Order Status Description on email to client or...
Post by: mahootshop on August 21, 2016, 15:28:57 PM
Quote from: majkelm on October 02, 2013, 15:14:14 PM
i made it
in \administrator\components\com_virtuemart\models\orders.php line 179
// Get the order details
$q = "SELECT  u.*,o.*,
   s.order_status_name

changed to
// Get the order details
$q = "SELECT  u.*,o.*,
   s.order_status_name,
   s.order_status_description


now in \components\com_virtuemart\views\invoice\tmpl\mail_html_shopper.php
just added
<?php echo $this->orderDetails['details']['BT']->order_status_description ?>

extra )  in your code
Title: Re: Include Order Status Description on email to client or...
Post by: GJC Web Design on August 21, 2016, 20:29:08 PM
corrected
Title: Re: Include Order Status Description on email to client or...
Post by: sirius on December 11, 2020, 18:59:43 PM
Hi all,
just an update to make it works ok with VM3.8.6

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

// 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
// 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

  <?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 ?>