Author Topic: adding extra field info in email sent to shop-owner  (Read 701 times)

welrachid

  • Jr. Member
  • **
  • Posts: 260
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
adding extra field info in email sent to shop-owner
« 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!
Best regards,
Wel

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8828
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: adding extra field info in email sent to shop-owner
« Reply #1 on: April 21, 2016, 18:36:32 pm »
does it not just show up?

check in com_virtuemart\views\invoice\mail_html_shopperaddresses.php
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

welrachid

  • Jr. Member
  • **
  • Posts: 260
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: adding extra field info in email sent to shop-owner
« Reply #2 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.
Best regards,
Wel

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8828
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: adding extra field info in email sent to shop-owner
« Reply #3 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

welrachid

  • Jr. Member
  • **
  • Posts: 260
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: adding extra field info in email sent to shop-owner
« Reply #4 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.
Best regards,
Wel

welrachid

  • Jr. Member
  • **
  • Posts: 260
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: adding extra field info in email sent to shop-owner
« Reply #5 on: May 02, 2016, 11:11:54 am »
where "reference" is my fields name.
Best regards,
Wel