Post by charleyvtl88 » Fri Oct 02, 2020 10:40 pm

Hi all,

I've installed OpenCart 3.0.3.3 and when you place an order, it sends the confirmation already before making the payment.
That's very confusing, since the client then will receive a message that we have received this order.

In all payment extensions I have indicated that the order should only get the status Payment accepted when the payment is done.
OpenCart should then only send email when this order status is reached.

Is it possible to fill in a code that the confirmation mail only is being sent when the order has a specific order status (like 17? Payment accepted) and that in other cases there is no mail being sent? I've tried to edit somehow in catalog/controller/mail/order.php but without success.

Hope someone could help me!

Newbie

Posts

Joined
Fri Oct 02, 2020 10:34 pm
Location - The Netherlands

Post by OSWorX » Sat Oct 03, 2020 1:13 am

charleyvtl88 wrote:
Fri Oct 02, 2020 10:40 pm
In all payment extensions I have indicated that the order should only get the status Payment accepted when the payment is done.
OpenCart should then only send email when this order status is reached.
That's the way OpenCart works per default.
charleyvtl88 wrote:
Fri Oct 02, 2020 10:40 pm
.. other cases .. not sending ..
Which other cases?
There are many stores having not to wait for the payment, for example "Payment per Bank" or "Cash on Delivery".
But the customer has to informed that his order is placed successfully - required by Law.

And it depends also on the way the Webstore works.
For some the "Order" is only a order when the Webstore confirms that.
For others it is a Order when the customer hits the last button.
Both ways are possible and allowed.

So, what are your "Requirements"?

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by charleyvtl88 » Sat Oct 03, 2020 1:42 am

The strange thing is that the previous version of this which I have build in OpenCart 1.5 many years ago only sent the email after payment.

Anyway, in this webshop the order is only placed after you have made the payment. So it's not possible and it won't be possible ever to pay by bank transfer or some other payment that can be made after placing the order.
Because we will use a shipping connection, the only time the customer must be informed by mail is when he/she has placed an order and succesfully paid. All other mails will be mailed directly from the shipping connection.

So I would like to set up that Opencart only sends an email when the order has got the order status Payment accepted. Is that possible?

Newbie

Posts

Joined
Fri Oct 02, 2020 10:34 pm
Location - The Netherlands

Post by sw!tch » Sat Oct 03, 2020 2:05 am

It's possible. In OC 3.0.x series mail is handled via event.

You can see some reference with the following line - https://github.com/opencart/opencart/bl ... er.php#L32

You would probably need to handle some additional logic as well for when you update the order status in the backend.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Location - USA

Post by charleyvtl88 » Sat Oct 03, 2020 2:13 am

Thank you. :)

I've seen that line, but I don't know how to modify it to set up that it only mails when order status is Payment accepted (in my shop order status 17).
Is this easy to realize?

Newbie

Posts

Joined
Fri Oct 02, 2020 10:34 pm
Location - The Netherlands

Post by OSWorX » Sat Oct 03, 2020 3:32 am

charleyvtl88 wrote:
Sat Oct 03, 2020 1:42 am
Anyway, in this webshop the order is only placed after you have made the payment. So it's not possible and it won't be possible ever to pay by bank transfer or some other payment that can be made after placing the order.
Because we will use a shipping connection, the only time the customer must be informed by mail is when he/she has placed an order and succesfully paid. All other mails will be mailed directly from the shipping connection.
Well, if that is your business case and requirement then it is.
I for myself would never buy in such a shop where I have to pay upfront and never know what I have bought at the end.
And maybe such business is allowed in China, India, some Ilses and somewhere.
For sure not in Europe!
charleyvtl88 wrote:
Sat Oct 03, 2020 1:42 am
So I would like to set up that Opencart only sends an email when the order has got the order status Payment accepted. Is that possible?
As another already mentioned, yes is possible.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by OSWorX » Sat Oct 03, 2020 3:34 am

charleyvtl88 wrote:
Sat Oct 03, 2020 2:13 am
I've seen that line, but I don't know how to modify it to set up that it only mails when order status is Payment accepted (in my shop order status 17).
Is this easy to realize?
Also yes,
Simply post a request in the Official Commercial Support Forum and hire someone there.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by charleyvtl88 » Sat Oct 03, 2020 3:52 am

