Changeset 2973949
- Timestamp:
- 10/02/2023 04:33:32 PM (2 years ago)
- Location:
- extendago-wp-connection/trunk
- Files:
-
- 6 edited
-
extendago-wp-connection.php (modified) (1 diff)
-
includes/admin/partials/extendago_wp_connection_settings_page.php (modified) (1 diff)
-
includes/api/class-extendago-web-api-functions.php (modified) (3 diffs)
-
includes/api/class-extendago-web-api.php (modified) (3 diffs)
-
includes/cronjob/class-extendago-cronjob-functions.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
extendago-wp-connection/trunk/extendago-wp-connection.php
r2956645 r2973949 4 4 Plugin URI: http://www.arture.nl/extendago 5 5 Description: The Wordpress plugin for connecting Woocommerce with Extenda GO / Wallmob. You can manage your products inside Extenda GO or make your webshop as leading foor product manangement. You Stock changes will be two-way binding. 6 Version: 1.4. 26 Version: 1.4.3 7 7 Author: Arture B.V. 8 8 Author URI: https://arture.nl/ -
extendago-wp-connection/trunk/includes/admin/partials/extendago_wp_connection_settings_page.php
r2956645 r2973949 152 152 <?php 153 153 $wizard_completed = get_option('wizard_completed'); 154 if( !isset($wizard_completed) || empty($wizard_completed) ):154 if( $wizard_platform_selected && ( !isset($wizard_completed) || empty($wizard_completed) ) ): 155 155 $install_completed = false; ?> 156 156 -
extendago-wp-connection/trunk/includes/api/class-extendago-web-api-functions.php
r2945883 r2973949 891 891 public function extendago_update_wc_product_stock( $stock_event_line ){ 892 892 893 $logging = new Extendago_WP_Connection_Logging(); 894 893 895 // Variation check 894 896 if( isset($stock_event_line['product_variant_id']) && !empty($stock_event_line['product_variant_id']) ){ 895 897 $variation_post_id = $this->functions->custom_get_variation_id_by_sku( $stock_event_line['product_variant_id'] ); 898 899 $logging->log_file_write('ExtendaGo | Processing stock change for product ' . $stock_event_line['product_id'] . '/' . $stock_event_line['product_variant_id'] . ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ')'); 896 900 897 901 // Check if variation exist … … 946 950 } 947 951 } 952 else{ 953 $logging->log_file_write('WARNING | Product variation not found with ID: ' . $stock_event_line['product_variant_id']); 954 } 948 955 } 949 956 else{ 950 957 951 958 $product_id = $this->functions->custom_get_product_id_by_sku( $stock_event_line['product_id'], $stock_event_line['product_id'] ); 959 960 $logging->log_file_write('ExtendaGo | Processing stock change for product ' . $stock_event_line['product_id'] . ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ')'); 952 961 953 962 // Check if product exist 954 963 if (isset($product_id) && !empty($product_id)) { 955 964 956 $Product = new WC_Product_Simple($product_id);965 $Product = wc_get_product( $product_id ); 957 966 $product_exist = true; 958 967 … … 1018 1027 // If error storing temporarily, return the error. 1019 1028 if ( is_wp_error( $file_array['tmp_name'] ) ) { 1029 $attach_id = ''; 1020 1030 $logging->log_file_write( 'ERROR | Error while storing file temporarily' ); 1021 1031 } 1022 1023 // Store and validate1024 $attach_id = media_handle_sideload( $file_array, $post_id, $desc );1025 1026 // Unlink if couldn't store permanently1027 if ( is_wp_error( $attach_id ) ) {1028 unlink( $file_array['tmp_name'] );1029 $attach_id = '';1030 $logging->log_file_write( 'ERROR | Couldn\'t store upload permanently' );1031 }1032 1032 else{ 1033 // Store and validate 1034 $attach_id = media_handle_sideload( $file_array, $post_id, $desc ); 1035 1036 // Unlink if couldn't store permanently 1037 if ( is_wp_error( $attach_id ) ) { 1038 unlink( $file_array['tmp_name'] ); 1039 $attach_id = ''; 1040 $logging->log_file_write( 'ERROR | Couldn\'t store upload permanently' ); 1041 } 1042 } 1033 1043 } 1034 1044 -
extendago-wp-connection/trunk/includes/api/class-extendago-web-api.php
r2956966 r2973949 36 36 $url = $this->extendago_api_url . $request; 37 37 } 38 38 39 39 curl_setopt($ch, CURLOPT_URL, $url); 40 40 … … 74 74 } 75 75 else { 76 $Error =strtoupper($method)."-Request: " .$request." returned with http-code: ".$http_code.". Response: ".$result;76 $Error =strtoupper($method)."-Request: " .$request. " returned with http-code: ".$http_code.". Response: ".$result; 77 77 } 78 78 } 79 79 else { 80 $Error = strtoupper($method)."-Request Request: ".$request." returned with http-code: ".$http_code.". Response: ".$result;80 $Error = strtoupper($method)."-Request: " .$request. " returned with http-code: ".$http_code.". Response: ".$result; 81 81 } 82 82 } … … 116 116 } 117 117 118 return ;118 return NULL; 119 119 } 120 120 -
extendago-wp-connection/trunk/includes/cronjob/class-extendago-cronjob-functions.php
r2956645 r2973949 836 836 if( empty($ProductResponse) || isset($ProductResponse['error']) ){ 837 837 $ProductResponse = $Extendago->CurlRequest('/products', 'POST', $ExtendagoProductJSON, false, true); 838 if( is_null($ProductResponse) ){ 839 unset($ExtendagoProductJSON['image']); 840 $this->logging->log_file_write('ERROR | Product ' . $product['id'] . ' image is not available of too large'); 841 $ProductResponse = $Extendago->CurlRequest('/products', 'POST', $ExtendagoProductJSON, false, true); 842 } 838 843 } 839 844 else{ … … 847 852 else{ 848 853 $ProductResponse = $Extendago->CurlRequest('/products/'.$product['id'], 'PATCH', $ExtendagoProductJSON, false, true); 854 if( is_null($ProductResponse) ){ 855 unset($ExtendagoProductJSON['image']); 856 $this->logging->log_file_write('ERROR | Product ' . $product['id'] . ' image is not available of too large'); 857 $ProductResponse = $Extendago->CurlRequest('/products/'.$product['id'], 'PATCH', $ExtendagoProductJSON, false, true); 858 } 849 859 } 850 860 } … … 965 975 $Response = $Extendago->CurlRequest('/stock_values?filter-product_variant_id='.$product_variant['id'], 'GET'); 966 976 967 if( !isset($variation->stock) || empty($variation->stock)) {977 if( !isset($variation->stock) || $variation->stock == '' ) { 968 978 $this->logging->log_file_write('EXPORT | Product variation ID ' . $product_variant['id'] . ' has no stock value!'); 969 979 } … … 1501 1511 $total_sychronized_stock_changes++; 1502 1512 1503 $this->logging->log_file_write('ExtendaGo | ' . strtok($stock_change['reference_id'], ' -') . ' for product ' . $stock_event_line['product_id'].'/'.$stock_event_line['product_variant_id'] . ' changing stock to ' .$stock_event_line['current_quantity']. ' ('.$stock_event_line['delta_quantity'].')');1504 1505 1513 // Save new product stock values 1506 1514 $api_functions->extendago_update_wc_product_stock($stock_event_line); -
extendago-wp-connection/trunk/readme.txt
r2956645 r2973949 5 5 Requires at least: 6.0 6 6 Tested up to: 6.3.0 7 Stable tag: 1.4. 27 Stable tag: 1.4.3 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 30 30 31 31 == Changelog == 32 33 = 1.4.3 = 34 * Some minor improvements and code updates 32 35 33 36 = 1.4.2 =
Note: See TracChangeset
for help on using the changeset viewer.