VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: welrachid on April 21, 2016, 10:47:37 AM

Title: adding extra field info in email sent to shop-owner
Post by: welrachid on April 21, 2016, 10:47:37 AM
Hi
How do i let an extra user field be included in an email sent to the shop owner?
This is a required field during checkout that contains a name and i want that name to appear in the email-body sent to the owner of shop.

Thanks!
Title: Re: adding extra field info in email sent to shop-owner
Post by: GJC Web Design on April 21, 2016, 18:36:32 PM
does it not just show up?

check in com_virtuemart\views\invoice\mail_html_shopperaddresses.php
Title: Re: adding extra field info in email sent to shop-owner
Post by: welrachid on May 02, 2016, 10:07:03 AM
Hi
Thanks for your answer, and sorry for the delayed response.

So it appears that the field MUST be
"Show in shipment form" or
"Show in account maintenance"

What i want is that people put in this text under checkout (therefore i have it "Show in cart form") and only there.
I dont want people to be able to edit this field when editing their own.
I want it to "act" like the "notes and special requests" field.
Title: Re: adding extra field info in email sent to shop-owner
Post by: GJC Web Design on May 02, 2016, 10:24:09 AM
Yes.. as u discovered natively this isn't possible

I either hide it with css in the address and account or don't display it there by de-selecting it in the display loops
Title: Re: adding extra field info in email sent to shop-owner
Post by: welrachid on May 02, 2016, 11:11:32 AM
Okay.
Thanks for help.

I've added in mail_html_shopper.php:77
  <?php if(isset($this->orderDetails['details']['BT']->reference) && !empty($this->orderDetails['details']['BT']->reference)){ ?>
  <tr>
    <td colspan="3">
      Reference:<br>
      <?php echo nl2br($this->orderDetails['details']['BT']->reference); ?>

   </td>
  </tr>
  <?php } ?>


and in invoice_order.php:80
<?php if (isset($this->orderDetails['details']['BT']->reference) && $this->orderDetails['details']['BT']->reference) { ?>
    <tr>
    <td>Reference</td>
    <td valign="top" align="left" width="50%"><?php echo $this->orderDetails['details']['BT']->reference; ?></td>
</tr>
<?php } ?>


just for future visitors of this thread.
Title: Re: adding extra field info in email sent to shop-owner
Post by: welrachid on May 02, 2016, 11:11:54 AM
where "reference" is my fields name.