Changeset 2858776
- Timestamp:
- 02/02/2023 06:57:12 AM (3 years ago)
- Location:
- trackship-for-woocommerce/trunk
- Files:
-
- 13 edited
-
includes/api/class-trackship-rest-api-controller.php (modified) (1 diff)
-
includes/class-wc-trackship-actions.php (modified) (1 diff)
-
includes/class-wc-trackship-api-call.php (modified) (1 diff)
-
includes/class-wc-trackship-front.php (modified) (1 diff)
-
includes/customizer/trackship-customizer.php (modified) (1 diff)
-
includes/shipments/class-wc-trackship-shipments.php (modified) (1 diff)
-
includes/smswoo/class-smswoo-sms-gateway.php (modified) (2 diffs)
-
includes/smswoo/class-smswoo-sms-notification.php (modified) (1 diff)
-
includes/trackship-email-manager.php (modified) (1 diff)
-
includes/views/front/layout1_tracking_details.php (modified) (7 diffs)
-
includes/views/settings.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
trackship-for-woocommerce.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trackship-for-woocommerce/trunk/includes/api/class-trackship-rest-api-controller.php
r2852880 r2858776 247 247 as_schedule_single_action( time(), 'ts_status_change_trigger', array( $order_id, $previous_status, $tracking_event_status, $tracking_number ), 'TrackShip' ); 248 248 249 // Add the note250 if ( get_option( 'enable_debug_log' ) ) {251 /* translators: %s: search for a tag */252 $note = sprintf( __( 'Tracking Status (%s - %s) was updated to %s. (TrackShip)' ), $tracking_item['tracking_provider'], $tracking_item['tracking_number'], apply_filters('trackship_status_filter', $tracking_event_status) );253 $order->add_order_note( $note );254 }255 256 249 // hook for send SMS 257 250 // depricated after version 1.4.8 -
trackship-for-woocommerce/trunk/includes/class-wc-trackship-actions.php
r2852880 r2858776 352 352 } 353 353 update_option( 'enable_email_widget', wc_clean( $_POST[ 'enable_email_widget' ] ) ); 354 update_option( 'enable_debug_log', wc_clean( $_POST[ 'enable_debug_log' ] ) );355 354 echo json_encode( array('success' => 'true') ); 356 355 die(); -
trackship-for-woocommerce/trunk/includes/class-wc-trackship-api-call.php
r2852847 r2858776 109 109 update_option( 'user_plan', $body['user_plan'] ); 110 110 } 111 // The text for the note112 $note = sprintf( __( 'Shipping information (%s - %s) was sent to TrackShip.', 'trackship-for-woocommerce' ), $tracking_provider, $tracking_number );113 // Add the note114 $order->add_order_note( $note );115 111 116 112 $ts_shipment_status = $order->get_meta( 'ts_shipment_status', true ); -
trackship-for-woocommerce/trunk/includes/class-wc-trackship-front.php
r2852847 r2858776 810 810 } 811 811 812 /** 813 * Function for check if order is Shipped and order has only 1 Shipment 814 */ 815 public function shipped_order_has_one_shipment( $tracking_items, $order ) { 816 $order_status = $order->get_status(); 817 if ( 1 == count( $tracking_items ) && in_array( $order_status, apply_filters( 'allowed_order_status_for_delivered', array( 'completed', 'updated-tracking', 'shipped', 'delivered' ) ) ) ) { 818 return true; 819 } 820 return false; 821 } 822 812 823 public function get_notifications_option ( $order_id ) { 813 824 if ( get_option( 'enable_email_widget' ) ) { -
trackship-for-woocommerce/trunk/includes/customizer/trackship-customizer.php
r2852803 r2858776 195 195 'email_iframe_url' => add_query_arg( array( 'shipment-email-customizer-preview' => '1' ), home_url( '' ) ), 196 196 'tracking_iframe_url' => add_query_arg( array( 'action' => 'preview_tracking_page' ), home_url( '' ) ), 197 'form_iframe_url' => $this->get_tracking_form_preview_url() 197 198 )); 198 199 } -
trackship-for-woocommerce/trunk/includes/shipments/class-wc-trackship-shipments.php
r2852803 r2858776 193 193 if( count( $ep_tracker['tracking_events'] ) == 0 )return 0; 194 194 $first = reset($ep_tracker['tracking_events']); 195 $first = (array) $first; 196 195 197 $first_date = $first['datetime']; 196 197 198 $last_date = $ep_tracker['last_event_time']; 198 199 -
trackship-for-woocommerce/trunk/includes/smswoo/class-smswoo-sms-gateway.php
r2633538 r2858776 86 86 87 87 /** 88 * Print send log89 *90 * @since 1.0.091 * @return void92 */93 public function print_log() {94 95 error_log( print_r( $this->_log, true ) );96 //update_option( 'smswoo_debug_log', print_r( $this->_log, true ) );97 98 }99 100 /**101 88 * Add log send log 102 89 * … … 108 95 */ 109 96 public function write_log( $args ) { 110 111 $smswoo_enable_log = get_option( 'smswoo_enable_log', 1 );112 113 if ( $smswoo_enable_log ) {114 $context = array( 'source' => 'smswoo' ); 115 116 $log = strtoupper( ( 'test' != $args['type'] ? 'Order #' . $args['order'] . ' - ' : '' ) . $args['type'] . ' MESSAGE' ) . "\r\n"; 117 $log .= 'Status: ' . ( $args['success'] ? 'SUCCESS' : 'FAILED - ' . $args['status_message']) . "\r\n";118 $log .= 'Phone: ' . $args['phone']. "\r\n";119 $log .= 'Message: ' . $args['message'] . "\r\n";120 121 if ( $args['success'] ) { 122 $this->_logger->info( $log, $context );123 } else {124 $this->_logger->error( $log, $context );125 }97 98 if ( ! apply_filters( 'ts_sms_wc_log', true ) ) { 99 return; 100 } 101 102 $context = array( 'source' => 'ts4wc-sms' ); 103 104 $log = strtoupper( ( 'test' != $args['type'] ? 'Order #' . $args['order'] . ' - ' : '' ) . $args['type'] . ' MESSAGE' ) . "\r\n"; 105 $log .= 'Status: ' . ( $args['success'] ? 'SUCCESS' : 'FAILED - ' . $args['status_message'] ) . "\r\n"; 106 $log .= 'Phone: ' . $args['phone'] . "\r\n"; 107 $log .= 'Message: ' . $args['message'] . "\r\n"; 108 109 if ( $args['success'] ) { 110 $this->_logger->info( $log, $context ); 111 } else { 112 $this->_logger->error( $log, $context ); 126 113 } 127 114 } -
trackship-for-woocommerce/trunk/includes/smswoo/class-smswoo-sms-notification.php
r2852847 r2858776 260 260 261 261 $sms_gateway->write_log( $log_args ); 262 263 $smswoo_enable_order_note_log = get_option( 'smswoo_enable_order_note_log', 1 );264 if ( $this->_customer_sms && $smswoo_enable_order_note_log ) {265 266 $order = $this->order;267 268 ob_start();269 ?>270 TrackShip SMS271 <?php esc_html_e( 'Status', 'trackship-for-woocommerce' ); ?>: <?php echo esc_html( $status_message ); ?>272 <br />273 <?php esc_html_e( 'Content', 'trackship-for-woocommerce' ); ?>: <?php echo esc_html( $message ); ?>274 <?php275 276 $this->order_note['text'] = ob_get_clean();277 $this->order_note['id'] = $order->add_order_note( $this->order_note['text'] );278 279 }280 262 281 263 return $success; -
trackship-for-woocommerce/trunk/includes/trackship-email-manager.php
r2852880 r2858776 46 46 if ( ! $enable || ! $for_amazon_order || '0' == $receive_email ) { 47 47 return; 48 } 49 50 if ( 'delivered_status' == $status ) { 51 $toggle = get_option( 'all-shipment-status-delivered' ); 52 $all_delivered = trackship_for_woocommerce()->ts_actions->is_all_shipments_delivered( $order_id ); 53 54 if ( $toggle && !$all_delivered ) { 55 return; 56 } 48 57 } 49 58 -
trackship-for-woocommerce/trunk/includes/views/front/layout1_tracking_details.php
r2852803 r2858776 19 19 } 20 20 $tracking_items = trackship_for_woocommerce()->get_tracking_items( $order_id ); 21 $tpi_order = $this->check_if_tpi_order( $tracking_items, wc_get_order( $order_id ) ); 22 if ( $tpi_order ){ 21 if ( $this->check_if_tpi_order( $tracking_items, wc_get_order( $order_id ) ) || $this->shipped_order_has_one_shipment( $tracking_items, wc_get_order( $order_id ) ) ){ 23 22 $tab_array[ 'product_details' ] = array( 24 23 'label' => $labels_name['items_label'], … … 64 63 <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong> 65 64 <p> 66 <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?> 67 <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?> 68 <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span> 65 <?php 66 $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message ); 67 $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); 68 $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city; 69 70 $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city ); 71 echo esc_html( $single_event ); 72 ?> 69 73 </p> 70 74 </li> … … 85 89 <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong> 86 90 <p> 87 <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?> 88 <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?> 89 <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span> 91 <?php 92 $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message ); 93 $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); 94 $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city; 95 96 $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city ); 97 echo esc_html( $single_event ); 98 ?> 90 99 </p> 91 100 </li> … … 112 121 <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong> 113 122 <p> 114 <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?> 115 <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?> 116 <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span> 123 <?php 124 $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message ); 125 $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); 126 $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city; 127 128 $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city ); 129 echo esc_html( $single_event ); 130 ?> 117 131 </p> 118 132 </li> … … 133 147 <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong> 134 148 <p> 135 <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?> 136 <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?> 137 <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span> 149 <?php 150 $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message ); 151 $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); 152 $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city; 153 154 $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city ); 155 echo esc_html( $single_event ); 156 ?> 138 157 </p> 139 158 </li> … … 159 178 <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong> 160 179 <p> 161 <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?> 162 <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?> 163 <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span> 180 <?php 181 $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message ); 182 $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); 183 $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city; 184 185 $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city ); 186 echo esc_html( $single_event ); 187 ?> 164 188 </p> 165 189 </li> … … 180 204 <strong><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime($date) ) ); ?> <?php echo esc_html( date_i18n( get_option( 'time_format' ), strtotime($value->datetime) ) ); ?></strong> 181 205 <p> 182 <?php echo wp_kses_post( apply_filters( 'trackship_tracking_event_description', $value->message ) ); ?> 183 <?php $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); ?> 184 <span><?php echo ( null != $tracking_location_city ) ? ' - ' : ''; ?><?php echo esc_html( $tracking_location_city ); ?></span> 206 <?php 207 $tracking_description = apply_filters( 'trackship_tracking_event_description', $value->message ); 208 $tracking_location_city = apply_filters( 'trackship_tracking_event_location', $value->tracking_location->city ); 209 $tracking_location_city = null != $tracking_location_city ? ' - ' . $tracking_location_city : $tracking_location_city; 210 211 $single_event = apply_filters( 'trackship_tracking_event', $tracking_description . $tracking_location_city ); 212 echo esc_html( $single_event ); 213 ?> 185 214 </p> 186 215 </li> -
trackship-for-woocommerce/trunk/includes/views/settings.php
r2852847 r2858776 91 91 </label> 92 92 </div> 93 <div class="settings_toogle">94 <input type="hidden" name="enable_debug_log" value="0"/>95 <input class="ast-tgl ast-tgl-flat " id="enable_debug_log" name="enable_debug_log" data-settings="enable_debug_log" type="checkbox"96 <?php echo get_option( 'enable_debug_log' ) ? 'checked' : ''; ?> value="1"/>97 <label class="ast-tgl-btn ast-tgl-btn-green" for="enable_debug_log"></label>98 <label class="setting_ul_tgl_checkbox_label" for="enable_debug_log">99 <span><?php esc_html_e( 'Debug Mode for shipment status change', 'trackship-for-woocommerce' ); ?></span>100 <span class="woocommerce-help-tip tipTip" title="<?php esc_html_e( 'Enable this option to add a note to your orders for every shipment status update by TrackShip.', 'trackship-for-woocommerce' ); ?>"></span>101 </label>102 </div>103 93 </div> 104 94 </div> -
trackship-for-woocommerce/trunk/readme.txt
r2852862 r2858776 5 5 Tested up to: 6.1.1 6 6 Requires PHP: 7.2 7 Stable tag: 1.5. 07 Stable tag: 1.5.1 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 112 112 113 113 == Changelog == 114 = 1.5.0 - 2022-01-23 = 114 = 1.5.1 - 2023-02-02 = 115 * Dev - Do not add order notes for shipment status and SMS notification 116 * Fix - Fatal error for count shipment object/array length 117 * Enhancement - Add order items to the tracking page widget for shipped orders with one tracking number. 118 * Fix - issue with shipment email when all shipments are delivered option is checked 119 120 = 1.5.0 - 2023-01-23 = 115 121 * Dev - Compatibility added with Yith order tracking plugin 116 122 * Dev - Compatibility added with WooCommerce Order Tracking plugin -
trackship-for-woocommerce/trunk/trackship-for-woocommerce.php
r2852847 r2858776 3 3 * Plugin Name: TrackShip for WooCommerce 4 4 * Description: TrackShip for WooCommerce integrates TrackShip into your WooCommerce Store and auto-tracks your orders, automates your post-shipping workflow and allows you to provide a superior Post-Purchase experience to your customers. 5 * Version: 1.5. 05 * Version: 1.5.1 6 6 * Author: TrackShip 7 7 * Author URI: https://trackship.com/ … … 24 24 * @var string 25 25 */ 26 public $version = '1.5. 0';26 public $version = '1.5.1'; 27 27 28 28 /**
Note: See TracChangeset
for help on using the changeset viewer.