Plugin Directory

Changeset 2632724


Ignore:
Timestamp:
11/19/2021 05:09:47 PM (4 years ago)
Author:
skynetsolutions
Message:

1.1.19 - When hovering over the Midwest Logistics menu the Orders with Errors menu now shows a count. The count is the number of WooCommerce orders that could not be put into Midwest Logistics. If there is no count there are no orders that need to be reviewed.Fixed issue with Midwest Logistics WooCommerce shipping settings not saving properly.

Location:
midwest-logistics/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • midwest-logistics/trunk/classes/class-ml-settings-orders.php

    r2481617 r2632724  
    350350function Midwest_Logistics_add_order_error_page(  ) {
    351351    $settings_order_errrors = new ML_Settings_Orders();
     352    $orders = $settings_order_errrors->get_orders();
     353   
     354   
     355    $menuText = 'Orders With Errors ';
     356    if(count($orders) > 0) {
     357        $menuText .= '<span class="update-plugins"><span class="plugin-count">' . count($orders) . '</span></span>';
     358    }
     359           
    352360       
    353     add_submenu_page('midwest-logistics-options', 'Orders With Errors', 'Orders With Errors', "manage_options", "midwest-logistics-order_errors", array($settings_order_errrors,"settings_page") );
     361    add_submenu_page('midwest-logistics-options', 'Orders With Errors', $menuText , "manage_options", "midwest-logistics-order_errors", array($settings_order_errrors,"settings_page") );
    354362}
    355363
  • midwest-logistics/trunk/classes/class-wc-ml-shipping-method.php

    r2529939 r2632724  
    1414        private $saved_data;
    1515
    16        
     16
    1717
    1818        public function __construct() {
     
    2121            $this->method_description = __( 'Link your current shipping zone rates to Midwest Logistics shipping options.' ); //
    2222            $this->enabled            = "yes"; // This can be added as an setting but for this example its forced enabled                     
    23                    
    24                        
     23
     24
    2525            $shipping_options = new WC_ML_Shipping_Options();
    2626            $this->shipping_options = $shipping_options->get_options();
    27            
     27
    2828            if($shipping_options->get_api_code() <> "200") {
    2929                $this->error_message = $shipping_options->get_api_error();
    3030            }
     31            add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
    3132
    3233            $this->init();
    33            
     34
    3435        }
    3536
     
    4142         */
    4243        function init() {
     44            $this->init_settings(); //load saved settings
    4345            $this->init_form_fields();
    44             $this->init_settings(); //load saved settings
    45            
     46
     47
    4648            // Save settings in admin if you have any defined
    4749            add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
    4850        }
    4951        function init_form_fields() {
    50            
     52
    5153            $data = $this->get_settings();
    52            
     54
    5355            $shipping_options = array();
    5456            if(is_array($this->shipping_options)) {
     
    5759                }                                             
    5860            }   
    59            
     61
    6062            if($this->error_message == "") {
    6163                $this->form_fields = array(
     
    8385            }
    8486        } // End init_form_fields()
    85        
     87
    8688        function process_admin_options() {
    8789            $default_shipping = filter_input(INPUT_POST,"woocommerce_midwest_logistics_default_shipping");
    8890            $default_shipping = sanitize_text_field($default_shipping);
    89            
     91
    9092            $enable_mapping = filter_input(INPUT_POST,"woocommerce_midwest_logistics_enable_mapping");
    9193            $enable_mapping = sanitize_text_field($enable_mapping);     
    92            
     94
    9395            $ML_WC_rate_link = isset($_POST["ML_WC_rate_link"]) == true ? $_POST["ML_WC_rate_link"] : [];       
    94  
     96
    9597            $data = array(
    9698                "default_shipping" => $default_shipping,
     
    99101            );
    100102            update_option($this->data_name,serialize($data));
     103           
     104            $this->init_form_fields(); //reinitialize the form fields with the new data
    101105        }
    102106        function get_settings() {
     
    126130                    parent::generate_settings_html($form_fields,true);
    127131                    $this->generate_zone_table();
    128                    
     132
    129133                    ?>
    130134                </div>
     
    148152                    .ml-shipping-setting label {
    149153                        font-weight: bold;
    150                        
     154
    151155                    }
    152156                    .ml-shipping-setting .description {
     
    161165            }         
    162166        }       
    163        
    164        
     167
     168
    165169        function generate_zone_table() {
    166170            $this->saved_data = $this->get_settings();
     
    174178                        //var_dump($zone);
    175179                        ?>
    176                        
     180
    177181                            <h2><?php _e("Zone: " .$zone["zone_name"]) ?></h2>
    178182                            <table class="wp-list-table widefat fixed striped table-view-list">
     
    191195                                        $this->generate_usps_shipping_html($shipping_method);
    192196
    193                                        
     197
    194198                                    } else {
    195199                                        $this->generate_general_zone_shipping_html($shipping_method);
    196200                                    }
    197                                    
    198                                    
     201
     202
    199203                                }
    200204                            ?>
     
    207211        }
    208212        private function generate_general_zone_shipping_html($shipping_method) {
    209            
     213
    210214            $instance_id = $shipping_method->get_instance_id();
    211215            if(empty($this->saved_data)) {
     
    239243            }
    240244            $rates_selected = $this->saved_data["rate_links"];
    241            
     245
    242246            $instance_id = $shipping_method->get_instance_id();
    243247            require_once( MIDWESTLOGISTICS_PATH . 'classes/class-ml-ups-shipping.php' );
     
    296300            }
    297301            $rates_selected = $this->saved_data["rate_links"];
    298            
     302
    299303            $instance_id = $shipping_method->get_instance_id();
    300304            require_once( MIDWESTLOGISTICS_PATH . 'classes/class-ml-usps-shipping.php' );
    301305            $ups_class = new ML_USPS_Shipping($instance_id);
    302306            $services = $ups_class->get_services();
    303            
     307
    304308            ?>
    305309            <tr>
     
    346350            <?php
    347351        }
    348        
     352
    349353    }
    350354
  • midwest-logistics/trunk/midwest-wholesale.php

    r2529939 r2632724  
    44    * Plugin URI:  https://plugins.skynet-solutions.net/
    55    * Description: Midwest Wholesale Plugin allows you to automatically add Woocommerce orders into the Midwest Logistics order system.
    6     * Version:     1.1.18
     6    * Version:     1.1.19
    77    * WC requires at least: 3.0.0
    88    * WC tested up to: 5.2.2
  • midwest-logistics/trunk/readme.txt

    r2632290 r2632724  
    55Tested up to: 5.7.1
    66Requires PHP: 5.4
    7 Stable tag: 1.1.18
     7Stable tag: 1.1.19
    88License: GPLv3
    99
     
    109109
    110110== Changelog ==
     111= 1.0.19 (2021-05-11) =
     112* Update - When hovering over the Midwest Logistics menu the Orders with Errors menu now shows a count. The count is the number of WooCommerce orders that could not be put into Midwest Logistics. If there is no count there are no orders that need to be reviewed.
     113* Fix - Fixed issue with Midwest Logistics WooCommerce shipping settings not saving properly.
     114
    111115= 1.0.18 (2021-05-11) =
    112116* Update - Added support for WooCommerce USPS and UPS plugins.
Note: See TracChangeset for help on using the changeset viewer.