News:

Looking for documentation? Take a look on our wiki

Main Menu

VM 2.0 and emails : confirmation emails

Started by Engel Joris, June 15, 2013, 09:14:18 AM

Previous topic - Next topic

Engel Joris

All,

Using VM 2.0.20b and J!2.5.11 and PHP 5.3.25.

Have been looking through this forum (and the wider internet of course) for a couple of hours now, and was not able to find the answers to my questions :
1. Where can I edit the subjects of the emails sent both to the vendor and the customer? I have found where to edit the mails themself, but I need to edit the subjects
    At this point, the subjects start with the [ordernumber] ... order total ....
   Where can I change this ? In what file ?

2. I want to do disable the emails to the vendor when the status of an order is changed.
    I found this code on this page : http://www.artio.net/faqs/vm-invoice/how-to-disable-virtuemart-order-e-mails-and-invoices
   
    open file JOOMLA_ROOT/components/com_virtuemart/helpers/shopfunctionsf.php

    Find line 243 (can differ depends on your version of VM)
    Important is, replace line
    $user= self::sendVmMail($view, $recipient,$noVendorMail);

    with
    //edied: ARTIO: disable initial e-mail to customer. send only to vendor.
    if ($viewName=='invoice' AND in_array($vars['orderDetails']['details']['BT']->order_status, array('P','U')))
     $user = null;
    else
     $user= self::sendVmMail($view, $recipient,$noVendorMail);

    Open file JOOMLA_ROOT /administrator/components/com_virtuemart/models/orders.php
    Find line 1290  (can differ depends on your version of VM)

    And replace

    // Send the email
    if (shopFunctionsF::renderMail('invoice', $order['details']['BT']->email, $vars, null,$vars['doVendor'])) {
    ...

    with

    // Send the email
    $res = shopFunctionsF::renderMail('invoice', $order['details']['BT']->email, $vars, null,$vars['doVendor']);
    if ($res===null) //edited: ARTIO: when sent to customer disabled, dont display message.
    return true;

    if ($res) {
    ...

This option will disable initial "pending order" E-mail. However, customer will get e-mails if you keep checked "notify customer" option when changing order status. If you want to disable e-mails also for other statuses, don't check ,,notify customer" or edit condition in point 1 like: 


... array('P','U' /* other statuses: */, 'P','S') ...




Wich I tried to change a bit into :
//edited:JEWEP: disable statusupdate e-mail to vendor. send only to customer. original code : ARTIO
if ($viewName=='invoice' AND in_array($vars['orderDetails']['details']['BT']->order_status, array('P','X','R','S')))
$user = null;
else
$user= self::sendVmMail($view, $recipient,$noVendorMail);
if (isset($view->doVendor) && !$recipient) {
self::sendVmMail($view, $view->vendorEmail, TRUE);
}
return $user ;

}


But this does not work. I think I messed up somewhere :-)
The idea is that the vendor only gets the confirmation email on status 'U', but the customer of course needs to get all of the emails upon changes on the status order.


Thanks for any and all replies in this matter....
;)




jenkinhill

1. The subject line is assembled from a language string COM_VIRTUEMART_MAIL_SUBJ_SHOPPER_x  and some variables in components/com_virtuemart/views/invoice/view-html.php
See http://forum.virtuemart.net/index.php?topic=116224.msg392456#msg392456  Problem is that you can easily override the language string but not view-html.php - although you could try this to avaoid a core edit: http://stackoverflow.com/questions/13763539/overriding-joomla-core-component-file

2. In the next VM version:



[attachment cleanup by admin]
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Engel Joris

hey jenkinhill,

Thanks for the fast reply.
Will try your reply on question 1. tomorrow.

When would the next version of VM be released?


Thanks for your endless efforts !

drukman2000

Quote from: Engel Joris on June 15, 2013, 09:14:18 AM
All,

Using VM 2.0.20b and J!2.5.11 and PHP 5.3.25.

Have been looking through this forum (and the wider internet of course) for a couple of hours now, and was not able to find the answers to my questions :
1. Where can I edit the subjects of the emails sent both to the vendor and the customer? I have found where to edit the mails themself, but I need to edit the subjects
    At this point, the subjects start with the [ordernumber] ... order total ....
   Where can I change this ? In what file ?

2. I want to do disable the emails to the vendor when the status of an order is changed.
    I found this code on this page : http://www.artio.net/faqs/vm-invoice/how-to-disable-virtuemart-order-e-mails-and-invoices
   
    open file JOOMLA_ROOT/components/com_virtuemart/helpers/shopfunctionsf.php

    Find line 243 (can differ depends on your version of VM)
    Important is, replace line
    $user= self::sendVmMail($view, $recipient,$noVendorMail);

    with
    //edied: ARTIO: disable initial e-mail to customer. send only to vendor.
    if ($viewName=='invoice' AND in_array($vars['orderDetails']['details']['BT']->order_status, array('P','U')))
     $user = null;
    else
     $user= self::sendVmMail($view, $recipient,$noVendorMail);

    Open file JOOMLA_ROOT /administrator/components/com_virtuemart/models/orders.php
    Find line 1290  (can differ depends on your version of VM)

    And replace

    // Send the email
    if (shopFunctionsF::renderMail('invoice', $order['details']['BT']->email, $vars, null,$vars['doVendor'])) {
    ...

    with

    // Send the email
    $res = shopFunctionsF::renderMail('invoice', $order['details']['BT']->email, $vars, null,$vars['doVendor']);
    if ($res===null) //edited: ARTIO: when sent to customer disabled, dont display message.
    return true;

    if ($res) {
    ...

This option will disable initial "pending order" E-mail. However, customer will get e-mails if you keep checked "notify customer" option when changing order status. If you want to disable e-mails also for other statuses, don't check ,,notify customer" or edit condition in point 1 like: 


... array('P','U' /* other statuses: */, 'P','S') ...




Wich I tried to change a bit into :
//edited:JEWEP: disable statusupdate e-mail to vendor. send only to customer. original code : ARTIO
if ($viewName=='invoice' AND in_array($vars['orderDetails']['details']['BT']->order_status, array('P','X','R','S')))
$user = null;
else
$user= self::sendVmMail($view, $recipient,$noVendorMail);
if (isset($view->doVendor) && !$recipient) {
self::sendVmMail($view, $view->vendorEmail, TRUE);
}
return $user ;

}


But this does not work. I think I messed up somewhere :-)
The idea is that the vendor only gets the confirmation email on status 'U', but the customer of course needs to get all of the emails upon changes on the status order.


Thanks for any and all replies in this matter....
;)




Hi,
Any idea what is 'BT' in the code above ?
It also appears in the email sent to vendor after a user registration & if not needed I want to remove it.
Thanks - Drukman.

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

AH

QuoteI want to do disable the emails to the vendor when the status of an order is changed.
    I found this code on this page : http://www.artio.net/faqs/vm-invoice/how-to-disable-virtuemart-order-e-mails-and-invoices

An upgrade to 2.0.22b will allow you by configuration to determine by order status e-mail activity
vendor/customer - neither, either or both for each status
Regards
A

Joomla 4.4.5
php 8.1

drukman2000

Quote from: jenkinhill on July 17, 2013, 11:23:51 AM
BT = Billing address  (Bill To)
Thanks,
It appears in the email sent to vendor but I couldn't find it in any of the .ini files.
Is it possible to translate it & where should the translation go ?
Thanks - Drukman.