Post by neutrimous » Fri Jan 20, 2023 9:34 pm

Hello,

I was just wondering if there is a way to stop OC to sending emails when the admin edits some information in the order (like adding product or changing customer address)?

I meaning is when customer make new order, the admin and the customer still will be received email notification for new order... or if admin change the order status and check to notify customer still will be send email for that.

My only need is to stop sending emails when the admin makes some edits into the order details.

My OC is 3.0.3.8 / PHP 7.4

Thanks!

Newbie

Posts

Joined
Fri Jan 20, 2023 9:27 pm

Post by paulfeakins » Mon Jan 23, 2023 7:35 pm

Have you searched for extensions that do this?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by neutrimous » Thu Jan 26, 2023 1:24 am

Yes, I do... and I found one extension for onepage edit order... and there is a option for choose to notify or not customer by email, but looks like no option for global rule, and the admin need to select this in every order.

I try to find a simple way to disable sending this emails globally in OC code somewhere.

Newbie

Posts

Joined
Fri Jan 20, 2023 9:27 pm

Post by by mona » Thu Jan 26, 2023 11:09 am

Mails are send out event-wise before order history is added via

Code: Select all

$this->model_checkout_order->addOrderHistory($order_id, $order_status_id);
Since admin order edit is done via the API controllers you can set a session variable "admin_edit_notify_override" prior to that statement in catalog/controller/api/order.php

Then in the mail controller you could check this session variable, set $notify to false and unset that session variable again.
When that works fine, you can make a nice back-end control checkbox in settings for it so you can toggle it.

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.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: Google [Bot], ravikumar22, Semrush [Bot] and 85 guests