Post by serkanc » Sat Mar 09, 2019 9:33 pm

I have made a script, which checks the status of the tracking code of orders on order list page and if it's delivered I can write instead of tracking number, "delivered". I want also change the status shipped to completed, but I cannot access addOrderHistory function. I looked at the order_info.tpl ajax codes ( I have no knowledge about ajax ) I have to put a button. Is there any other way to use the function in order_list.tpl.
Thanks

Newbie

Posts

Joined
Wed Feb 27, 2019 3:02 am

Post by straightlight » Sat Mar 09, 2019 11:36 pm

Better to use more recent OC versions, in this case. With the use of local APIs throughout Opencart, it has become easier to access the order histories from the catalog end without major code changes.

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
Opencart.com contractor officials representative


Legendary Member

Posts

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

Post by serkanc » Sun Mar 10, 2019 3:13 am

Thanks for your kindly reply. I'm using 2.3.0.2 version. Do you have any suggestion for beginning for major changes?

Newbie

Posts

Joined
Wed Feb 27, 2019 3:02 am

Post by straightlight » Sun Mar 10, 2019 4:08 am


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
Opencart.com contractor officials representative


Legendary Member

Posts

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

Post by serkanc » Sun Mar 10, 2019 4:37 pm

I’m using already this extention :) Also updated xml files to check the shipping status via curl. I will check it again. But i need advice, how to access addOrderHistory function...

Newbie

Posts

Joined
Wed Feb 27, 2019 3:02 am

Post by straightlight » Sun Mar 10, 2019 11:06 pm

serkanc wrote:
Sun Mar 10, 2019 4:37 pm
I’m using already this extention :) Also updated xml files to check the shipping status via curl. I will check it again. But i need advice, how to access addOrderHistory function...
Not mentioned on your first post. Then, contact the extension developer to resolved this issue.

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
Opencart.com contractor officials representative


Legendary Member

Posts

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

Post by serkanc » Mon Mar 11, 2019 7:32 pm

This is not the issue of this extention. I added the lines below to order_list.tpl. It checks the carrier shipping information, if the packaged delivered. If it's delivered than It writes instead of tracking number, "Delivered"... I want also update the status from Shipped to Delivered...
I can update status via extention... Below the code I can add

Code: Select all

if($order['order_status_id'] == 5)
to update the order_status_id to 11....

Code: Select all

$ch = curl_init(); 
			$headers = array(
			'Accept: application/json',
			'Content-Type: application/json',
			);
            curl_setopt($ch, CURLOPT_URL, $order['tracking_url']); 
			curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
			curl_setopt($ch, CURLOPT_HEADER, 0);
            $body = '{}';
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); 
			curl_setopt($ch, CURLOPT_POSTFIELDS,$body);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			curl_setopt($ch, CURLOPT_TIMEOUT, 30);
            $authToken = curl_exec($ch);
			if(strpos($authToken, "Teslim Edildi")!=0){
				strpos($authToken, "Teslim Edildi");
				$konum = strpos($authToken, "Teslim Edildi");
				$konumfark = $konum +13;
				$konum2 = strpos($authToken, "Teslim Edildi",$konumfark);
				$fark = $konum2-$konum-13;
				$teslimat = substr($authToken,$konumfark,$fark);
  				echo "Teslim edildi";
				}
			else {
				echo $order['tracking_no'];
				} ?></a></td><?php } ?

Newbie

Posts

Joined
Wed Feb 27, 2019 3:02 am

Post by straightlight » Tue Mar 12, 2019 5:15 am

serkanc wrote:
Mon Mar 11, 2019 7:32 pm
This is not the issue of this extention. I added the lines below to order_list.tpl. It checks the carrier shipping information, if the packaged delivered. If it's delivered than It writes instead of tracking number, "Delivered"... I want also update the status from Shipped to Delivered...
I can update status via extention... Below the code I can add

Code: Select all

if($order['order_status_id'] == 5)
to update the order_status_id to 11....

Code: Select all

$ch = curl_init(); 
			$headers = array(
			'Accept: application/json',
			'Content-Type: application/json',
			);
            curl_setopt($ch, CURLOPT_URL, $order['tracking_url']); 
			curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
			curl_setopt($ch, CURLOPT_HEADER, 0);
            $body = '{}';
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); 
			curl_setopt($ch, CURLOPT_POSTFIELDS,$body);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			curl_setopt($ch, CURLOPT_TIMEOUT, 30);
            $authToken = curl_exec($ch);
			if(strpos($authToken, "Teslim Edildi")!=0){
				strpos($authToken, "Teslim Edildi");
				$konum = strpos($authToken, "Teslim Edildi");
				$konumfark = $konum +13;
				$konum2 = strpos($authToken, "Teslim Edildi",$konumfark);
				$fark = $konum2-$konum-13;
				$teslimat = substr($authToken,$konumfark,$fark);
  				echo "Teslim edildi";
				}
			else {
				echo $order['tracking_no'];
				} ?></a></td><?php } ?

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
Opencart.com contractor officials representative


Legendary Member

Posts

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

Post by serkanc » Tue Mar 12, 2019 5:06 pm

I can update the STATUS manual, but I want to update with code. I googled it but didn't find any solution. So I decided to ask to this group. Pls paste me the topic related to my question... ???

Newbie

Posts

Joined
Wed Feb 27, 2019 3:02 am

Post by straightlight » Wed Mar 13, 2019 5:18 am

Pls paste me the topic related to my question...
Absolutely, here: viewforum.php?f=88

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
Opencart.com contractor officials representative


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 1 guest