OSWorX wrote:
Sat Oct 03, 2020 3:32 am
I for myself would never buy in such a shop where I have to pay upfront and never know what I have bought at the end.
And maybe such business is allowed in China, India, some Ilses and somewhere.
For sure not in Europe!
Such business is allowed in Europe: the Netherlands, Germany, Belgium, France, etc. You pay upfront and if you're not satisfied with your products, you can get a refund. Didn't knew that this isn't allowed in Austria?

OSWorX wrote:
Sat Oct 03, 2020 3:32 am
As another already mentioned, yes is possible.
I will post it at the Commercial Support Section.

Newbie

Posts

Joined
Fri Oct 02, 2020 10:34 pm
Location - The Netherlands

Post by OSWorX » Sat Oct 03, 2020 4:45 am

charleyvtl88 wrote:
Sat Oct 03, 2020 3:52 am
OSWorX wrote:
Sat Oct 03, 2020 3:32 am
I for myself would never buy in such a shop where I have to pay upfront and never know what I have bought at the end.
And maybe such business is allowed in China, India, some Ilses and somewhere.
For sure not in Europe!
Such business is allowed in Europe: the Netherlands, Germany, Belgium, France, etc. You pay upfront and if you're not satisfied with your products, you can get a refund. Didn't knew that this isn't allowed in Austria?
And how do you confirm the purchase?
Send a carrier pigeon?

As former said, 2 types of Business are allowed in Europe:
1. customer confirm order, but the purchase is NOT VALID BEFORE the Webstore confirmes that after hitting the last button
2. customer confirm order, purchase is immediately valid the moment he hits the last button

In both cases you have to send a confirmation!

But if you know more, I am always willing to learn.
Just show me the written Legal text.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by ADD Creative » Sat Oct 03, 2020 5:51 am

charleyvtl88 wrote:
Sat Oct 03, 2020 1:42 am
The strange thing is that the previous version of this which I have build in OpenCart 1.5 many years ago only sent the email after payment.

Anyway, in this webshop the order is only placed after you have made the payment. So it's not possible and it won't be possible ever to pay by bank transfer or some other payment that can be made after placing the order.
Because we will use a shipping connection, the only time the customer must be informed by mail is when he/she has placed an order and succesfully paid. All other mails will be mailed directly from the shipping connection.

So I would like to set up that Opencart only sends an email when the order has got the order status Payment accepted. Is that possible?
What payment module are you using? I know the logic in some of them will (probably wrongly) set an order status when payment has failed, others won't.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by charleyvtl88 » Sat Oct 03, 2020 5:53 am

OSWorX wrote:
Sat Oct 03, 2020 4:45 am
charleyvtl88 wrote:
Sat Oct 03, 2020 3:52 am
OSWorX wrote:
Sat Oct 03, 2020 3:32 am
I for myself would never buy in such a shop where I have to pay upfront and never know what I have bought at the end.
And maybe such business is allowed in China, India, some Ilses and somewhere.
For sure not in Europe!
Such business is allowed in Europe: the Netherlands, Germany, Belgium, France, etc. You pay upfront and if you're not satisfied with your products, you can get a refund. Didn't knew that this isn't allowed in Austria?
And how do you confirm the purchase?
Send a carrier pigeon?

As former said, 2 types of Business are allowed in Europe:
1. customer confirm order, but the purchase is NOT VALID BEFORE the Webstore confirmes that after hitting the last button
2. customer confirm order, purchase is immediately valid the moment he hits the last button

In both cases you have to send a confirmation!

But if you know more, I am always willing to learn.
Just show me the written Legal text.
I guess you don't quite understand it when I read your reaction "send a carrier pigeon".
I would have preferred just a (paid) solution instead of this discussion, but maybe I should clear things up a bit for you:

What happens now with the actual situation:
1. Someone want to buy some products, put it in their cart, fill in their details and click on button "confirm order and go to payment".
When they click on that button, the system sends already the confirmation mail to the buyer and an alert to the store owner that there is a new order.
Then there will be some possibilities:
A. The buyer completes the payment and the payment has been made: perfect
B. The buyer doens't complete the payment or the payment is failing or the card is not working or whatever any other reason the payment fails.

