Plugin Directory

Changeset 3008368


Ignore:
Timestamp:
12/11/2023 08:57:09 PM (2 years ago)
Author:
skynetsolutions
Message:

1.1.22 - Updated plugin to remove the customer key and API version. The customer key and API version are no longer needed.

Location:
midwest-logistics/trunk
Files:
9 edited

Legend:

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

    r2913178 r3008368  
    66}
    77class ML_API {
    8     private $APIURLV1 = 'https://api.midwest-logistics.com/json/';
    9     private $APIURLV2 = 'https://connect.midwest-logistics.com/api/';
     8    private $APIURL = 'https://connect.midwest-logistics.com/api/';
    109    private function get_api_settings() {
    11         $APIURL = $this->APIURLV1;
    12         $APIVersion = "1";
    13         $settingOptions = get_option('Midwest_Logistics_settings','');
    14         if($settingOptions !== "") {
    15             if(isset($settingOptions["Midwest_Logistics_api_version"])) {
    16                 $APIVersion = $settingOptions["Midwest_Logistics_api_version"];   
    17             }
    18            
    19         }
    20         if($APIVersion != null) {
    21             if($APIVersion == "1") {
    22                $APIURL = $this->APIURLV1;
    23             }
    24             if($APIVersion == "2") {
    25                $APIURL = $this->APIURLV2;
    26             }           
    27         }
     10        $APIURL = $this->APIURL;
     11        $APIVersion = "2";
    2812       
    2913        return array(
  • midwest-logistics/trunk/classes/class-ml-order.php

    r2953869 r3008368  
    5252        $default_shipping = $shipping_settings_data["default_shipping"];
    5353        if($default_shipping === "") {
    54             $default_shipping = "5";
     54            $default_shipping = "100000045";
    5555        }
    5656        $mapped_shipping = $shipping_settings_data["enable_mapping"];
     
    8282        $midwest_logistics_order_status_setting = $settingOptions['Midwest_Logistics_select_field_2'];
    8383        $midwest_logistics_api_key = $settingOptions["Midwest_Logistics_API_Key_field_0"];
    84         $midwest_logistics_customer_key = $settingOptions["Midwest_Logistics_customer_id_text_field_1"];
    8584
    8685        // Get an instance of the WC_Order object (same as before)
     
    207206                $jsonArray = [
    208207                    "apiKey" => $midwest_logistics_api_key,
    209                     "customerId" => $midwest_logistics_customer_key,
    210208                    "request" => "addorders",
    211209                    "orders" => [
     
    241239                $httpcode = "500";
    242240                $postString = json_encode ($jsonArray); 
    243 
    244 
    245 
     241               
    246242                $API = new ML_API();
    247243                $response = $API->send($postString);
  • midwest-logistics/trunk/classes/class-ml-settings.php

    r2913178 r3008368  
    3232                'Midwest_Logistics_plugin_Page'
    3333            );
    34            
     34            /*
    3535            add_settings_field(
    3636                'Midwest_Logistics_api_version',
     
    4040                'Midwest_Logistics_Midwest_Logistics_plugin_Page_section'
    4141            );
     42             *
     43             */
    4244            add_settings_field(
    4345                'Midwest_Logistics_text_field_0',
     
    4850            );
    4951
    50             add_settings_field(
    51                 'Midwest_Logistics_customer_id_text_field_1',
    52                 __( 'Customer Key:', 'Midwest_Logistics' ),
    53                 array($this,'customer_id_text_field_1_render'),
    54                 'Midwest_Logistics_plugin_Page',
    55                 'Midwest_Logistics_Midwest_Logistics_plugin_Page_section'
    56             );
    5752            add_settings_field(
    5853                'Midwest_Logistics_select_field_1',
     
    145140        }
    146141
    147         public function customer_id_text_field_1_render(  ) {
    148             $options = get_option( 'Midwest_Logistics_settings' );
    149             $value = "";
    150             if(isset($options['Midwest_Logistics_customer_id_text_field_1'])) {
    151                 $value = $options['Midwest_Logistics_customer_id_text_field_1'];
    152             }
    153             ?>
    154             <input type='text' name='Midwest_Logistics_settings[Midwest_Logistics_customer_id_text_field_1]' value='<?php echo $value ?>'>
    155             <?php
    156         }
    157 
    158142        public function select_field_1_render(  ) {
    159143            $options = get_option( 'Midwest_Logistics_settings' );
     144            if($options == null) {
     145                $options["Midwest_Logistics_select_field_1"] = 1;
     146            }
    160147            ?>
    161148            <select name='Midwest_Logistics_settings[Midwest_Logistics_select_field_1]'>
     
    168155        public function select_field_2_render(  ) {
    169156            $options = get_option( 'Midwest_Logistics_settings' );
     157            if($options == null) {
     158                $options["Midwest_Logistics_select_field_2"] = "1";
     159            }
    170160            $orderStatusArray = wc_get_order_statuses();   
    171161            ?>
     
    184174        public function auto_push_select_field_render(  ) {
    185175            $options = get_option( 'Midwest_Logistics_settings' ); 
     176            if($options == null) {
     177                $options["Midwest_Logistics_auto_push_select_field"] = "";
     178            }
    186179            ?>
    187180            <select name='Midwest_Logistics_settings[Midwest_Logistics_auto_push_select_field]'>
  • midwest-logistics/trunk/classes/class-ml-stock.php

    r2953869 r3008368  
    234234            $jsonArray = [
    235235                "apiKey" => $apiKey,
    236                 "sku" => $skus,
     236                "sku" => $skusJSONArray,
    237237                "request" => "productcheckbylist"
    238238            ];   
     
    241241            $API = new ML_API();
    242242            $APIVersion = $API->get_api_version();
    243             //switch the SKUs for a array
    244             if($APIVersion == "2") {
    245                 $jsonArray["sku"] = $skusJSONArray;
    246             }
    247            
    248243
    249244            $httpcode = "500";
  • midwest-logistics/trunk/classes/class-wc-ml-shipping-options.php

    r2913178 r3008368  
    4242           
    4343            $midwest_logistics_api_key = $settingOptions["Midwest_Logistics_API_Key_field_0"];
    44             $midwest_logistics_customer_key = $settingOptions["Midwest_Logistics_customer_id_text_field_1"];
    4544           
    4645            $jsonArray = [
    4746                "apiKey" => $midwest_logistics_api_key,
    48                 "customerId" => $midwest_logistics_customer_key,
    4947                "request" => "get_shipping_options"               
    5048            ];
  • midwest-logistics/trunk/inc/setupFunctions.php

    r2481617 r3008368  
    9191
    9292    $apiKey = "";
    93     $customerId = "";
    9493    $settingOptions = get_option('Midwest_Logistics_settings','');
    9594    if($settingOptions !== "") {
    9695        $apiKey = $settingOptions["Midwest_Logistics_API_Key_field_0"];
    97         $customerId = $settingOptions["Midwest_Logistics_customer_id_text_field_1"];
    98     }
    99     if ($apiKey === "" || $customerId === "") {
     96    }
     97    if ($apiKey === "" ) {
    10098        ?>
    10199        <div class="notice-error notice is-dismissible">
    102             <p><strong><?php _e( "An API key and customer id is required before " . MIDWESTLOGISTICS_NAME . " plugin can be used.",MIDWESTLOGISTICS_NAME); ?></strong></p>
     100            <p><strong><?php _e( "An API key is required before " . MIDWESTLOGISTICS_NAME . " plugin can be used.",MIDWESTLOGISTICS_NAME); ?></strong></p>
    103101        </div>
    104102        <?php
  • midwest-logistics/trunk/inc/trackingFunctions.php

    r2953869 r3008368  
    119119    if($settingOptions !== "") {
    120120        $apiKey = $settingOptions["Midwest_Logistics_API_Key_field_0"];
    121         $midwest_logistics_customer_key = $settingOptions["Midwest_Logistics_customer_id_text_field_1"];
    122121    }
    123122   
     
    131130    $jsonArray = [
    132131        "apiKey" => $apiKey,
    133         "customerId" => $midwest_logistics_customer_key,
    134132        "request" => "orderStatus",
    135133        "orders" => $orders
  • midwest-logistics/trunk/midwest-wholesale.php

    r2953869 r3008368  
    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.21
    7     * WC requires at least: 3.0.0
    8     * WC tested up to: 8.0.1
     6    * Version:     1.1.22
     7    * WC requires at least: 6.0.0
     8    * WC tested up to: 8.2.0
    99    * Author:      Skynet Solutions Inc.
    1010    * Author URI:  http://www.skynet-solutions.net/
  • midwest-logistics/trunk/readme.txt

    r2953869 r3008368  
    22Contributors: skynetsolutions,burtonm
    33Tags: Midwest Logistics, Distribution, Shipping
    4 Requires at least: 4.0
    5 Tested up to: 6.3.0
    6 Requires PHP: 5.4
    7 Stable tag: 1.1.21
     4Requires at least: 5.0
     5Tested up to: 6.4.1
     6Requires PHP: 7.0
     7Stable tag: 1.1.22
    88License: GPLv3
    99
     
    1818== Installation ==
    1919<h1>Installation</h1>
    20 <ol>
    21 <li>Click on Midwest Logistics (Left Admin Nav Bar) > Settings to set up the Midwest Logistics plugin.</li>
    22 <li>Input your API Key supplied by Midwest Logistics.</li>
    23 <li>Input your Customer Key supplied by Midwest Logistics.</li>
    24 <li>Review other plugin settings on this page and set as needed per your application.</li>
    25 <li>Click the Save Changes button at the bottom when complete.</li>
    26 </ol>
    27 <h2>Simple Product Setup</h2>
    28 <ol>
    29 <li>Edit a product and scroll down to the Product Data section.</li>
    30 <li>In the General section set the Shipped by Midwest Logistics dropdown to Yes.</li>
    31 <li>Directly below that dropdown enter the product SKU that Midwest Logistics is using into the input box labeled Midwest Logistics SKU.</li>
    32 <li>Click the Update button for the product in the top right.</li>
    33 </ol>
    34 
    35 <h2>Variable Product Setup</h2>
    36 <ol>
    37 <li>Edit a product and scroll down to the Product Data section.</li>
    38 <li>In the General section set the Shipped by Midwest Logistics dropdown to Yes.</li>
    39 <li>In the Variables section open up a variable.</li>
    40 <li>At the bottom of that particular Variable settings section set the Shipped by Midwest Logistics dropdown to Yes.</li>
    41 <li>Below that dropdown enter in the Midwest Logistics SKU for that particular variable.</li>
    42 <li>Complete both above steps for all variables within the product.</li>
    43 <li>Click the Save Changes in the bottom of the Product Data Section.</li>
    44 <li>Click the Update button for the product in the top right.</li>
    45 </ol>
    46 
    47 <h2>Shipping Setup</h2>
    48 <ol>
    49 <li>Go to WooCommerce > Settings.</li>
    50 <li>Click on the WooCommerce Shipping Tab.</li>
    51 <li>Click on the Midwest Logistics Tab.</li>
    52 <li>Set your Default Shipping Method in the dropdown.</li>
    53 </ol>
    54 
    55 <h2>Shipping Mapping – Optional</h2>
    56 
    57 <p>You can map your WooCommerce shipping methods with what Midwest Logistics offers per your WooCommerce shipping zones.</p>
    58 <ol>
    59 <li>Go to WooCommerce > Settings > Shipping > Midwest Logistics.</li>
    60 <li>Once you are on the settings section you can set the Enable Rate Mapping dropdown to Yes.</li>
    61 <li>Individually map your zones shipping methods with available methods from Midwest Logistics.</li>
    62 <li>Click the Save Changes button when complete.</li>
    63 </ol>
    64 
    65 <h2>Troubleshooting</h2>
    66 <p>In the event there are errors with sending an orders information to the Midwest Logistics System they will be viewable in the Orders With Errors section.</p>
    67 <ol>
    68 <li>Go to Midwest Logistics (Left Admin Nav Bar) > Orders With Errors.</li>
    69 <li>Most errors are due to the SKU being entered wrong or the product does not exist in the Midwest Logistics System.</li>
    70 <li>Once the problem is remedied you can easily resubmit all orders from this same section.</li>
    71 <li>Further troubleshooting can be completed by using the communication log section with a specific Order ID or Product ID.</li>
    72 </ol>
     20For installation instruction please go to <a hre="https://www.midwest-logistics.com/woocommerce-integration/" title="click to view instructions">https://www.midwest-logistics.com/woocommerce-integration/</a>
    7321
    7422
Note: See TracChangeset for help on using the changeset viewer.