Post by london20093 » Tue May 05, 2020 6:28 pm

v3.0.3.2

catelog/controller/mail/order.php

line 28 to 41,

Code: Select all

// We need to grab the old order status ID
		$order_info = $this->model_checkout_order->getOrder($order_id);

		if ($order_info) {
			// If order status is 0 then becomes greater than 0 send main html email
			if (!$order_info['order_status_id'] && $order_status_id) { //echo $order_info;
				$this->add($order_info, $order_status_id, $comment, $notify);
			}

			// If order status is not 0 then send update text email
			if ($order_info['order_status_id'] && $order_status_id && $notify) {
				$this->edit($order_info, $order_status_id, $comment, $notify);
			}
		}
$order_info['order_status_id'] value got from getOrder($order_id) funtion is alway '0', so the second case of sending update text email never happened, what ever it was a new order or old order.

Anyone can help me with this?

Many thanks,
Last edited by london20093 on Tue May 05, 2020 7:56 pm, edited 3 times in total.

Newbie

Posts

Joined
Wed Apr 24, 2019 10:08 pm

Post by OSWorX » Tue May 05, 2020 7:34 pm

london20093 wrote:
Tue May 05, 2020 6:28 pm
$order_info['order_status_id'] value got from getOrder($order_id) funtion is alway '0', so the second case of sending update text email never happened, what ever it was a new order or old order.
If the order _status_id is "always" 0, then you had not set the status correct.

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member
Online

Posts

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

Post by london20093 » Tue May 05, 2020 7:44 pm

but in the database I can see in the order table, the order status is not '0'. very strange.
my situation is all order status are fine in both front page and admin page, just the order update email is always the greeting email (normally for new orders)

Newbie

Posts

Joined
Wed Apr 24, 2019 10:08 pm

Post by straightlight » Tue May 05, 2020 7:58 pm

What are your order statuses configuration settings from your payment extension modules and from your OC admin > systems > settings > edit settings page? Have you tested an order from the admin > sales > orders page prior to checkout? What is the first order status name showing in your order when testing with the API?

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 london20093 » Tue May 05, 2020 8:51 pm

Thanks for your reply!

my order statuses configuration settings from my payment extension modules 'pending'
from my OC admin > systems > settings > edit settings page > order status 'processing'

I have tested to place an new order via admin panel,
the first order status name showing in the new order when testing with the API is 'processing' (as this is the default one and I did not change it when I placed the order), new order placed (greeting) email was sent successfully.
But when I changed the order status via admin, the update email customer got is the same template as greeting email (in the email order status changed correctly), instead of update email template.

Newbie

Posts

Joined
Wed Apr 24, 2019 10:08 pm

Post by straightlight » Tue May 05, 2020 9:10 pm

But when I changed the order status via admin
Changed to which order status?

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 london20093 » Tue May 05, 2020 9:36 pm

whatever status, shipped, processed, etc.
order status can always be changed correctly. just incorrect email template.

also, I did some tests, as the 'getOrder' function is from catalog/model/checkout/order.php, I believe, I can see the order status changed from non zero to zero and then changed to non-zero, totally 6 times, during the function getOrder($order_id) was called.

Newbie

Posts

Joined
Wed Apr 24, 2019 10:08 pm

Post by straightlight » Tue May 05, 2020 9:51 pm

totally 6 times, during the function getOrder($order_id) was called.
That is normal. The admin API will always pull the order ID you are requesting about when editing an order.

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 london20093 » Tue May 05, 2020 10:16 pm

for example, status_id for 'shipped' is 5, I can see when I modified the order status, it changed as following in the database, 5 5 0 0 0 5 5, why in the catalog/controller/mail/order.php, it only got the value of '0', instead of '5' ? No idea.

Newbie

Posts

Joined
Wed Apr 24, 2019 10:08 pm

Post by straightlight » Tue May 05, 2020 11:05 pm

By switching the order to cancelled and submit. Then, set to processing and submit, both, from the admin > sales > orders page. Are you, then, able to receive the edit / alert email with the new order status change?

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

Users browsing this forum: No registered users and 5 guests