Post by sukhbirgs » Sat Apr 10, 2021 12:57 am

Hello, i am trying to find the code block where call is made if admin selects notify on order status update.

Admin history update block calls : index.php?route=api/order/history
From here function history check for order info and calls
$this->model_checkout_order->addOrderHistory

function addOrderHistory updates order history, in this whole process json data is updated and returned back to calling page. Admin page will show message if success and status is updated. In this process i did not found any code block that calls mail order page for sending mail if notify is selected. But mail is being sent.
i want to find out the exact code that calls mail function if notify is selected. Can someone help me with this.
Thanks

Newbie

Posts

Joined
Sat Oct 01, 2016 5:24 am

Post by straightlight » Sat Apr 10, 2021 1:47 am

You need to create an event for this. See documentation: https://github.com/opencart/opencart/wiki/Events-System

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by sw!tch » Sat Apr 10, 2021 2:54 am

The mail notify is controlled by an event on addOrderHistroy
https://github.com/opencart/opencart/bl ... /order.php

Trigger
catalog/model/checkout/order/addOrderHistory/before
Action
mail/order

You can view your events in the Admin -> Extensions -> Events and further read on what @straightlight linked for usage.

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
Who is online

Users browsing this forum: Baidu [Spider], jagall, SohBH and 261 guests