How to enable or change sending an email to the admin with any order status?

13.06.2023 12:03
#1
newalex
Joomshopping forum user no avatar
Name: newalex
24.01.2012
Posts: 6
Quote
How to enable or change sending an email to the admin with any order status?

How to send an email to the administrator about the order, even if the status pending, confirmed, ect .. ?
Those. always send a letter
How?


Joomla: 3.10.8
JoomShopping: 4.18.8
PHP: 7.4.33
MySQL: 5.7.42
 
13.06.2023 12:27
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25942
Quote
Aw: How to enable or change sending an email to the admin with any order status?

Order create => send email "Order datail"
Order status changed (Payment system) => Send email "Order status"
Order status changed (Manual / administrator) => Send email "Order status" only to Client
----
Error ? or ?

 
13.06.2023 12:37
#3
newalex
Joomshopping forum user no avatar
Name: newalex
24.01.2012
Posts: 6
Quote
Aw: How to enable or change sending an email to the admin with any order status?

Thank you.
But I didn't understand where to do it?
I need the administrator to be able to receive an order message automatically.
Is it in PHP code?

 
13.06.2023 16:50
#4
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25942
Quote
Aw: How to enable or change sending an email to the admin with any order status?

Order create => send email "Order datail"
Order status changed (Payment system) => Send email "Order status"
Order status changed (Manual / administrator) => Send email "Order status" only to Client

Default in JoomShopping (Works witout configuration or change code).
------

describe your problem
What are you doing?
Payment system?
order status?
Screenshots?


Last change: 13.06.2023 16:53
 
14.06.2023 06:19
#5
newalex
Joomshopping forum user no avatar
Name: newalex
24.01.2012
Posts: 6
Quote
Aw: How to enable or change sending an email to the admin with any order status?

You know that upon successful payment, the payment system sends "successful" and the order status changes to "Paid". And the administrator receives a letter.
It's right? And it works successfully!

But I need that even if the status remained "Pending", the administrator also received a letter.
Those. always send a letter to the administrator! And if "Paid" and if "Pending"!

I think that something needs to be added to the code.
But I don't know where and what to do. Help me.
Write the code and where to add it.
Thank you.

 
14.06.2023 14:44
#6
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25942
Quote
Aw: How to enable or change sending an email to the admin with any order status?

An email is sent for all statuses (if order FINISHED).
Your order FINISHED?
-----
Try to make changes somewhere here.
code ($this->sendOrderEmail($order->order_id);)
components\com_jshopping\Model\CheckoutbuyModel.php
row ~247

if ($status) {
$need_create_order = (!in_array($status, $jshopConfig->payment_status_no_create_order));
$prev_order_status_data = $order->orderCreateAndSetStatus($status, $need_create_order);
if (!$prev_order_status_data->order_created && $need_create_order) {
$order = \JSFactory::getTable('order');
$order->load($order_id);
\JSFactory::getModel('checkoutorder', 'Site')->couponFinished($order);
$obj = $this;
$dispatcher->triggerEvent('onStep7OrderCreated', array(&$order, &$res, &$obj, &$pmconfigs));
$order->store();
if ($jshopConfig->send_order_email){
$this->sendOrderEmail($order->order_id);
}
$this->changeStatusOrder($order_id, $status, 0, $prev_order_status_data->order_status, 1);
} elseif ($prev_order_status_data->order_status != $status) {
$email_send = $prev_order_status_data->order_created;
$this->changeStatusOrder($order_id, $status, $email_send, $prev_order_status_data->order_status, $email_send);
}
}


Last change: 14.06.2023 14:46
 
15.06.2023 07:02
#7
newalex
Joomshopping forum user no avatar
Name: newalex
24.01.2012
Posts: 6
Quote
Aw: How to enable or change sending an email to the admin with any order status?

Thanks! I will try it!
But I'm attaching a screenshot that will explain to you what I want.
In another site I have a job through "Addon Onestepcheckout". And there is a great feature - "Always finish order"!
Now I need to do the same without this addon. That's exactly what I meant.
In fact, I need to have "Always finish order" without this addon.
Perhaps you need to make a decision differently?
Write if so please.
Thank you.
Aw: How to enable or change sending an email to the admin with any order status?

 
15.06.2023 07:39
#8
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25942
Quote
Aw: How to enable or change sending an email to the admin with any order status?

CheckoutorderModel.php
~row 151

if ($pm_method->payment_type == 1){
$order->order_created = 1;
}else {
$order->order_created = 0;
}

change to


$order->order_created = 1;


Last change: 15.06.2023 07:40
 
15.06.2023 08:24
#9
newalex
Joomshopping forum user no avatar
Name: newalex
24.01.2012
Posts: 6
Quote
Aw: How to enable or change sending an email to the admin with any order status?

admin - 15.06.2023 07:39
CheckoutorderModel.php
~row 151

if ($pm_method->payment_type == 1){
$order->order_created = 1;
}else {
$order->order_created = 0;
}

change to


$order->order_created = 1;


Ok! Thanks!
And a couple more questions...

1. I don't see the folder and file: components\com_jshopping\Model\CheckoutbuyModel.php
For me it probably looks like as: components/com_jshopping/models/checkoutorder.php?
My Version 4.18.8

2. Only it will need to be fixed? And the code you sent earlier is no longer needed?


Last change: 15.06.2023 08:50
 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.