Changeset 3035653
- Timestamp:
- 02/14/2024 12:48:05 PM (2 years ago)
- Location:
- posti-warehouse
- Files:
-
- 10 edited
- 1 copied
-
tags/2.4.1 (copied) (copied from posti-warehouse/trunk)
-
tags/2.4.1/README.md (modified) (1 diff)
-
tags/2.4.1/classes/class-api.php (modified) (2 diffs)
-
tags/2.4.1/classes/class-order.php (modified) (4 diffs)
-
tags/2.4.1/posti-warehouse.php (modified) (1 diff)
-
tags/2.4.1/readme.txt (modified) (1 diff)
-
trunk/README.md (modified) (1 diff)
-
trunk/classes/class-api.php (modified) (2 diffs)
-
trunk/classes/class-order.php (modified) (4 diffs)
-
trunk/posti-warehouse.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
posti-warehouse/tags/2.4.1/README.md
r3035564 r3035653 97 97 98 98 ## Version history 99 - 2.4.1: internal: Changed how plugin gets order status (WC_Order get_status) 99 100 - 2.4.0: 100 101 - Added "Reject partial order" setting. -
posti-warehouse/tags/2.4.1/classes/class-api.php
r3035564 r3035653 14 14 private $last_status = false; 15 15 private $token_option = 'posti_wh_api_auth'; 16 private $user_agent = 'woo-wh-client/2.4. 0';16 private $user_agent = 'woo-wh-client/2.4.1'; 17 17 18 18 public function __construct(Posti_Warehouse_Logger $logger, array &$options) { … … 193 193 } 194 194 195 $ products= $this->ApiCall('/ecommerce/v3/orders'195 $result = $this->ApiCall('/ecommerce/v3/orders' 196 196 . '?modifiedFromDate=' . urlencode($dttm_since) 197 197 . '&size=' . $size 198 198 . '&page=' . $page, '', 'GET'); 199 return $ products;199 return $result; 200 200 } 201 201 -
posti-warehouse/tags/2.4.1/classes/class-order.php
r3035564 r3035653 202 202 $order_id = $order['externalId']; 203 203 if (isset($post_by_order_id[$order_id]) && !empty($post_by_order_id[$order_id])) { 204 $this->sync_order($post_by_order_id[$order_id], $order, $autocomplete);204 $this->sync_order($post_by_order_id[$order_id], $order_id, $order, $autocomplete); 205 205 } 206 206 } … … 209 209 } 210 210 211 public function sync_order( $id, $order , $autocomplete) {211 public function sync_order( $id, $order_external_id, $order, $autocomplete) { 212 212 try { 213 213 $tracking = isset($order['trackingCodes']) ? $order['trackingCodes'] : ''; … … 233 233 return; 234 234 } 235 236 $data = $_order->get_data(); 237 $status_old = false !== $data ? $data['status'] : ''; 235 236 $status_old = $_order->get_status(); 238 237 if ($status_old !== $status_new) { 239 238 if ('completed' === $status_new) { … … 251 250 } 252 251 } 252 else if ('completed' === $status_old) { 253 $this->logger->log('info', "Order $id ($order_external_id) status is already completed"); 254 } 255 253 256 } catch (\Exception $e) { 254 257 $this->logger->log('error', $e->getMessage()); -
posti-warehouse/tags/2.4.1/posti-warehouse.php
r3035564 r3035653 3 3 /** 4 4 * Plugin Name: Posti Warehouse 5 * Version: 2.4. 05 * Version: 2.4.1 6 6 * Description: Provides integration to Posti warehouse and dropshipping services. 7 7 * Author: Posti -
posti-warehouse/tags/2.4.1/readme.txt
r3035564 r3035653 5 5 Tested up to: 6.4.2 6 6 Requires PHP: 7.1 7 Stable tag: 2.4. 07 Stable tag: 2.4.1 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html -
posti-warehouse/trunk/README.md
r3035564 r3035653 97 97 98 98 ## Version history 99 - 2.4.1: internal: Changed how plugin gets order status (WC_Order get_status) 99 100 - 2.4.0: 100 101 - Added "Reject partial order" setting. -
posti-warehouse/trunk/classes/class-api.php
r3035564 r3035653 14 14 private $last_status = false; 15 15 private $token_option = 'posti_wh_api_auth'; 16 private $user_agent = 'woo-wh-client/2.4. 0';16 private $user_agent = 'woo-wh-client/2.4.1'; 17 17 18 18 public function __construct(Posti_Warehouse_Logger $logger, array &$options) { … … 193 193 } 194 194 195 $ products= $this->ApiCall('/ecommerce/v3/orders'195 $result = $this->ApiCall('/ecommerce/v3/orders' 196 196 . '?modifiedFromDate=' . urlencode($dttm_since) 197 197 . '&size=' . $size 198 198 . '&page=' . $page, '', 'GET'); 199 return $ products;199 return $result; 200 200 } 201 201 -
posti-warehouse/trunk/classes/class-order.php
r3035564 r3035653 202 202 $order_id = $order['externalId']; 203 203 if (isset($post_by_order_id[$order_id]) && !empty($post_by_order_id[$order_id])) { 204 $this->sync_order($post_by_order_id[$order_id], $order, $autocomplete);204 $this->sync_order($post_by_order_id[$order_id], $order_id, $order, $autocomplete); 205 205 } 206 206 } … … 209 209 } 210 210 211 public function sync_order( $id, $order , $autocomplete) {211 public function sync_order( $id, $order_external_id, $order, $autocomplete) { 212 212 try { 213 213 $tracking = isset($order['trackingCodes']) ? $order['trackingCodes'] : ''; … … 233 233 return; 234 234 } 235 236 $data = $_order->get_data(); 237 $status_old = false !== $data ? $data['status'] : ''; 235 236 $status_old = $_order->get_status(); 238 237 if ($status_old !== $status_new) { 239 238 if ('completed' === $status_new) { … … 251 250 } 252 251 } 252 else if ('completed' === $status_old) { 253 $this->logger->log('info', "Order $id ($order_external_id) status is already completed"); 254 } 255 253 256 } catch (\Exception $e) { 254 257 $this->logger->log('error', $e->getMessage()); -
posti-warehouse/trunk/posti-warehouse.php
r3035564 r3035653 3 3 /** 4 4 * Plugin Name: Posti Warehouse 5 * Version: 2.4. 05 * Version: 2.4.1 6 6 * Description: Provides integration to Posti warehouse and dropshipping services. 7 7 * Author: Posti -
posti-warehouse/trunk/readme.txt
r3035564 r3035653 5 5 Tested up to: 6.4.2 6 6 Requires PHP: 7.1 7 Stable tag: 2.4. 07 Stable tag: 2.4.1 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html
Note: See TracChangeset
for help on using the changeset viewer.