Post by vaidyamanishjoshi » Tue Apr 27, 2021 5:06 pm

I am using v 3.0.3.0

I have created extra order status as PaymentDone. order get updated to this status when user make payment successfully.

So I want to disable email triggering to admin and customer before making payment successfully....

pending status id = 1
Last edited by vaidyamanishjoshi on Tue Apr 27, 2021 6:16 pm, edited 1 time in total.

New member

Posts

Joined
Tue Jun 09, 2015 2:47 am

Post by thekrotek » Tue Apr 27, 2021 5:15 pm

What? Couldn't be more confusing.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by paulfeakins » Wed Apr 28, 2021 6:14 pm

thekrotek wrote:
Tue Apr 27, 2021 5:15 pm
What? Couldn't be more confusing.
Indeed :laugh:

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by straightlight » Wed Apr 28, 2021 7:35 pm

vaidyamanishjoshi wrote:
Tue Apr 27, 2021 5:06 pm
I am using v 3.0.3.0

I have created extra order status as PaymentDone. order get updated to this status when user make payment successfully.

So I want to disable email triggering to admin and customer before making payment successfully....

pending status id = 1
In catalog/controller/mail/order.php file,

find all instances of:

Code: Select all

$mail = new Mail($this->config->get('config_mail_engine'));
Add above:

Code: Select all

if (!in_array($order_info['order_status_id'], array_merge($this->config->get('config_processing_status'), $this->config->get('config_complete_status'))) && in_array($order_status_id, array_merge($this->config->get('config_processing_status'), $this->config->get('config_complete_status')))) {		
Then, find all instances of:

Code: Select all

$mail->send();
Add after:

Code: Select all

}

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by vaidyamanishjoshi » Thu Apr 29, 2021 10:22 pm

straightlight wrote:
Wed Apr 28, 2021 7:35 pm
vaidyamanishjoshi wrote:
Tue Apr 27, 2021 5:06 pm
I am using v 3.0.3.0

I have created extra order status as PaymentDone. order get updated to this status when user make payment successfully.

So I want to disable email triggering to admin and customer before making payment successfully....

pending status id = 1
In catalog/controller/mail/order.php file,

find all instances of:

Code: Select all

$mail = new Mail($this->config->get('config_mail_engine'));
Add above:

Code: Select all

if (!in_array($order_info['order_status_id'], array_merge($this->config->get('config_processing_status'), $this->config->get('config_complete_status'))) && in_array($order_status_id, array_merge($this->config->get('config_processing_status'), $this->config->get('config_complete_status')))) {		
Then, find all instances of:

Code: Select all

$mail->send();
Add after:

Code: Select all

}
Thank you for support.
I tried above solution, but unfortunately it didn't work.

Basically I want to disable email to admin and customer when during checkout, user clicks 'Continue' (Beside accept term and conditions checkbox), order get added with order status pending.

Then when user confirms order and pay successfully, email should be triggered to customer and admin.

New member

Posts

Joined
Tue Jun 09, 2015 2:47 am

Post by OSWorX » Thu Apr 29, 2021 11:44 pm

vaidyamanishjoshi wrote:
Thu Apr 29, 2021 10:22 pm
Basically I want to disable email to admin and customer when during checkout, user clicks 'Continue' (Beside accept term and conditions checkbox), order get added with order status pending.

Then when user confirms order and pay successfully, email should be triggered to customer and admin.
This is a description of how a default OpenCart installation works.

