Changeset 3449395
- Timestamp:
- 01/29/2026 09:25:34 AM (2 months ago)
- Location:
- shipment-tracker-for-woocommerce
- Files:
-
- 6 edited
-
tags/1.5.2.6/admin/class-bt-sync-shipment-tracking-admin.php (modified) (1 diff)
-
tags/1.5.2.6/bt-sync-shipment-tracking.php (modified) (2 diffs)
-
tags/1.5.2.6/includes/class-bt-sync-shipment-tracking-rest-functions.php (modified) (5 diffs)
-
trunk/admin/class-bt-sync-shipment-tracking-admin.php (modified) (1 diff)
-
trunk/bt-sync-shipment-tracking.php (modified) (2 diffs)
-
trunk/includes/class-bt-sync-shipment-tracking-rest-functions.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shipment-tracker-for-woocommerce/tags/1.5.2.6/admin/class-bt-sync-shipment-tracking-admin.php
r3446887 r3449395 3069 3069 { 3070 3070 $bt_sst_product_days_field = isset($_POST['_bt_sst_product_days_field_' . $i]) ? sanitize_text_field($_POST['_bt_sst_product_processing_days_field_' . $i]) : ''; 3071 Bt_Sync_Shipment_Tracking::bt_sst_update_product_meta($variation_id, '_bt_sst_product_processing_days_field', $bt_sst_product_ processing_days_field);3071 Bt_Sync_Shipment_Tracking::bt_sst_update_product_meta($variation_id, '_bt_sst_product_processing_days_field', $bt_sst_product_days_field); 3072 3072 } 3073 3073 -
shipment-tracker-for-woocommerce/tags/1.5.2.6/bt-sync-shipment-tracking.php
r3446887 r3449395 17 17 * Plugin URI: https://shipment-tracker-for-woocommerce.bitss.tech/ 18 18 * Description: Most comprehensive shipment tracking plugin that extends your woocommerce store with shipment related features. Keeps you & your customers informed about shipment movement. 19 * Version: 1.5.2.6 19 * Version: 1.5.2.6.1 20 20 * Author: Bitss Techniques 21 21 * Author URI: https://shipment-tracker-for-woocommerce.bitss.tech … … 59 59 60 60 define( 'Carbon_Fields\URL', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'vendor/htmlburger/carbon-fields/' );//fix for Bitnami installations. 61 define( 'BT_SYNC_SHIPMENT_TRACKING_VERSION', '1.5.2.6 ' );61 define( 'BT_SYNC_SHIPMENT_TRACKING_VERSION', '1.5.2.6.1' ); 62 62 define( 'BT_SHIPPING_PROVIDERS', array('delhivery' =>'Delhivery','nimbuspost' => 'Nimbuspost (Deprecated)','nimbuspost_new' => 'Nimbuspost','shipmozo'=>'Shipmozo','shiprocket' => 'Shiprocket', 'xpressbees' => 'Xpressbees', 'manual' =>'Custom Shipping', 'fship' => 'Fship','ekart' => 'Ekart','courierkaro' => 'Courier Karo') ); 63 63 define( 'BT_SHIPPING_PROVIDERS_WITH_NONE', array('none' =>'none','delhivery' =>'Delhivery', 'nimbuspost' => 'Nimbuspost (OLD)','nimbuspost_new' => 'Nimbuspost(NEW)','shipmozo'=>'Shipmozo','shiprocket' => 'Shiprocket', 'xpressbees' => 'Xpressbees','manual' =>'Custom Shipping' , 'fship' => 'Fship','ekart' => 'Ekart','courierkaro' => 'Courier Karo') ); -
shipment-tracker-for-woocommerce/tags/1.5.2.6/includes/class-bt-sync-shipment-tracking-rest-functions.php
r3446887 r3449395 34 34 return $this->shiprocket->shiprocket_webhook_receiver($request); 35 35 } 36 37 36 public function webhook_receiver_apex_create_wc_order( $request ) { 38 37 … … 50 49 } 51 50 51 52 52 $phone = wc_sanitize_phone_number( $data['order']['phone'] ); 53 54 $existing_orders = wc_get_orders([ 55 'status' => ['draft', 'wc-checkout-draft', 'checkout-draft'], 56 'limit' => 1, 57 'orderby' => 'date', 58 'order' => 'DESC', 59 'meta_query' => [ 60 [ 61 'key' => '_billing_phone', 62 'value' => $phone, 63 'compare' => '=' 64 ] 65 ] 66 ]); 53 $phone_value = (string) $phone; 54 $args = [ 55 'status' => ['wc-pending'], 56 'limit' => 1, 57 'billing_phone' => $phone, 58 'date_created' => '>' . (time() - 30 ), 59 ]; 60 61 $existing_orders = wc_get_orders( $args ); 67 62 68 63 if ( ! empty( $existing_orders ) ) { 69 64 $order = $existing_orders[0]; 70 $logger->info('Existing draftorder #' . $order->get_id() . ' found for phone ' . $phone, $context);65 $logger->info('Existing Pending/Failed order #' . $order->get_id() . ' found for phone ' . $phone, $context); 71 66 } else { 72 67 $order = wc_create_order([ 73 'status' => ' draft'68 'status' => 'pending' 74 69 ]); 75 70 … … 108 103 $order->add_item( $item ); 109 104 105 $order->update_meta_data( 'apex_order', 'true' ); 110 106 $order->update_meta_data( '_invoice_number', $data['invoice number'] ?? '' ); 107 111 108 $order->add_order_note( 112 "APEX Webhook: New item added to this draft.\n" .109 "APEX Webhook: Item added.\n" . 113 110 "Item: {$data['item name']}\n" . 114 111 "Amount: ₹{$data['amount']}\n" . … … 117 114 118 115 $order->calculate_totals( false ); 119 $order->set_status( 'checkout-draft' );120 116 $order->save(); 121 117 … … 123 119 'success' => true, 124 120 'woocommerce_order_id' => $order->get_id(), 125 'message' => 'Item successfully added to order'121 'message' => 'Item successfully added to pending order' 126 122 ], 200); 127 123 128 124 } catch ( Exception $e ) { 129 $logger->critical( 130 'APEX webhook error: ' . $e->getMessage(), 131 $context 132 ); 125 $logger->critical( 'APEX webhook error: ' . $e->getMessage(), $context ); 133 126 134 127 return new WP_REST_Response([ -
shipment-tracker-for-woocommerce/trunk/admin/class-bt-sync-shipment-tracking-admin.php
r3446887 r3449395 3069 3069 { 3070 3070 $bt_sst_product_days_field = isset($_POST['_bt_sst_product_days_field_' . $i]) ? sanitize_text_field($_POST['_bt_sst_product_processing_days_field_' . $i]) : ''; 3071 Bt_Sync_Shipment_Tracking::bt_sst_update_product_meta($variation_id, '_bt_sst_product_processing_days_field', $bt_sst_product_ processing_days_field);3071 Bt_Sync_Shipment_Tracking::bt_sst_update_product_meta($variation_id, '_bt_sst_product_processing_days_field', $bt_sst_product_days_field); 3072 3072 } 3073 3073 -
shipment-tracker-for-woocommerce/trunk/bt-sync-shipment-tracking.php
r3446887 r3449395 17 17 * Plugin URI: https://shipment-tracker-for-woocommerce.bitss.tech/ 18 18 * Description: Most comprehensive shipment tracking plugin that extends your woocommerce store with shipment related features. Keeps you & your customers informed about shipment movement. 19 * Version: 1.5.2.6 19 * Version: 1.5.2.6.1 20 20 * Author: Bitss Techniques 21 21 * Author URI: https://shipment-tracker-for-woocommerce.bitss.tech … … 59 59 60 60 define( 'Carbon_Fields\URL', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'vendor/htmlburger/carbon-fields/' );//fix for Bitnami installations. 61 define( 'BT_SYNC_SHIPMENT_TRACKING_VERSION', '1.5.2.6 ' );61 define( 'BT_SYNC_SHIPMENT_TRACKING_VERSION', '1.5.2.6.1' ); 62 62 define( 'BT_SHIPPING_PROVIDERS', array('delhivery' =>'Delhivery','nimbuspost' => 'Nimbuspost (Deprecated)','nimbuspost_new' => 'Nimbuspost','shipmozo'=>'Shipmozo','shiprocket' => 'Shiprocket', 'xpressbees' => 'Xpressbees', 'manual' =>'Custom Shipping', 'fship' => 'Fship','ekart' => 'Ekart','courierkaro' => 'Courier Karo') ); 63 63 define( 'BT_SHIPPING_PROVIDERS_WITH_NONE', array('none' =>'none','delhivery' =>'Delhivery', 'nimbuspost' => 'Nimbuspost (OLD)','nimbuspost_new' => 'Nimbuspost(NEW)','shipmozo'=>'Shipmozo','shiprocket' => 'Shiprocket', 'xpressbees' => 'Xpressbees','manual' =>'Custom Shipping' , 'fship' => 'Fship','ekart' => 'Ekart','courierkaro' => 'Courier Karo') ); -
shipment-tracker-for-woocommerce/trunk/includes/class-bt-sync-shipment-tracking-rest-functions.php
r3446887 r3449395 34 34 return $this->shiprocket->shiprocket_webhook_receiver($request); 35 35 } 36 37 36 public function webhook_receiver_apex_create_wc_order( $request ) { 38 37 … … 50 49 } 51 50 51 52 52 $phone = wc_sanitize_phone_number( $data['order']['phone'] ); 53 54 $existing_orders = wc_get_orders([ 55 'status' => ['draft', 'wc-checkout-draft', 'checkout-draft'], 56 'limit' => 1, 57 'orderby' => 'date', 58 'order' => 'DESC', 59 'meta_query' => [ 60 [ 61 'key' => '_billing_phone', 62 'value' => $phone, 63 'compare' => '=' 64 ] 65 ] 66 ]); 53 $phone_value = (string) $phone; 54 $args = [ 55 'status' => ['wc-pending'], 56 'limit' => 1, 57 'billing_phone' => $phone, 58 'date_created' => '>' . (time() - 30 ), 59 ]; 60 61 $existing_orders = wc_get_orders( $args ); 67 62 68 63 if ( ! empty( $existing_orders ) ) { 69 64 $order = $existing_orders[0]; 70 $logger->info('Existing draftorder #' . $order->get_id() . ' found for phone ' . $phone, $context);65 $logger->info('Existing Pending/Failed order #' . $order->get_id() . ' found for phone ' . $phone, $context); 71 66 } else { 72 67 $order = wc_create_order([ 73 'status' => ' draft'68 'status' => 'pending' 74 69 ]); 75 70 … … 108 103 $order->add_item( $item ); 109 104 105 $order->update_meta_data( 'apex_order', 'true' ); 110 106 $order->update_meta_data( '_invoice_number', $data['invoice number'] ?? '' ); 107 111 108 $order->add_order_note( 112 "APEX Webhook: New item added to this draft.\n" .109 "APEX Webhook: Item added.\n" . 113 110 "Item: {$data['item name']}\n" . 114 111 "Amount: ₹{$data['amount']}\n" . … … 117 114 118 115 $order->calculate_totals( false ); 119 $order->set_status( 'checkout-draft' );120 116 $order->save(); 121 117 … … 123 119 'success' => true, 124 120 'woocommerce_order_id' => $order->get_id(), 125 'message' => 'Item successfully added to order'121 'message' => 'Item successfully added to pending order' 126 122 ], 200); 127 123 128 124 } catch ( Exception $e ) { 129 $logger->critical( 130 'APEX webhook error: ' . $e->getMessage(), 131 $context 132 ); 125 $logger->critical( 'APEX webhook error: ' . $e->getMessage(), $context ); 133 126 134 127 return new WP_REST_Response([
Note: See TracChangeset
for help on using the changeset viewer.