VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Ventsi Genchev on May 16, 2019, 09:31:00 AM

Title: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 09:31:00 AM
VirtueMart 3.4.5 10057
VirtueMart 3.4.3.9975

No matter what setting is selected in a "Email shopper fields for shopper emails", an email is always sent to the user.
Only if the "Notify Shopper?" option is turned off in the order under "Update status" then it does not send an email. But then the order status of the frontend does not change, too, and the user can not see it.

For example, for a delivered order, I do not want to send an email to the user, but he must see this status when he views the information on the site.

Am I wrong in some setup?
Title: Re: Email order status to the user - always
Post by: AH on May 16, 2019, 10:03:46 AM
Remove ALL the status for which you do not require emails from the field

Default Order Status to send email to shopper    

Title: Re: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 10:18:09 AM
Where do you mean? The field in Update Status "all lines?"?
Because I tried with this field and there was no change. I do not even know what it serves.
Title: Re: Email order status to the user - always
Post by: jenkinhill on May 16, 2019, 10:29:48 AM
This config works for me

(https://i.ibb.co/yfs8Mwr/ordermail.jpg) (https://ibb.co/GxPV1Kq)
Title: Re: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 10:38:44 AM
Very strange. Any idea where to look for the problem?

By the way, the vendor settings have no problem.
Title: Re: Email order status to the user - always
Post by: StefanSTS on May 16, 2019, 10:49:46 AM
jenkinhill is showing the settings of the second tab "Orders" in VirtueMart configuration.
That's where you have to head to.

Regards
Stefan
Title: Re: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 10:59:11 AM
Yes, I know this place, but please read what I wrote at the top:

"No matter what setting is selected in a "Email shopper fields for shopper emails", an email is always sent to the user."
Title: Re: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 11:26:03 AM
Here's what I found:

/administrator/components/com_virtuemart/models/orders.php

If I remove "!" from this line:
if(!$this->useDefaultEmailOrderStatus and isset($vars['newOrderData']['customer_notified']) and $vars['newOrderData']['customer_notified']==1){

Everything works properly.
Title: Re: Email order status to the user - always
Post by: StefanSTS on May 16, 2019, 11:54:21 AM
I see your problem now.

In orders list, the tick is automatically removed if you set a new status which should not send emails.
In the order details view the tick is not automatically removed.

I guess there is some missing JS to do that.

So I confirm this bug or missing feature.

Removing the ! might cause some other unwanted problems, I haven't looked at that in detail, so you might want to test that further.

Regards
Stefan
Title: Re: Email order status to the user - always
Post by: Milbo on May 16, 2019, 12:39:08 PM
Thank you, good explanation. Makes sense. I take a look
Title: Re: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 12:43:33 PM
Quote from: StefanSTS on May 16, 2019, 11:54:21 AM
In orders list, the tick is automatically removed if you set a new status which should not send emails.
In the order details view the tick is not automatically removed.

No, removing the tick by default is not a solution. Much less often an internal note is needed without the client seeing the status.
If it is removed, it does not send an email and does not update the status in the history the client sees. It just leaves an internal comment, which is very good.

The line I showed is definitely wrong.

In this state she says: Send an email if the status is not in the "Default Order Status to send email to the shopper" and the tick is ON.

After removing "!": Send an email if the status is in "Default Order Status to send email to the shopper" and the tick is ON.

Otherwise, the customer always receives an email when the ticket is active (= 1).
Title: Re: Email order status to the user - always
Post by: StefanSTS on May 16, 2019, 16:02:47 PM
Quote from: Ventsi Genchev on May 16, 2019, 12:43:33 PM
No, removing the tick by default is not a solution. Much less often an internal note is needed without the client seeing the status.
If it is removed, it does not send an email and does not update the status in the history the client sees. It just leaves an internal comment, which is very good.

Removing the tick for the statusses automatically where you don't want emails to be sent, not by default, depending on the setting in VM config - Orders is wanted.
That it is not removed at the moment like in the orders list is a bug, and it is a solution for the general problem.

Title: Re: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 16:21:51 PM
I now understood you.

Please note that when the check mark is removed, the new order status is not visible to the user on the site.
So we may not want to send an email, but the status should be visible to the user. When not checked, it does not send an email, but the status is also not visible to the user too.

In my opinion, it is best:
1. If there is no check - only the administrator sees the status.
2. If checked, the status is visible to the user. If we choose to receive an email, he will also receive it.

So it's more functional than having a checkmark that just tells us what we've set up. And of course we can switch it directly.
Title: Re: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 16:42:25 PM
Yet let me give an example:

When we receive an order, we call the customer's phone for confirmation. If he does not respond - Status "Not Confirmed by Customer". (He receives an email.)
After we contact him and he confirms the order - Status "Confirmed". He does not receive an email because he does not need it. But when he enters the site and looks at the status, he is "Confirmed".

If we remove the tick, it will not receive an email, but the status will also be "Not Confirmed by Customer".

That's why I think the way I described above is better. We have a greater opportunity to work.
Title: Re: Email order status to the user - always
Post by: StefanSTS on May 16, 2019, 17:03:04 PM
Now I understood you too, I guess.

In the end there are two things you require (and that makes sense to me).

1. the old "send an email",
2. a new "show changed status to user",
which is at the moment two in one, if I understand that right. (I never used it this way, so I would have to test that).

So it would actually mean to add another checkbox to the three checkboxes that are there now.

I would also love to see an "add internal note" and "add comment for customer" in the order details to avoid mistakes by accidentally sending an internal note to the customer.


Title: Re: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 18:35:45 PM
Yes, absolutely. I'm glad I was able to explain what I mean.

I would like to ask you something else about the orders:

1. What is the "all lines" field for?

2. The "Purchase Order (Paid)" field is updated automatically after the "COM_VIRTUEMART_ORDER_STATUS_CONFIRMED" status.
This may be good when paying via Pepal. But there are other ways to pay - for example in cash.
Is there an opportunity to set when the green tick comes out?

Thank you and best regards
Title: Re: Email order status to the user - always
Post by: Jörgen on May 16, 2019, 19:11:49 PM
This functionality has been broken in some of the latest VM versions.

The functionalty was as follows.

Tick send to customer: Sends and email when You press  SAVE
Tick include komment: Comment is always saved and sent to customer if send to customer is ticked.
Tick Update status for all lines: Each order line can have each own status, I use it to cancel single lines in an order, I do not want this updated on statuschange.
Update mail was always sent on save.

New functionality:
Tick send to customer: Sends email only if this is ticked
Tick include comment: Comment is sent if ticked, comment not saved if not ticked and not send to customer ticked and new status (status must change)
Tick update status for all ines: As before I guess.

The new functionality is confusing to say at least, the old is easy to understand. Comment is always saved and sent when ticked send to customer, and You do not have to change status.

I have been using this for years and I use it when I communicate with my customers, keeps track of sent comments about the order.

My two cents

Jörgen @ Kreativ Fotografi

Title: Re: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 19:21:34 PM
I understand. Perhaps the broken configuration is a problem.

However, it is important that if the comment is ticked, even if no email is sent, the user can see it on the site.

And what do we do if we want an inner note?
Title: Re: Email order status to the user - always
Post by: StefanSTS on May 16, 2019, 19:48:22 PM
Quote from: Ventsi Genchev on May 16, 2019, 19:21:34 PM
However, it is important that if the comment is ticked, even if no email is sent, the user can see it on the site.
And what do we do if we want an inner note?

Well, I don't like that comment function there at all, it's totally user unfriendly.
The problem is, there is no customer relation system integrated, that would be a full new task to implement, that could be an extra extension.

So I have no customer who actively uses that comment system anymore, if I remember right, two tried it for some time for tracking codes and other stuff. They all use the confirmation mails now and reply there.

Please write a component and sell it to us.
Title: Re: Email order status to the user - always
Post by: Ventsi Genchev on May 16, 2019, 20:17:36 PM
I also use comments to write tracking codes. However, they are made to be used.  :)
Yes, there is a need for a component, but I do not have time for such projects.

But I did not mean the comments, but the status of the order.
At the moment the status and comment appear on a one tick and this has led to confusion in my writing.