Post by Rainforest » Tue Oct 20, 2020 9:52 pm

I made a little label program that displays a list or statuses for me.
Right now it only displays on status. The code is:
"order_status" => "16"

16 is my shipping label status in Opencart

I'm stuck trying to figure out how I add a and/or to that line.
I would like it display not only "16" but also "2" which is my confirmed order status.

Anybody a code wizard that can tell me how?

Self Taught Opencart User & Developer Since 2010.


User avatar
Active Member

Posts

Joined
Fri Jan 28, 2011 3:50 am

Post by straightlight » Tue Oct 20, 2020 9:58 pm

By using Events, that would be the quickest and easy to accomplish this. With the localisation/order_status/getOrderStatuses() , a list can be pulled from the models.

Wiki: https://github.com/opencart/opencart/wiki/Events-System .

However, since you've developed a label program, if it's external from Opencart, you could also rely on the External API from my repository: https://github.com/straightlight/openca ... upload/api .

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 Rainforest » Tue Oct 20, 2020 10:07 pm

Thank you but no.
I'm just looking to edit that line. That's all.

Self Taught Opencart User & Developer Since 2010.


User avatar
Active Member

Posts

Joined
Fri Jan 28, 2011 3:50 am

Post by straightlight » Wed Oct 21, 2020 4:03 am

Rainforest wrote:
Tue Oct 20, 2020 10:07 pm
Thank you but no.
I'm just looking to edit that line. That's all.
What line?

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 Rainforest » Wed Oct 21, 2020 6:31 pm

I think you didn't read my original post ::)
"Right now it only displays on status.
The code is:
order_status" => "16""

Self Taught Opencart User & Developer Since 2010.


User avatar
Active Member

Posts

Joined
Fri Jan 28, 2011 3:50 am

Post by pprmkr » Wed Oct 21, 2020 7:04 pm

Rainforest wrote:
Tue Oct 20, 2020 9:52 pm
"order_status" => "16"
Is that part of code to fill array ?
Like:

Code: Select all

 $statuses[] = array(
 	"label" => "My label 16",
 	"order_status" => "16"
 	);
Is there an if / elseif part ?
Like:

Code: Select all

 
 if ($order_status_id == 16) then {
 $statuses[] = array(
 	"label" => "My label 16",
 	"order_status" => "16"
 	);
}
Rainforest wrote:
Tue Oct 20, 2020 9:52 pm
I would like it display not only "16" but also "2" which is my confirmed order status.

Code: Select all

 
 if ($order_status_id == 16) then {
	 $statuses[] = array(
 		"label" => "My label 16",
 		"order_status" => "16"
 		);
} elseif ($order_status_id == 2) then {
	 $statuses[] = array(
 		"label" => "Confirmed",
 		"order_status" => "2"
 		);
 }
 
Last edited by pprmkr on Wed Oct 21, 2020 7:47 pm, edited 1 time in total.

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by straightlight » Wed Oct 21, 2020 7:44 pm

Rainforest wrote:
Wed Oct 21, 2020 6:31 pm
I think you didn't read my original post ::)
"Right now it only displays on status.
The code is:
order_status" => "16""
Yeah, I read it. It's just too vague.

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 Rainforest » Thu Oct 29, 2020 3:33 am

The code needed to be updated. Simple fix

adding a comma
"16,20"
To look for two different statuses

Self Taught Opencart User & Developer Since 2010.


User avatar
Active Member

Posts

Joined
Fri Jan 28, 2011 3:50 am
Who is online

Users browsing this forum: No registered users and 16 guests