S
S
sergeyviktorovich2021-06-10 00:58:35
1C-Bitrix
sergeyviktorovich, 2021-06-10 00:58:35

How to add order status "Changed"?

How to add the order status “Changed, payment pending”, after the admin reviews the order and corrects it
, attach a new mail template to it, in which we will send all the same information as in the New order

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2021-06-14
@Firsov36

What prevents just in the Bitrix admin, in the status table (Admin - Shop - Settings - Statuses) to create a new status with your letter template? And the checker (admin, in your opinion), after checking the order, changing information, adding products, etc., will simply set this status for the order? The system will change the status of the order and automatically send letters according to the templates attached to this status.
And if further you need to dynamically change the data in the letter template, then hook to the event of sending the letter when the status changes, change / change the fields for the letter, add new ones and use it in the letter.

$eventManager->addEventHandler('sale', 'OnOrderStatusSendEmail', ['MyClass', 'onOrderStatusSendEmailHandler']);

class MyClass
{
    public function onOrderStatusSendEmailHandler($id, &$event, &$arFields, $val) {
        if($event == 'SALE_STATUS_CHANGED_NB') {
            //do something
            $arFields = [..fields..]
        }
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question