Changeset 3008368
- Timestamp:
- 12/11/2023 08:57:09 PM (2 years ago)
- Location:
- midwest-logistics/trunk
- Files:
-
- 9 edited
-
classes/class-ml-api.php (modified) (1 diff)
-
classes/class-ml-order.php (modified) (4 diffs)
-
classes/class-ml-settings.php (modified) (6 diffs)
-
classes/class-ml-stock.php (modified) (2 diffs)
-
classes/class-wc-ml-shipping-options.php (modified) (1 diff)
-
inc/setupFunctions.php (modified) (1 diff)
-
inc/trackingFunctions.php (modified) (2 diffs)
-
midwest-wholesale.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
midwest-logistics/trunk/classes/class-ml-api.php
r2913178 r3008368 6 6 } 7 7 class 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/'; 10 9 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"; 28 12 29 13 return array( -
midwest-logistics/trunk/classes/class-ml-order.php
r2953869 r3008368 52 52 $default_shipping = $shipping_settings_data["default_shipping"]; 53 53 if($default_shipping === "") { 54 $default_shipping = " 5";54 $default_shipping = "100000045"; 55 55 } 56 56 $mapped_shipping = $shipping_settings_data["enable_mapping"]; … … 82 82 $midwest_logistics_order_status_setting = $settingOptions['Midwest_Logistics_select_field_2']; 83 83 $midwest_logistics_api_key = $settingOptions["Midwest_Logistics_API_Key_field_0"]; 84 $midwest_logistics_customer_key = $settingOptions["Midwest_Logistics_customer_id_text_field_1"];85 84 86 85 // Get an instance of the WC_Order object (same as before) … … 207 206 $jsonArray = [ 208 207 "apiKey" => $midwest_logistics_api_key, 209 "customerId" => $midwest_logistics_customer_key,210 208 "request" => "addorders", 211 209 "orders" => [ … … 241 239 $httpcode = "500"; 242 240 $postString = json_encode ($jsonArray); 243 244 245 241 246 242 $API = new ML_API(); 247 243 $response = $API->send($postString); -
midwest-logistics/trunk/classes/class-ml-settings.php
r2913178 r3008368 32 32 'Midwest_Logistics_plugin_Page' 33 33 ); 34 34 /* 35 35 add_settings_field( 36 36 'Midwest_Logistics_api_version', … … 40 40 'Midwest_Logistics_Midwest_Logistics_plugin_Page_section' 41 41 ); 42 * 43 */ 42 44 add_settings_field( 43 45 'Midwest_Logistics_text_field_0', … … 48 50 ); 49 51 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 );57 52 add_settings_field( 58 53 'Midwest_Logistics_select_field_1', … … 145 140 } 146 141 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 <?php156 }157 158 142 public function select_field_1_render( ) { 159 143 $options = get_option( 'Midwest_Logistics_settings' ); 144 if($options == null) { 145 $options["Midwest_Logistics_select_field_1"] = 1; 146 } 160 147 ?> 161 148 <select name='Midwest_Logistics_settings[Midwest_Logistics_select_field_1]'> … … 168 155 public function select_field_2_render( ) { 169 156 $options = get_option( 'Midwest_Logistics_settings' ); 157 if($options == null) { 158 $options["Midwest_Logistics_select_field_2"] = "1"; 159 } 170 160 $orderStatusArray = wc_get_order_statuses(); 171 161 ?> … … 184 174 public function auto_push_select_field_render( ) { 185 175 $options = get_option( 'Midwest_Logistics_settings' ); 176 if($options == null) { 177 $options["Midwest_Logistics_auto_push_select_field"] = ""; 178 } 186 179 ?> 187 180 <select name='Midwest_Logistics_settings[Midwest_Logistics_auto_push_select_field]'> -
midwest-logistics/trunk/classes/class-ml-stock.php
r2953869 r3008368 234 234 $jsonArray = [ 235 235 "apiKey" => $apiKey, 236 "sku" => $skus ,236 "sku" => $skusJSONArray, 237 237 "request" => "productcheckbylist" 238 238 ]; … … 241 241 $API = new ML_API(); 242 242 $APIVersion = $API->get_api_version(); 243 //switch the SKUs for a array244 if($APIVersion == "2") {245 $jsonArray["sku"] = $skusJSONArray;246 }247 248 243 249 244 $httpcode = "500"; -
midwest-logistics/trunk/classes/class-wc-ml-shipping-options.php
r2913178 r3008368 42 42 43 43 $midwest_logistics_api_key = $settingOptions["Midwest_Logistics_API_Key_field_0"]; 44 $midwest_logistics_customer_key = $settingOptions["Midwest_Logistics_customer_id_text_field_1"];45 44 46 45 $jsonArray = [ 47 46 "apiKey" => $midwest_logistics_api_key, 48 "customerId" => $midwest_logistics_customer_key,49 47 "request" => "get_shipping_options" 50 48 ]; -
midwest-logistics/trunk/inc/setupFunctions.php
r2481617 r3008368 91 91 92 92 $apiKey = ""; 93 $customerId = "";94 93 $settingOptions = get_option('Midwest_Logistics_settings',''); 95 94 if($settingOptions !== "") { 96 95 $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 === "" ) { 100 98 ?> 101 99 <div class="notice-error notice is-dismissible"> 102 <p><strong><?php _e( "An API key and customer idis 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> 103 101 </div> 104 102 <?php -
midwest-logistics/trunk/inc/trackingFunctions.php
r2953869 r3008368 119 119 if($settingOptions !== "") { 120 120 $apiKey = $settingOptions["Midwest_Logistics_API_Key_field_0"]; 121 $midwest_logistics_customer_key = $settingOptions["Midwest_Logistics_customer_id_text_field_1"];122 121 } 123 122 … … 131 130 $jsonArray = [ 132 131 "apiKey" => $apiKey, 133 "customerId" => $midwest_logistics_customer_key,134 132 "request" => "orderStatus", 135 133 "orders" => $orders -
midwest-logistics/trunk/midwest-wholesale.php
r2953869 r3008368 4 4 * Plugin URI: https://plugins.skynet-solutions.net/ 5 5 * Description: Midwest Wholesale Plugin allows you to automatically add Woocommerce orders into the Midwest Logistics order system. 6 * Version: 1.1.2 17 * WC requires at least: 3.0.08 * WC tested up to: 8. 0.16 * Version: 1.1.22 7 * WC requires at least: 6.0.0 8 * WC tested up to: 8.2.0 9 9 * Author: Skynet Solutions Inc. 10 10 * Author URI: http://www.skynet-solutions.net/ -
midwest-logistics/trunk/readme.txt
r2953869 r3008368 2 2 Contributors: skynetsolutions,burtonm 3 3 Tags: Midwest Logistics, Distribution, Shipping 4 Requires at least: 4.05 Tested up to: 6. 3.06 Requires PHP: 5.47 Stable tag: 1.1.2 14 Requires at least: 5.0 5 Tested up to: 6.4.1 6 Requires PHP: 7.0 7 Stable tag: 1.1.22 8 8 License: GPLv3 9 9 … … 18 18 == Installation == 19 19 <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> 20 For 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> 73 21 74 22
Note: See TracChangeset
for help on using the changeset viewer.