Changeset 3335917
- Timestamp:
- 07/29/2025 11:49:28 AM (8 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) (8 diffs)
-
includes/cronjob/class-extendago-cronjob-functions.php (modified) (3 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
r3309632 r3335917 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. 66 Version: 1.6.7 7 7 Requires Plugins: woocommerce 8 8 Author: Arture B.V. -
extendago-wp-connection/trunk/includes/api/class-extendago-web-api-functions.php
r3309632 r3335917 38 38 $post_id = $this->functions->custom_get_product_id_by_sku( $product['id'], $product['sku'] ); 39 39 $hide_from_web = 0; 40 foreach( $product['attributes'] as $key => $value){ 41 $value = (array)$value; 42 if( isset($value['hide_from_web']) ){ 43 $hide_from_web = $value['hide_from_web']; 44 break; 40 if( isset($product['attributes']) ) { 41 foreach ($product['attributes'] as $key => $value) { 42 $value = (array)$value; 43 if (isset($value['hide_from_web'])) { 44 $hide_from_web = $value['hide_from_web']; 45 break; 46 } 45 47 } 46 48 } … … 80 82 elseif( isset($product['discount_fixed_price']) && $product['discount_fixed_price'] > 0){ 81 83 $regular_price = $retail_price; 82 $discount_price = $product['discount_fixed_price']; 83 $discount_price = (float)$discount_price; 84 $discount_price = number_format(($product['discount_fixed_price']/100), 2, '.', ''); 84 85 } 85 86 else{ … … 262 263 } 263 264 264 / /VARIABLE PRODUCT | Loop variations and check for sale265 /* VARIABLE PRODUCT | Loop variations and check for sale 265 266 if( isset($product['product_variants']) && !empty($product['product_variants']) ){ 266 267 $all_product_variations = $Product->get_children(); 267 268 268 if( isset($all_product_variations) && !empty($all_product_variations) ){ 269 269 … … 290 290 } 291 291 292 293 292 $Variation = new WC_Product_Variation($variation_post_id); 293 294 // Check if variotion has his own price 295 // if( isset($variation['product_data'][0]->retail_price) && !empty($variation['product_data'][0]->retail_price) ){ 296 // $variation_regular_price = number_format(($variation['product_data'][0]->retail_price/100), 2, '.', ''); 297 // } 298 // else{ 299 // $variation_regular_price = number_format(($product['product_data'][0]->retail_price/100), 2, '.', ''); 300 // } 294 301 295 302 if( isset($product['sale_product']) && $product['sale_product'] ){ … … 307 314 } 308 315 elseif( isset($product['discount_fixed_price']) && !empty($product['discount_fixed_price']) ){ 309 $sale_price = number_format( $product['discount_fixed_price'], 2, '.', '');316 $sale_price = number_format(($product['discount_fixed_price']/100), 2, '.', ''); 310 317 $Variation->set_sale_price($sale_price); 311 318 } … … 330 337 $Variation->set_date_on_sale_to( '' ); 331 338 } 332 333 339 $Variation->save(); 334 340 } … … 338 344 else{ 339 345 $Product->set_stock_quantity($product['stock'] ); 340 } 346 }*/ 341 347 342 348 $wc_tax_class = get_option( $product['product_data'][0]->vat_rate_id ); … … 837 843 $discount_price = $product['discount_price']; 838 844 $discount_price = number_format($discount_price,'2', '.', ''); 839 } else { 845 } 846 elseif( isset($product['discount_fixed_price']) && !empty($product['discount_fixed_price']) ){ 847 $discount_price = number_format(($product['discount_fixed_price']/100), 2, '.', ''); 848 } 849 else { 840 850 $discount_price = NULL; 841 851 } -
extendago-wp-connection/trunk/includes/cronjob/class-extendago-cronjob-functions.php
r3309632 r3335917 137 137 $batch = 0; 138 138 $i = 0; 139 $total_sychronized_products = 0;140 139 $total_products = count($products); 141 140 if( isset($product_id) && !empty($product_id) ) $total_products = 1; … … 182 181 // Check for specific stock location 183 182 $stock_values = $web_api->CurlRequest('/stock_values?filter-product_variant_id=' . $product_variant['id'], 'GET'); 184 if (isset($extendago_location_id) && !empty($extendago_location_id)) { 185 foreach ($stock_values as $stock_value) { 186 if ($stock_value['stock_location_id'] == $extendago_location_id) { 187 $product['product_variants'][$index]['stock'] = floor($stock_value['quantity']); 188 break; 189 } 190 } 191 } else { 192 $product['product_variants'][$index]['stock'] = floor($stock_values[0]['quantity']); 183 if( !empty($stock_values) ) { 184 if (isset($extendago_location_id) && !empty($extendago_location_id)) { 185 foreach ($stock_values as $stock_value) { 186 if ($stock_value['stock_location_id'] == $extendago_location_id) { 187 $product['product_variants'][$index]['stock'] = floor($stock_value['quantity']); 188 break; 189 } 190 } 191 } else { 192 $product['product_variants'][$index]['stock'] = floor($stock_values[0]['quantity']); 193 } 194 } 195 else{ 196 $product['product_variants'][$index]['stock'] = 0; 193 197 } 194 198 } … … 201 205 $products_array[$product['id']] = $product; 202 206 } 203 204 $total_sychronized_products ++;205 207 206 208 // 50 producten per batch -
extendago-wp-connection/trunk/includes/woocommerce/class-extendago-woocommerce-functions.php
r3264425 r3335917 943 943 $order_line_item['product_variant_id'] = get_post_meta($item_data['variation_id'], 'extendago_size_id', true); 944 944 $order_line_item['product_variant_name'] = ( isset($product_full_name[1]) )? $product_full_name[1] : $product_full_name[0]; 945 946 $retail_price = (float)get_post_meta($item_data['variation_id'], '_regular_price', true);947 $retail_price = number_format($retail_price, 2, '', '');948 945 } 949 946 else{ 950 947 // Show full name if it's not a variable product 951 948 $order_line_item['product_name'] = $item_data['name']; 952 953 949 $order_line_item['product_id'] = get_post_meta($item_data['product_id'], 'extendago_product_id', true); 954 $retail_price = (float)get_post_meta($item_data['product_id'], '_price', true); 955 $retail_price = number_format($retail_price, 2, '', ''); 956 } 950 } 951 952 $retail_price = $item->get_total() + $item->get_total_tax(); 953 $retail_price = $retail_price / $item->get_quantity(); 954 $retail_price = number_format($retail_price, 2, '', ''); 957 955 958 956 $product_cat_terms = wp_get_object_terms( $order_line_item['product_id'], 'product_cat' ); … … 1028 1026 } 1029 1027 elseif( $item_data['total'] != $item_data['subtotal'] ){ 1030 1031 1028 $retail_price = ($retail_price / 100); 1032 1029 $selling_price = ($selling_price / 100); -
extendago-wp-connection/trunk/readme.txt
r3309632 r3335917 5 5 Requires at least: 6.0 6 6 Tested up to: 6.8.1 7 Stable tag: 1.6. 67 Stable tag: 1.6.7 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 31 31 == Changelog = 32 32 33 = 1.6.7 = 34 * Bugfix for product fixed price discounts 35 * Fallback for different order line price and product price 36 33 37 = 1.6.6 = 34 38 * Bugfix for product discount batches
Note: See TracChangeset
for help on using the changeset viewer.