In case A there is no problem. In case B there is: because the confirmation mail with "Thank you for your order" has been sent already to the customer! And he didn't have paid.

And I understand that you say: when you click on "confirm order" the order is confirmed. But I want to postpone this confirmation until also the payment has been made. So that you confirm your order with your payment and not by clicking only on the button.

Because in case B there will be a lot of trouble when that mail has been already sent:
- the customer is confused: have I paid or not?
- the store owner is confused: do I have a new order? No I don't see a payment?

And the customer doesn't have the possibility to pay at a later moment so the unpaid order is useless.

To make sure that there will not be a lot of trouble, it's better when the system only sends an email after the payment is successfull. In that case:
- the customer knows he have paid correctly and that the order will be processed
- the store owner knows that the order can be put through for orderpick and that the shipping information can be sent to the shipping company.

So I don't think I'm asking for something strange? I just want to send the confirmation mail just a little bit later, after the customer has finished the payment.

And it's not that other webshops are not using the same method: if I buy train tickets online or when I buy something on Amazon, I'm not getting any order confirmation mail when I click to pay and then cancel. I only get the confirmation mail after I have succesfully paid..

Newbie

Posts

Joined
Fri Oct 02, 2020 10:34 pm
Location - The Netherlands

Post by ADD Creative » Sat Oct 03, 2020 5:59 am

charleyvtl88 wrote:
Sat Oct 03, 2020 5:53 am
What happens now with the actual situation:
1. Someone want to buy some products, put it in their cart, fill in their details and click on button "confirm order and go to payment".
When they click on that button, the system sends already the confirmation mail to the buyer and an alert to the store owner that there is a new order.
That is not how OpenCart works. That behavior is either the result of some modification/extension or poor logic of the payment module you are using.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by charleyvtl88 » Sat Oct 03, 2020 6:11 am

ADD Creative wrote:
Sat Oct 03, 2020 5:51 am
What payment module are you using? I know the logic in some of them will (probably wrongly) set an order status when payment has failed, others won't.
I'm using iDeal, VISA, Mastercard (from iDeal-Checkout.nl) and PayPal (from PayPal Commerce Platform).
When you use PayPal, it uses the PayPal buy button and that works fine, when you use the first 3, you use the Confirm button from OpenCart.
As soon as you click on that button, it sends a confirmation mail to the customer and it doens't wait to check if the user finishes the payment.

Newbie

Posts

Joined
Fri Oct 02, 2020 10:34 pm
Location - The Netherlands

Post by ADD Creative » Sat Oct 03, 2020 6:29 am

Just have a really quick look at the source code for that module and it does seen to call addOrderHistory even before it redirects the customer to the payment page. Try asking their support.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by charleyvtl88 » Sat Oct 03, 2020 6:33 am

ADD Creative wrote:
Sat Oct 03, 2020 6:29 am
Just have a really quick look at the source code for that module and it does seen to call addOrderHistory even before it redirects the customer to the payment page. Try asking their support.
Thank you for your message! Will do that.

Newbie

Posts

Joined
Fri Oct 02, 2020 10:34 pm
Location - The Netherlands

Post by charleyvtl88 » Sat Oct 03, 2020 6:56 am

charleyvtl88 wrote:
Sat Oct 03, 2020 6:33 am
ADD Creative wrote:
Sat Oct 03, 2020 6:29 am
Just have a really quick look at the source code for that module and it does seen to call addOrderHistory even before it redirects the customer to the payment page. Try asking their support.
Thank you for your message! Will do that.
I've looked just in these files and when I turned the AddOrderHistory for pending payments off and only let it on for success payments, it works as it should be.
So thank you very much ADD Creative! ;D

Newbie

Posts

Joined
Fri Oct 02, 2020 10:34 pm
Location - The Netherlands

Post by letxobnav » Sat Oct 03, 2020 9:04 am

I would have just changed the catalog/controller/mail/order.php controller, function add($order_info, $order_status_id, $comment, $notify).
There you could just decide to not send the mail given the order status.
This because addOrderHistory does more than just send a mail, that mail is just triggered via the before-event while the mentioned function does just do that, send the customer order confirmation mail (not delivery confirmation) and possible alerts when adding an order.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: EMGX and 18 guests