Changeset 3262736
- Timestamp:
- 03/27/2025 10:34:56 AM (12 months ago)
- Location:
- extendago-wp-connection/trunk
- Files:
-
- 5 edited
-
extendago-wp-connection.php (modified) (1 diff)
-
includes/api/class-extendago-web-api-functions.php (modified) (19 diffs)
-
includes/cronjob/class-extendago-cronjob-functions.php (modified) (5 diffs)
-
includes/woocommerce/class-extendago-woocommerce-functions.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
extendago-wp-connection/trunk/extendago-wp-connection.php
r3258358 r3262736 4 4 Plugin URI: https://extendago-connect.com/ 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.6. 36 Version: 1.6.4 7 7 Requires Plugins: woocommerce 8 8 Author: Arture B.V. -
extendago-wp-connection/trunk/includes/api/class-extendago-web-api-functions.php
r3255254 r3262736 4 4 private $functions; 5 5 private $extendago_masterdata; 6 private $logging; 6 7 7 8 public function __construct() { … … 20 21 $this->extendago_masterdata = $extendago_masterdata; 21 22 } 23 24 $this->logging = new ExtendaGo_WP_Connection_Logging(); 22 25 } 23 26 24 27 public function extendago_update_wc_product( $product, $full_sync = false ){ 25 26 $logging = new ExtendaGo_WP_Connection_Logging();27 28 28 $product = apply_filters('before_extendago_product_process', $product); 29 29 … … 48 48 if( $hide_from_web == '1' || isset($product['active']) && $product['active'] == '0' ){ 49 49 if (isset($post_id) && !empty($post_id)) { 50 $ logging->log_file_write('GetProductRemoved | Product removed from webshop ' . $post_id);50 $this->logging->log_file_write('GetProductRemoved | Product removed from webshop ' . $post_id); 51 51 wp_trash_post($post_id); 52 52 return true; … … 281 281 if( isset($new_product_size_list) && !empty($new_product_size_list) ) { 282 282 if (!in_array($extendago_size_id, $new_product_size_list)) { 283 $logging = new ExtendaGo_WP_Connection_Logging(); 284 $logging->log_file_write('NOTICE | Variation ' . $variation_post_id . ' deleted from product: ' . $post_id); 283 $this->logging->log_file_write('NOTICE | Variation ' . $variation_post_id . ' deleted from product: ' . $post_id); 285 284 wp_delete_post($variation_post_id, true); 286 285 } … … 468 467 if (!isset($extendago_keep_product_status) || !$extendago_keep_product_status) { 469 468 $Product->set_status($no_image_post_status); 470 $ logging->log_file_write('Status | Post (' . $post_id . ') has no image. Updating post-status to: ' . $no_image_post_status);469 $this->logging->log_file_write('Status | Post (' . $post_id . ') has no image. Updating post-status to: ' . $no_image_post_status); 471 470 } 472 471 } … … 554 553 } 555 554 555 $product_categories = array_values($product_categories); 556 556 $product_category_index = array_search($product_category_name, array_column($product_categories, 'name')); 557 557 … … 680 680 if( isset($attribute_id->errors) ){ 681 681 foreach( $attribute_id->errors as $error ){ 682 $logging = new ExtendaGo_WP_Connection_Logging(); 683 $logging->log_file_write('ERROR | ' . $error[0]); 682 $this->logging->log_file_write('ERROR | ' . $error[0]); 684 683 } 685 684 } … … 710 709 711 710 public function insert_product_variations( $post_id, $product ){ 712 713 // Load classes714 $logging = new Extendago_WP_Connection_Logging();715 716 711 $variations = $product['product_variants']; 717 712 … … 749 744 if( count($product_variations_by_size_id) > 0 ){ 750 745 foreach( $product_variations_by_size_id as $product_variation_by_size_id ){ 751 $ logging->log_file_write('NOTICE | Duplicate variation delete by size_id: ' .$product_variation_by_size_id->ID. ' for post ID: ' .$post_id);746 $this->logging->log_file_write('NOTICE | Duplicate variation delete by size_id: ' .$product_variation_by_size_id->ID. ' for post ID: ' .$post_id); 752 747 wp_delete_post($product_variation_by_size_id->ID); 753 748 } … … 940 935 public function extendago_update_wc_product_stock( $stock_event_line ){ 941 936 942 $logging = new Extendago_WP_Connection_Logging();943 944 937 // Variation check 945 938 if( isset($stock_event_line['product_variant_id']) && !empty($stock_event_line['product_variant_id']) ){ … … 950 943 $product_id = wp_get_post_parent_id($variation_post_id); 951 944 952 $ logging->log_file_write('ExtendaGo | Processing stock change for product ' . $stock_event_line['product_id'] . '/' . $stock_event_line['product_variant_id'] . ' | ' .$product_id. ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ')');945 $this->logging->log_file_write('ExtendaGo | Processing stock change for product ' . $stock_event_line['product_id'] . '/' . $stock_event_line['product_variant_id'] . ' | ' .$product_id. ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ')'); 953 946 954 947 if ( FALSE === get_post_status( $product_id ) ) { … … 980 973 // Check if all variatons are out of stock 981 974 if( is_null( get_post($product_id) ) ) { 982 $logging = new ExtendaGo_WP_Connection_Logging(); 983 $logging->log_file_write( 'NOTICE | Product ID '.$product_id.' no longer exist' ); 975 $this->logging->log_file_write( 'NOTICE | Product ID '.$product_id.' no longer exist' ); 984 976 } 985 977 else { … … 1000 992 } 1001 993 else{ 1002 $ logging->log_file_write('WARNING | Product variation not found with ID: ' . $stock_event_line['product_variant_id']);994 $this->logging->log_file_write('WARNING | Product variation not found with ID: ' . $stock_event_line['product_variant_id']); 1003 995 } 1004 996 } … … 1010 1002 if (isset($product_id) && !empty($product_id)) { 1011 1003 1012 $ logging->log_file_write('ExtendaGo | Processing stock change for product ' . $stock_event_line['product_id'] . ' | ' .$product_id. ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ') Product ID not found!');1004 $this->logging->log_file_write('ExtendaGo | Processing stock change for product ' . $stock_event_line['product_id'] . ' | ' .$product_id. ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ') Product ID not found!'); 1013 1005 1014 1006 $Product = wc_get_product( $product_id ); … … 1032 1024 } 1033 1025 else{ 1034 $ logging->log_file_write('ExtendaGo | Unable processing stock change for product ' . $stock_event_line['product_id'] . ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ') Product ID not found!');1026 $this->logging->log_file_write('ExtendaGo | Unable processing stock change for product ' . $stock_event_line['product_id'] . ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ') Product ID not found!'); 1035 1027 } 1036 1028 } … … 1046 1038 1047 1039 function upload_external_file( $file, $post_id = 0, $desc = null ) { 1048 1049 $logging = new ExtendaGo_WP_Connection_Logging();1050 1051 1040 require_once(ABSPATH . "wp-admin" . '/includes/image.php'); 1052 1041 require_once(ABSPATH . "wp-admin" . '/includes/file.php'); … … 1054 1043 1055 1044 if( empty( $file ) ) { 1056 $ logging->log_file_write( 'ERROR | File is empty' );1045 $this->logging->log_file_write( 'ERROR | File is empty' ); 1057 1046 } 1058 1047 … … 1080 1069 if ( is_wp_error( $file_array['tmp_name'] ) ) { 1081 1070 $attach_id = ''; 1082 $ logging->log_file_write( 'ERROR | Error while storing file temporarily' );1071 $this->logging->log_file_write( 'ERROR | Error while storing file temporarily' ); 1083 1072 } 1084 1073 else{ … … 1090 1079 unlink( $file_array['tmp_name'] ); 1091 1080 $attach_id = ''; 1092 $ logging->log_file_write( 'ERROR | Couldn\'t store upload permanently' );1081 $this->logging->log_file_write( 'ERROR | Couldn\'t store upload permanently' ); 1093 1082 } 1094 1083 } -
extendago-wp-connection/trunk/includes/cronjob/class-extendago-cronjob-functions.php
r3258358 r3262736 22 22 $this->logging->log_file_write( 'INIT | Total Synchronisation' ); 23 23 $this->extendago_woocommerce_sync(); 24 http_response_code(200); 24 25 exit; 25 26 } … … 38 39 $this->process_imported_extendago_batches(); 39 40 } 41 http_response_code(200); 40 42 exit; 41 43 } … … 43 45 if( $this->endsWith($_SERVER["REQUEST_URI"], '/extendago-process-export') ){ 44 46 $this->process_exported_woocommerce_batches(); 47 http_response_code(200); 45 48 exit; 46 49 } … … 59 62 $this->process_changes_wc_products(); 60 63 } 64 http_response_code(200); 61 65 exit; 62 66 } … … 74 78 $this->process_stockchanges(); 75 79 } 80 http_response_code(200); 76 81 exit; 77 82 } -
extendago-wp-connection/trunk/includes/woocommerce/class-extendago-woocommerce-functions.php
r3257883 r3262736 208 208 if( isset($product_categories) && !empty($product_categories) ){ 209 209 foreach( $product_categories as $product_category ){ 210 $product_data['categories'][$product_category->term_id] = array( 210 211 // 27-03-2025 212 $product_category_id = $product_category->term_id; 213 $extendago_category_id = get_term_meta( $product_category->term_id, "extendago_id", true); 214 if( isset($extendago_category_id) && !empty($extendago_category_id) ){ 215 $product_category_id = $extendago_category_id; 216 } 217 218 $product_data['categories'][$product_category_id] = array( 211 219 'name' => $product_category->name, 212 220 'slug' => $product_category->slug, … … 609 617 if (isset($product_categories) && !empty($product_categories)) { 610 618 foreach ($product_categories as $product_category) { 611 $product_data['categories'][$product_category->term_id] = array( 619 620 // 27-03-2025 621 $product_category_id = $product_category->term_id; 622 $extendago_category_id = get_term_meta( $product_category->term_id, "extendago_id", true); 623 if( isset($extendago_category_id) && !empty($extendago_category_id) ){ 624 $product_category_id = $extendago_category_id; 625 } 626 627 $product_data['categories'][$product_category_id] = array( 612 628 'name' => $product_category->name, 613 629 'slug' => $product_category->slug, -
extendago-wp-connection/trunk/readme.txt
r3258358 r3262736 5 5 Requires at least: 6.0 6 6 Tested up to: 6.7.1 7 Stable tag: 1.6. 37 Stable tag: 1.6.4 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 31 31 == Changelog = 32 32 33 = 1.6.4 = 34 * Bugfix with imported Extenda categories and unique mapping ID 35 33 36 = 1.6.3 = 34 37 * Minor bugfix inside export processing runs
Note: See TracChangeset
for help on using the changeset viewer.