While "pay successfully" depends on the selected payment method, because if it is for example COD, the order is made and the payment will arrive later.
In all cases the order email has to be sent, as this is required by Law (at least in the European Community, don't know where you have your business) - as it is the order confirmation (without the order will not be legal).

Now if you think you do not want this (because of some unknown reasons), a solution is already provided above.
You say:
I tried above solution, but unfortunately it didn't work.
A very vague statement, what did not work?

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


User avatar
Guru Member

Posts

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

Post by vaidyamanishjoshi » Fri Apr 30, 2021 12:10 am

OSWorX wrote:
Thu Apr 29, 2021 11:44 pm
vaidyamanishjoshi wrote:
Thu Apr 29, 2021 10:22 pm
Basically I want to disable email to admin and customer when during checkout, user clicks 'Continue' (Beside accept term and conditions checkbox), order get added with order status pending.

Then when user confirms order and pay successfully, email should be triggered to customer and admin.
This is a description of how a default OpenCart installation works.

While "pay successfully" depends on the selected payment method, because if it is for example COD, the order is made and the payment will arrive later.
In all cases the order email has to be sent, as this is required by Law (at least in the European Community, don't know where you have your business) - as it is the order confirmation (without the order will not be legal).

Now if you think you do not want this (because of some unknown reasons), a solution is already provided above.
You say:
I tried above solution, but unfortunately it didn't work.
A very vague statement, what did not work?
yes I agree that this is default setting by opencart.

On my eshop, cash on delivery option is not available. Only after payment, order is confirmed.

Now why I want this is :
user logins >> add products to cart >> view cart >> proceed to checkout >> continue till Payment Mode step >> email triggered to admin with order status Pending >> user doesn't click on Confirm button and doesn:t proceed to pay at that time (may be due to unknown reason) >> he leaves site.
After some time, he login again >> products are already in cart >> view cart >> proceed to checkout >> again new order id genrated at Payment Mode step and email triggered to admin...

basically admin gets two emails for same products by same customer...

And my email box gets filled with such many emails with status pending by various customers. ( which should be converted to Confirmed order... but as there is no option to pay such orders with same order id and with status pending at frontend...)

So i need email should get only after payment, so at that point, order is confirmed.


secondly, solution to this given above didn't work means, till emails with pending status are getting triggered which I am not expecting..

thank you

New member

Posts

Joined
Tue Jun 09, 2015 2:47 am

Post by straightlight » Fri Apr 30, 2021 12:48 am

vaidyamanishjoshi wrote:
Fri Apr 30, 2021 12:10 am
OSWorX wrote:
Thu Apr 29, 2021 11:44 pm
vaidyamanishjoshi wrote:
Thu Apr 29, 2021 10:22 pm
Basically I want to disable email to admin and customer when during checkout, user clicks 'Continue' (Beside accept term and conditions checkbox), order get added with order status pending.

Then when user confirms order and pay successfully, email should be triggered to customer and admin.
This is a description of how a default OpenCart installation works.

While "pay successfully" depends on the selected payment method, because if it is for example COD, the order is made and the payment will arrive later.
In all cases the order email has to be sent, as this is required by Law (at least in the European Community, don't know where you have your business) - as it is the order confirmation (without the order will not be legal).

Now if you think you do not want this (because of some unknown reasons), a solution is already provided above.
You say:
I tried above solution, but unfortunately it didn't work.
A very vague statement, what did not work?
yes I agree that this is default setting by opencart.

On my eshop, cash on delivery option is not available. Only after payment, order is confirmed.

Now why I want this is :
user logins >> add products to cart >> view cart >> proceed to checkout >> continue till Payment Mode step >> email triggered to admin with order status Pending >> user doesn't click on Confirm button and doesn:t proceed to pay at that time (may be due to unknown reason) >> he leaves site.
After some time, he login again >> products are already in cart >> view cart >> proceed to checkout >> again new order id genrated at Payment Mode step and email triggered to admin...

basically admin gets two emails for same products by same customer...

And my email box gets filled with such many emails with status pending by various customers. ( which should be converted to Confirmed order... but as there is no option to pay such orders with same order id and with status pending at frontend...)

So i need email should get only after payment, so at that point, order is confirmed.


secondly, solution to this given above didn't work means, till emails with pending status are getting triggered which I am not expecting..

thank you
With this modification, only processing and complete order statuses should be looked up. At this point, if you keep receiving email notifications with these changes and, assuming you followed the instructions properly from the above, you should only receive email notifications with orders based on processing and complete statuses. If not, then you need to look at your order statuses settings from the OC admin, either from each stores, or from your extension payments.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by by mona » Fri Apr 30, 2021 2:11 am

I think there is some confusion

user logins >> add products to cart >> view cart >> proceed to checkout >> continue till Payment Mode step >> email triggered to admin with order status Pending >> user doesn't click on Confirm button and doesn:t proceed to pay at that time (may be due to unknown reason) >> he leaves site.
After some time, he login again >> products are already in cart >> view cart >> proceed to checkout >> again new order id genrated at Payment Mode step and email triggered to admin...
This is not how it works.

When a user confirms the payment method, a new order is generated with status 0, no email is send at that time.
The confirmation email is send when a order goes from status 0 to any other status like pending.
That only happens after a user confirms the order itself, directly via the payment method like COD or via a callback from a payment gateway, That triggers the order history addition and the emails.

If a user does not confirm the order or does not complete the gateway payment, the order stays in status 0, the cart stays intact and no email is ever send, you will find those "ghost orders" in your "missing orders" filter.

When the customer signs in again and confirms the payment method again, a new order is again created with status 0, etc....

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Active Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by vaidyamanishjoshi » Fri Apr 30, 2021 2:23 am

by mona wrote:
Fri Apr 30, 2021 2:11 am
I think there is some confusion

user logins >> add products to cart >> view cart >> proceed to checkout >> continue till Payment Mode step >> email triggered to admin with order status Pending >> user doesn't click on Confirm button and doesn:t proceed to pay at that time (may be due to unknown reason) >> he leaves site.
After some time, he login again >> products are already in cart >> view cart >> proceed to checkout >> again new order id genrated at Payment Mode step and email triggered to admin...
This is not how it works.

When a user confirms the payment method, a new order is generated with status 0, no email is send at that time.
The confirmation email is send when a order goes from status 0 to any other status like pending.
That only happens after a user confirms the order itself, directly via the payment method like COD or via a callback from a payment gateway, That triggers the order history addition and the emails.

If a user does not confirm the order or does not complete the gateway payment, the order stays in status 0, the cart stays intact and no email is ever send, you will find those "ghost orders" in your "missing orders" filter.

When the customer signs in again and confirms the payment method again, a new order is again created with status 0, etc....
but I am getting emails with status Pending (order_status_id = 1) when user clicks continue button at payment mode tab....

not in missing / ghost orders....
???

New member

Posts

Joined
Tue Jun 09, 2015 2:47 am

Post by by mona » Fri Apr 30, 2021 3:07 am

To be clear - You are saying that an order is created after clicking the continue button on step 5 ?

1. Check that yourself - that appears as a missing order as stated above.
If that is not correct you have something else going on and you should look elsewhere - something that edits your checkout ?

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Active Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by OSWorX » Fri Apr 30, 2021 3:33 am

vaidyamanishjoshi wrote:
Fri Apr 30, 2021 2:23 am
but I am getting emails with status Pending (order_status_id = 1) when user clicks continue button at payment mode tab....
One of the reasons (after many replies, etc.) to read this here BEFORE you post the 1. message:
viewtopic.php?f=176&t=200480
After that, you should publish those details, especially the used Template/Theme and if there are any modifications used.

Because what you want to tell us is impossible with a standard Opencart Installation!

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


User avatar
Guru Member

Posts

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

Post by by mona » Fri Apr 30, 2021 11:39 am

in addition to the above .. check if you have any related events - maybe something set to trigger the order history update with a new order status (pending for instance) right after the order is created when the user confirms the payment method.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Active Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by vaidyamanishjoshi » Fri Apr 30, 2021 3:26 pm

OSWorX wrote:
Fri Apr 30, 2021 3:33 am
vaidyamanishjoshi wrote:
Fri Apr 30, 2021 2:23 am
but I am getting emails with status Pending (order_status_id = 1) when user clicks continue button at payment mode tab....
One of the reasons (after many replies, etc.) to read this here BEFORE you post the 1. message:
viewtopic.php?f=176&t=200480
After that, you should publish those details, especially the used Template/Theme and if there are any modifications used.

Because what you want to tell us is impossible with a standard Opencart Installation!
Thank you for link. I will update my query soon. Thanx once again..

New member

Posts

Joined
Tue Jun 09, 2015 2:47 am

Post by vaidyamanishjoshi » Fri Apr 30, 2021 3:27 pm

by mona wrote:
Fri Apr 30, 2021 11:39 am
in addition to the above .. check if you have any related events - maybe something set to trigger the order history update with a new order status (pending for instance) right after the order is created when the user confirms the payment method.
Surely I will check and update here. Thank you !

New member

Posts

Joined
Tue Jun 09, 2015 2:47 am
Who is online

Users browsing this forum: No registered users and 25 guests