Changeset 3043693
- Timestamp:
- 03/01/2024 02:15:15 PM (2 years ago)
- Location:
- extendago-wp-connection/trunk
- Files:
-
- 5 edited
-
extendago-wp-connection.php (modified) (1 diff)
-
includes/admin/class-extendago-wp-connection-admin.php (modified) (10 diffs)
-
includes/cronjob/class-extendago-cronjob-functions.php (modified) (4 diffs)
-
includes/woocommerce/class-extendago-woocommerce-functions.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
extendago-wp-connection/trunk/extendago-wp-connection.php
r3020847 r3043693 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. 76 Version: 1.4.8 7 7 Author: Arture B.V. 8 8 Author URI: https://arture.nl/ -
extendago-wp-connection/trunk/includes/admin/class-extendago-wp-connection-admin.php
r3020847 r3043693 115 115 add_settings_field('extendago_tax_rates', 'Tax rates', array( $this, 'display_extendago_tax_rates_element' ), 'extendago_woocommerce_options', 'woocommerce_section'); 116 116 add_settings_field('extendago_wc_new_order', esc_html(__('Orders', 'extendago-wp-connection-plugin')), array( $this, 'display_extendago_wc_new_order_element' ), 'extendago_woocommerce_options', 'woocommerce_section'); 117 add_settings_field('extendago_skip_order_processing', esc_html(__('Exclude orders', 'extendago-wp-connection-plugin')), array( $this, 'display_extendago_skip_order_processing_element' ), 'extendago_woocommerce_options', 'woocommerce_section'); 117 118 add_settings_field('extendago_costs_field', esc_html(__('Costs field', 'extendago-wp-connection-plugin')), array( $this, 'display_extendago_costs_field_element' ), 'extendago_woocommerce_options', 'woocommerce_section'); 118 119 add_settings_field('extendago_click_and_collect', esc_html(__('Click and Collect BETA!', 'extendago-wp-connection-plugin')), array( $this, 'display_extendago_click_and_collect_element' ), 'extendago_woocommerce_options', 'woocommerce_section'); … … 142 143 register_setting('extendago_woocommerce_options', 'extendago_location_id'); 143 144 register_setting('extendago_woocommerce_options', 'extendago_wc_new_order'); 145 register_setting('extendago_woocommerce_options', 'extendago_skip_order_processing'); 144 146 register_setting('extendago_woocommerce_options', 'extendago_costs_field'); 145 147 register_setting('extendago_woocommerce_options', 'extendago_click_and_collect'); … … 475 477 <?php echo __('On: Images are updated/processed from ExtendaGo in Woocommerce. ( Recommended )', 'extendago-wp-connection'); ?> 476 478 <br/> 477 <?php echo __('Off: Off images will be processed in Woocommerce.', 'extendago-wp-connection'); ?>479 <?php echo __('Off: Images will be processed in Woocommerce.', 'extendago-wp-connection'); ?> 478 480 </div> 479 481 <?php … … 505 507 <div class="info"> 506 508 <?php echo __('On: The description present in ExtendaGo is also processed, in addition to processing in the content, as a short product description in Woocommerce.', 'extendago-wp-connection'); ?><br/> 507 <?php echo __('Off: The product short description in Woocommerce is Offt filled.( Recommended )', 'extendago-wp-connection'); ?>509 <?php echo __('Off: The product short description in Woocommerce won\'t be filled ( Recommended )', 'extendago-wp-connection'); ?> 508 510 </div> 509 511 <?php … … 516 518 </label> 517 519 <div class="info"> 518 <?php echo __('On: The first image from ExtendaGo w ill Offt be added to the product gallery and will only be set as a featured image. ( Recommended )', 'extendago-wp-connection'); ?><br/>520 <?php echo __('On: The first image from ExtendaGo won\'t be added to the product gallery and will only be set as a featured image. ( Recommended )', 'extendago-wp-connection'); ?><br/> 519 521 <?php echo __('Off: The first image from ExtendaGo is also added to the product gallery.', 'extendago-wp-connection'); ?> 520 522 </div> … … 529 531 <div class="info"> 530 532 <?php echo __('On: The category structure is automatically created/updated from ExtendaGo as set per product. ( Recommended )', 'extendago-wp-connection'); ?><br/> 531 <?php echo __('Off: The category structure is Offt processed inWoocommerce.', 'extendago-wp-connection'); ?>533 <?php echo __('Off: The category structure won\'t created inside Woocommerce.', 'extendago-wp-connection'); ?> 532 534 </div> 533 535 <?php … … 562 564 </label> 563 565 <div class="info"> 564 <?php echo __('On: The product title is Offt updated and can be changed manually in Woocommerce.', 'extendago-wp-connection'); ?><br/>565 <?php echo __('Off: The product title is automatically processed from ExtendaGo. ( Recommended )', 'extendago-wp-connection'); ?>566 <?php echo __('On: The product title won\'t updated and can be changed manually in Woocommerce.', 'extendago-wp-connection'); ?><br/> 567 <?php echo __('Off: The product title is automatically updated from ExtendaGo. ( Recommended )', 'extendago-wp-connection'); ?> 566 568 </div> 567 569 <?php … … 574 576 </label> 575 577 <div class="info"> 576 <?php echo __('On: The product description is Offt updated and can be changed manually in Woocommerce.', 'extendago-wp-connection'); ?><br/>577 <?php echo __('Off: The product description is automatically processed from ExtendaGo. ( Recommended )', 'extendago-wp-connection'); ?>578 <?php echo __('On: The product description won\'t updated and can be changed manually in Woocommerce.', 'extendago-wp-connection'); ?><br/> 579 <?php echo __('Off: The product description is automatically updated from ExtendaGo. ( Recommended )', 'extendago-wp-connection'); ?> 578 580 </div> 579 581 <?php … … 587 589 <div class="info"> 588 590 <?php echo __('On: The product category structure will remain unchanged and can be changed manually in Woocommerce.', 'extendago-wp-connection'); ?><br/> 589 <?php echo __('Off: The product category structure is automatically processed from ExtendaGo. ( Recommended )', 'extendago-wp-connection'); ?>591 <?php echo __('Off: The product category structure is automatically updated from ExtendaGo. ( Recommended )', 'extendago-wp-connection'); ?> 590 592 </div> 591 593 <?php … … 819 821 820 822 <div class="info"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> 821 <?php echo __('When enabled; new paid order(s) will automatically created in ExtendaGo including refund orders!', 'extendago-wp-connection-plugin'); ?> 823 <?php echo __('When enabled; new paid (with status processing/completed) order(s) will automatically created in ExtendaGo including refund orders!', 'extendago-wp-connection-plugin'); ?> 824 </div> 825 <?php 826 } 827 else{ 828 echo '<div class="alert alert-warning" role="alert">'. __( 'Unable to activate this action. API settings are empty or wrong!', 'extendago-wp-connection-plugin' ) . '</div>'; 829 } 830 } 831 else { 832 echo '<div class="alert alert-warning" role="alert">' . __( 'Woocommerce not activated!', 'extendago-wp-connection-plugin' ) . '</div>'; 833 } 834 } 835 836 public function display_extendago_skip_order_processing_element() { 837 838 global $woocommerce; 839 840 $wc_payment_gateways = $woocommerce->payment_gateways->payment_gateways(); 841 $extendago_skip_order_processing = (array)get_option( 'extendago_skip_order_processing' ); 842 843 if ( class_exists( 'WooCommerce' ) ) { 844 845 // Check if connection available 846 if ( $this->active_connection ) { ?> 847 <select name="extendago_skip_order_processing[]" multiple> 848 <option value=""><?php echo __( 'Select payment method', 'extendago-wp-connection-plugin' ); ?></option> 849 <?php 850 // Iterate Woocommerce vat rates 851 foreach ( $wc_payment_gateways as $wc_payment_gateway ): ?> 852 <option value="<?php echo $wc_payment_gateway->id; ?>" <?php echo ( isset( $extendago_skip_order_processing ) && in_array($wc_payment_gateway->id, $extendago_skip_order_processing) ) ? 'selected=selected' : ''; ?>><?php echo $wc_payment_gateway->title; ?></option> 853 <?php endforeach;?> 854 </select> 855 856 <div class="info"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> 857 <?php echo __('When payment method selected these type of orders will be skipped from processing in Extenda GO', 'extendago-wp-connection-plugin'); ?> 822 858 </div> 823 859 <?php -
extendago-wp-connection/trunk/includes/cronjob/class-extendago-cronjob-functions.php
r3020847 r3043693 414 414 if ( isset($extendago_costs_field) && !empty($extendago_costs_field) ) { 415 415 $cost_price = get_post_meta($product_variation_id, $extendago_costs_field, true); 416 $variant_data['cost_price'] = number_format(((float)$cost_price * 100), 0, '.', ''); 416 417 $cost_price = str_replace(',', '.', $cost_price); 418 $cost_price = preg_replace("/[^0-9\.]/", "", $cost_price); 419 $cost_price = str_replace('.', '',substr($cost_price, 0, -3)) . substr($cost_price, -3); 420 $variant_data['cost_price'] = number_format($cost_price, 2 ); 417 421 } 418 422 … … 432 436 if ( isset($extendago_costs_field) && !empty($extendago_costs_field) ) { 433 437 $cost_price = get_post_meta($product->get_id(), $extendago_costs_field, true); 434 $product_data['cost_price'] = number_format(((float)$cost_price * 100), 0, '.', ''); 438 439 $cost_price = str_replace(',', '.', $cost_price); 440 $cost_price = preg_replace("/[^0-9\.]/", "", $cost_price); 441 $cost_price = str_replace('.', '',substr($cost_price, 0, -3)) . substr($cost_price, -3); 442 $product_data['cost_price'] = number_format($cost_price, 2 ); 435 443 } 436 444 … … 795 803 // Costs of goods 796 804 if ( isset($extendago_costs_field) && !empty($extendago_costs_field) && !empty($product['cost_price']) ) { 797 $product_data[0]['cost_price'] = number_format(((float)$product['cost_price'] * 100), 0, '.', ''); 805 806 $cost_price = str_replace(',', '.', $product['cost_price']); 807 $cost_price = preg_replace("/[^0-9\.]/", "", $cost_price); 808 $cost_price = str_replace('.', '',substr($cost_price, 0, -3)) . substr($cost_price, -3); 809 $product_data[0]['cost_price'] = number_format($cost_price, 2 ); 798 810 } 799 811 … … 860 872 // Costs of goods 861 873 if ( isset($extendago_costs_field) && !empty($extendago_costs_field) ) { 862 $product_variant['product_data'][0]['cost_price'] = number_format(((float)$variation->cost_price * 100), 0, '.', ''); 874 875 $cost_price = str_replace(',', '.', $variation->cost_price); 876 $cost_price = preg_replace("/[^0-9\.]/", "", $cost_price); 877 $cost_price = str_replace('.', '',substr($cost_price, 0, -3)) . substr($cost_price, -3); 878 $product_variant['product_data'][0]['cost_price'] = number_format($cost_price, 2 ); 863 879 } 864 880 -
extendago-wp-connection/trunk/includes/woocommerce/class-extendago-woocommerce-functions.php
r3020847 r3043693 193 193 if ( isset($extendago_costs_field) && !empty($extendago_costs_field) ) { 194 194 $cost_price = get_post_meta($product->get_id(), $extendago_costs_field, true); 195 $product_data['cost_price'] = number_format(((float)$cost_price * 100), 0, '.', ''); 195 196 $cost_price = str_replace(',', '.', $cost_price); 197 $cost_price = preg_replace("/[^0-9\.]/", "", $cost_price); 198 $cost_price = str_replace('.', '',substr($cost_price, 0, -3)) . substr($cost_price, -3); 199 $product_data['cost_price'] = number_format($cost_price, 2 ); 196 200 } 197 201 … … 315 319 if ( isset($extendago_costs_field) && !empty($extendago_costs_field) ) { 316 320 $cost_price = get_post_meta($product_variation_id, $extendago_costs_field, true); 317 $variant_data['cost_price'] = number_format(((float)$cost_price * 100), 0, '.', ''); 321 322 $cost_price = str_replace(',', '.', $cost_price); 323 $cost_price = preg_replace("/[^0-9\.]/", "", $cost_price); 324 $cost_price = str_replace('.', '',substr($cost_price, 0, -3)) . substr($cost_price, -3); 325 $variant_data['cost_price'] = number_format($cost_price, 2 ); 318 326 } 319 327 … … 485 493 $order = new WC_Order( $order_id ); 486 494 495 487 496 if( $refund ){ 488 497 $logging->log_file_write('Refunding | WebOrder status changed to: '.$order->get_status()); … … 490 499 else{ 491 500 $logging->log_file_write('NewOrder | WebOrder status changed to: '.$order->get_status()); 501 } 502 503 504 // SKip order processing for specific payment methods 505 $order_payment_method = $order->get_payment_method(); 506 $extendago_skip_order_processing = (array)get_option( 'extendago_skip_order_processing' ); 507 if ( isset($order_payment_method) && in_array($order_payment_method, $extendago_skip_order_processing) ){ 508 $logging->log_file_write('NewOrder | Order with payment method '.$order_payment_method. ' are exclude from processing to Extenda!'); 509 return ''; 492 510 } 493 511 -
extendago-wp-connection/trunk/readme.txt
r3020847 r3043693 4 4 Tags: extendago, extenda, woocommerce, arture, POS, 5 5 Requires at least: 6.0 6 Tested up to: 6.4. 27 Stable tag: 1.4. 76 Tested up to: 6.4.3 7 Stable tag: 1.4.8 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 31 31 == Changelog == 32 32 33 = 1.4.8 = 34 * New setting to exclude order processing for specific payment methods 35 33 36 = 1.4.7 = 34 37 * Bugfix with costprice fields and different seperators
Note: See TracChangeset
for help on using the changeset viewer.