1, 'wpc_mp_enable_frontend' => 1, 'wpc_mp_enable_dimension_unit' => 1, 'wpc_mp_dimension_unit' => 'cm', 'wpc_mp_weight_unit' => 'kg', 'wpc_mp_piece_type' => 'Pallet, Carton, Crate, Loose, Others', ); if( !empty( get_option( 'wpc_mp_settings' ) ) ){ $package_settings = array( 'wpc_mp_enable_admin' => wpcargo_package_settings()->admin_enable, 'wpc_mp_enable_frontend' => wpcargo_package_settings()->frontend_enable, 'wpc_mp_enable_dimension_unit' => wpcargo_package_settings()->dim_unit_enable, 'wpc_mp_dimension_unit' => wpcargo_package_settings()->dim_unit, 'wpc_mp_weight_unit' => wpcargo_package_settings()->weight_unit, 'wpc_mp_piece_type' => implode(",", wpcargo_package_settings()->peice_types ), ); } update_option( 'wpc_mp_settings', $package_settings ); // General Settings $general_settings = array( 'settings_shipment_type' => 'Air Freight, International Shipping, Truckload, Van Move', 'settings_shipment_wpcargo_mode' => 'Sea Transport, Land Shipping, Air Freight', 'settings_shipment_status' => implode(",", wpcargo_default_status() ), 'settings_shipment_country' => wpcargo_country_list(), 'settings_shipment_wpcargo_carrier' => 'DHL, USPS, FedEx', 'settings_shipment_wpcargo_payment_mode' => 'CASH, Cheque, BACS', 'settings_shipment_ship_logo' => '', 'settings_barcode_checkbox' => 1, 'wpcargo_title_prefix_action' => 'on', 'wpcargo_title_prefix' => 'WPC', 'wpcargo_base_color' => '#01ba7c', 'wpcargo_tax' => 12, 'wpcargo_invoice_display_history' => 'on', 'wpcargo_edit_history_role' => array( 'administrator', 'wpc_shipment_manager', ), 'wpcargo_email_employee' => false, 'wpcargo_email_agent' => false, 'wpcargo_email_client' => false, ); if( !empty( get_option( 'wpcargo_option_settings' ) ) ){ $gen_settings = get_option( 'wpcargo_option_settings' ); $barcode_checkbox = array_key_exists('settings_barcode_checkbox', $gen_settings ) ? 1 : false; $prefix_action = array_key_exists('wpcargo_title_prefix_action', $gen_settings ) ? 'on' : false; $display_history = array_key_exists('wpcargo_invoice_display_history', $gen_settings ) ? 'on' : false; $email_employee = array_key_exists('wpcargo_email_employee', $gen_settings ) ? 'on' : false; $email_agent = array_key_exists('wpcargo_email_agent', $gen_settings ) ? 'on' : false; $email_client = array_key_exists('wpcargo_email_client', $gen_settings ) ? 'on' : false; $general_settings = array( 'settings_shipment_type' => $gen_settings['settings_shipment_type'], 'settings_shipment_wpcargo_mode' => $gen_settings['settings_shipment_wpcargo_mode'], 'settings_shipment_status' => $gen_settings['settings_shipment_status'], 'settings_shipment_country' => $gen_settings['settings_shipment_country'], 'settings_shipment_wpcargo_carrier' => $gen_settings['settings_shipment_wpcargo_carrier'], 'settings_shipment_wpcargo_payment_mode' => $gen_settings['settings_shipment_wpcargo_payment_mode'], 'settings_shipment_ship_logo' => $gen_settings['settings_shipment_ship_logo'], 'settings_barcode_checkbox' => $barcode_checkbox, 'wpcargo_title_prefix_action' => $prefix_action, 'wpcargo_title_prefix' => $gen_settings['wpcargo_title_prefix'], 'wpcargo_base_color' => $gen_settings['wpcargo_base_color'], 'wpcargo_tax' => $gen_settings['wpcargo_tax'], 'wpcargo_invoice_display_history' => $display_history, 'wpcargo_edit_history_role' => $gen_settings['wpcargo_edit_history_role'], 'wpcargo_email_employee' => $gen_settings['wpcargo_email_employee'], 'wpcargo_email_agent' => $gen_settings['wpcargo_email_agent'], 'wpcargo_email_client' => $gen_settings['wpcargo_email_client'], ); } update_option( 'wpcargo_option_settings', $general_settings ); if( empty( get_option('wpcargo_title_suffix') ) ){ update_option( 'wpcargo_title_suffix', '-CARGO' ); } // Client email settings $client_mail_settings = array( 'wpcargo_active_mail' => 1, 'wpcargo_mail_to' => '{wpcargo_shipper_email}', 'wpcargo_mail_subject' => 'Shipment Notification # {'.wpcargo_track_meta().'}', 'wpcargo_mail_message' =>'', 'wpcargo_mail_footer' => '' ); if( !empty( get_option( 'wpcargo_mail_settings' ) ) ){ $c_mail_settings = get_option( 'wpcargo_mail_settings' ); $c_active_mail = array_key_exists( 'wpcargo_active_mail', $c_mail_settings ) ? $c_mail_settings['wpcargo_active_mail'] : false; $client_mail_settings = array( 'wpcargo_active_mail' => $c_active_mail, 'wpcargo_mail_to' => $c_mail_settings['wpcargo_mail_to'], 'wpcargo_mail_subject' => $c_mail_settings['wpcargo_mail_subject'], 'wpcargo_mail_message' => $c_mail_settings['wpcargo_mail_message'], 'wpcargo_mail_footer' => $c_mail_settings['wpcargo_mail_footer'] ); } update_option( 'wpcargo_mail_settings', $client_mail_settings ); if( empty( get_option( 'wpcargo_admin_mail_active' ) ) ){ update_option( 'wpcargo_admin_mail_active', 1 ); } if( empty( get_option( 'wpcargo_admin_mail_to' ) ) ){ update_option( 'wpcargo_admin_mail_to', get_bloginfo('admin_email') ); } if( empty( get_option( 'wpcargo_admin_mail_subject' ) ) ){ update_option( 'wpcargo_admin_mail_subject', 'Shipment Notification # {'.wpcargo_track_meta().'}' ); } } register_activation_hook( WPCARGO_FILE_DIR, 'wpcargo_activation_setup_settings' ); function wpcargo_track_shipment_history_details_tbl_responsive(){ ?> settings; $date_format = $wpcargo->date_format; $time_format = $wpcargo->time_format; if( !empty( $settings ) ){ if( !array_key_exists( 'wpcargo_invoice_display_history', $settings ) ){ if( !( isset( $_POST['wpcfe'] ) || wpcargo_can_track_shipment() ) ){ return false; } } } $shmap_active = get_option('shmap_active'); $shmap_api = trim( get_option('shmap_api') ); if( $shmap_active && !empty( $shmap_api ) ){ ?>
ID); ?>
ID); ?>
/> post_content, 'wpcargo_account') || has_shortcode( $post->post_content, 'wpc-ca-account') ) ) { ?>
''.esc_html__('Settings', 'wpcargo').'', ); $links = array_merge( $links, $new_links ); } return $links; } add_action( 'quick_edit_custom_box', 'wpcargo_bulk_update_registered_shipper_custom_box', 10, 2 ); add_action( 'bulk_edit_custom_box', 'wpcargo_bulk_update_registered_shipper_custom_box', 10, 2 ); function wpcargo_bulk_update_registered_shipper_custom_box( $column_name, $screen_post_type ){ global $wpcargo; $shmap_active = get_option('shmap_active'); if( $screen_post_type == 'wpcargo_shipment' ){ wp_nonce_field( 'reg_shipper_bulk_update_action', 'reg_shipper_bulk_update_nonce' ); $user_args = array( 'meta_key' => 'first_name', 'orderby' => 'meta_value', ); $all_users = get_users( $user_args ); if( $column_name == 'registered_shipper' ){ ?>
true, // True allows that capability )); } } add_action( 'deactivated_plugin', 'wpcargo_detect_plugin_deactivation', 10, 2 ); // Shipment History Map function wpcargo_shipment_history_map_callback( $shipment_id ){ global $post, $wpcargo; $shmap_api = get_option('shmap_api'); if(!empty($shmap_api)){ $shmap_longitude = !empty(get_option('shmap_longitude') ) ? get_option('shmap_longitude') : -87.65; $shmap_latitude = !empty(get_option('shmap_latitude') ) ? get_option('shmap_latitude') : 41.85; $shmap_country_restrict = get_option('shmap_country_restrict'); $shmap_active = get_option('shmap_active'); $shmap_type = get_option('shmap_type') ? get_option('shmap_type') : 'terrain' ; $shmap_zoom = get_option('shmap_zoom') ? get_option('shmap_zoom') : 15 ; $maplabels = apply_filters('wpcargo_map_labels', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' ); $history = wpcargo_history_order( $wpcargo->history( $shipment_id ) ); $shipment_addresses = array(); $shipment_info = array(); if( !empty( $history ) ){ foreach ( $history as $value ) { if( empty( $value['location'] ) ){ continue; } $shipment_addresses[] = $value['location']; $shipment_info[] = $value; } } $addressLocations = array_reverse( $shipment_addresses ); $shipment_info = array_reverse( $shipment_info ); ?> ID, 'wpcargo_status', true ) ); $class_status = strtolower( $shipment_status ); $class_status = str_replace(' ', '_', $class_status ); ?>

get_fields_data( 'shipper_info', esc_html($shipmentDetails['shipmentID'])), 'post'); }else{ ?>

:

:

:

:

get_fields_data( 'receiver_info', esc_html($shipmentDetails['shipmentID'])), 'post'); }else{ ?>

:

:

:

:

frontend_enable ){ return false; } $shipment = new stdClass; $shipment->ID = $shipmentDetails['shipmentID']; $shipment->post_title = esc_html( get_the_title( $shipmentDetails['shipmentID'] ) ); ?>

$value): ?> dim_unit_enable ){ continue; } ?> $data_value): ?> $field_value): ?> dim_unit_enable ){ continue; } ?>