Changeset 3350913
- Timestamp:
- 08/27/2025 07:32:53 AM (7 months ago)
- Location:
- storecontrl-wp-connection/trunk
- Files:
-
- 10 edited
-
includes/admin/class-storecontrl-wp-connection-admin.php (modified) (3 diffs)
-
includes/admin/partials/storecontrl_wp_connection_settings_page.php (modified) (1 diff)
-
includes/api/class-arture-web-api.php (modified) (1 diff)
-
includes/api/class-storecontrl-web-api-functions.php (modified) (4 diffs)
-
includes/api/class-storecontrl-web-api.php (modified) (3 diffs)
-
includes/class-storecontrl-wp-connection-functions.php (modified) (1 diff)
-
includes/cronjob/class-storecontrl-cronjob-functions.php (modified) (2 diffs)
-
includes/woocommerce/class-storecontrl-woocommerce-functions.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
storecontrl-wp-connection.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
storecontrl-wp-connection/trunk/includes/admin/class-storecontrl-wp-connection-admin.php
r3331152 r3350913 1036 1036 // Iterate Woocommerce payment methods 1037 1037 if( is_array($wc_payment_gateways) ): 1038 1039 1038 1040 foreach( $wc_payment_gateways as $gateway_name => $wc_payment_gateway ): 1039 1041 … … 1044 1046 $value = get_option( "storecontrl_wc_payment_method_".$gateway_name ); ?> 1045 1047 <tr> 1046 <td><?php echo $wc_payment_gateway-> title; ?></td>1048 <td><?php echo $wc_payment_gateway->get_title(); ?></td> 1047 1049 <td> 1048 1050 <select class="storecontrl_wc_payment_method" name="storecontrl_wc_payment_method_<?php echo $gateway_name; ?>"> … … 1354 1356 } 1355 1357 else{ 1356 $dom = new DOMDocument(); 1357 $dom->loadHTML($results); 1358 1359 $xpath = new DOMXpath($dom); 1360 $result = $xpath->query('//h2'); 1361 if ($result->length > 0) { 1362 $error = $result->item(0)->nodeValue; 1363 1364 wp_send_json_success( 1365 array( 1366 'answer' => 'true', 1367 'html' => '<div class="notice notice-error"><p>' .$error. '</p></div>' 1368 ) 1369 ); 1358 if( !empty($results) ) { 1359 $dom = new DOMDocument(); 1360 $dom->loadHTML($results); 1361 1362 $xpath = new DOMXpath($dom); 1363 $result = $xpath->query('//h2'); 1364 if ($result->length > 0) { 1365 $error = $result->item(0)->nodeValue; 1366 1367 wp_send_json_success( 1368 array( 1369 'answer' => 'true', 1370 'html' => '<div class="notice notice-error"><p>' . $error . '</p></div>' 1371 ) 1372 ); 1373 } 1370 1374 } 1371 1375 else{ -
storecontrl-wp-connection/trunk/includes/admin/partials/storecontrl_wp_connection_settings_page.php
r3331152 r3350913 20 20 21 21 <?php 22 23 // $test = new StoreContrl_Woocommerce_Functions();24 // $test->check_storecontrl_gift_voucher();25 26 22 $storecontrl_api_arture_key = get_option('storecontrl_api_arture_key'); 27 23 if( !isset($storecontrl_api_arture_key) || empty($storecontrl_api_arture_key) ): ?> -
storecontrl-wp-connection/trunk/includes/api/class-arture-web-api.php
r2933302 r3350913 34 34 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 35 35 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 36 curl_setopt($curl, CURLOPT_TIMEOUT, 10); 36 37 37 38 // Get the response from the api call -
storecontrl-wp-connection/trunk/includes/api/class-storecontrl-web-api-functions.php
r3331152 r3350913 76 76 if (isset($product['sku_id'])) { 77 77 $total_sychronized_stock_changes++; 78 $logging->log_file_write('StoreContrl | Update stock of SKU: ' . $product['sku_id']. ' with new stock total: ' .$product['stock_total']);79 78 80 79 // Save new product stock values … … 99 98 } while (is_array($results) && count($results) > '280'); 100 99 101 $logging->log_file_write('StoreContrl | Synchronise stock changes completed with ' . $total_sychronized_stock_changes . ' products.'); 100 if( $total_sychronized_stock_changes > 0 ) { 101 $logging->log_file_write('StoreContrl | Synchronise stock changes completed with ' . $total_sychronized_stock_changes . ' products.'); 102 } 102 103 } 103 104 … … 1803 1804 $Variation->set_manage_stock('yes'); 1804 1805 1806 1807 $logging->log_file_write('StoreContrl | Update stock of variation: ' . $variation_post_id . ' / ' . $product_variation['sku_id']. ' with new stock total: ' .$product_variation['stock_total']); 1808 1805 1809 // Remove sale dates from variation if zero stock otherwise it gets backorder status by WC 1806 1810 if( $product_variation['stock_total'] == 0 ){ … … 1816 1820 1817 1821 $this->functions->custom_update_post_meta($variation_post_id, 'latest_update', date('Y-m-d H:i')); 1822 } 1823 else{ 1824 $logging->log_file_write('StoreContrl | Unable to find variation: ' . $product_variation['sku_id']. ' to update a new stock total: ' .$product_variation['stock_total']); 1818 1825 } 1819 1826 } -
storecontrl-wp-connection/trunk/includes/api/class-storecontrl-web-api.php
r3119018 r3350913 16 16 private $sessionid = ''; 17 17 private $functions; 18 private $debug_email = '';19 18 20 19 public function __construct() { … … 24 23 $this->storecontrl_api_url = $this->functions->getStoreContrlAPIURI(); 25 24 26 $this->storecontrl_api_url = str_replace('http://', 'https://', $this->storecontrl_api_url);27 28 // Check whether the url contains the right amount of characters29 if (strlen($this -> storecontrl_api_url) > 6) {30 // Check whether WebApi is included in the string31 if (substr($this -> storecontrl_api_url, strlen($this -> storecontrl_api_url) - 6) != "WebApi") {32 // Check whether the slash is present33 if(substr($this -> storecontrl_api_url, strlen($this -> storecontrl_api_url) - 1) != "/") {34 // Add it if it doesn't exist35 $this -> storecontrl_api_url = $this->storecontrl_api_url . "/";36 }37 38 // Add it if it doesn't exist39 $this -> storecontrl_api_url = $this -> storecontrl_api_url . "WebApi";40 }41 }42 43 if( isset($debug_email) && !empty($debug_email) ){44 $this->debug_email = $debug_email;45 }46 else{47 $this->debug_email = get_option( 'admin_email' );48 }49 50 25 $salt = mt_rand(); 51 26 $this->storecontrl_api_salt = $salt; … … 62 37 // API full request url 63 38 $api_url = $this->storecontrl_api_url.''.$request_url; 39 40 if( !str_contains($api_url, 'sc-cloud-01.nl') ){ 41 return []; 42 } 64 43 65 44 // Define headers -
storecontrl-wp-connection/trunk/includes/class-storecontrl-wp-connection-functions.php
r3226914 r3350913 4 4 public function getStoreContrlAPIURI() { 5 5 $storecontrl_api_uri = get_option('storecontrl_api_url'); 6 if (substr($storecontrl_api_uri, 0, 7) != "http://" && substr($storecontrl_api_uri, 0, 8) != "https://") { 7 $storecontrl_api_uri = "https://" . $storecontrl_api_uri; 8 } 9 if (substr($storecontrl_api_uri, strlen($storecontrl_api_uri) - 7, 7) != '/WebApi') { 10 $storecontrl_api_uri = rtrim($storecontrl_api_uri, "/") . "/WebApi"; 11 } 6 7 if( str_contains($storecontrl_api_uri, 'sc-cloud-01.nl') ) { 8 if (substr($storecontrl_api_uri, 0, 7) != "http://" && substr($storecontrl_api_uri, 0, 8) != "https://") { 9 $storecontrl_api_uri = "https://" . $storecontrl_api_uri; 10 } 11 if (substr($storecontrl_api_uri, strlen($storecontrl_api_uri) - 7, 7) != '/WebApi') { 12 $storecontrl_api_uri = rtrim($storecontrl_api_uri, "/") . "/WebApi"; 13 } 14 } 15 else{ 16 $storecontrl_api_uri = ''; 17 } 18 12 19 return $storecontrl_api_uri; 13 20 } -
storecontrl-wp-connection/trunk/includes/cronjob/class-storecontrl-cronjob-functions.php
r3331152 r3350913 389 389 $past_minute = time() - 60*6; 390 390 if( (isset($processing_batch_time) && $processing_batch_time >= $past_minute) ){ 391 $this->logging->log_file_write( 'Product cronjob | Processing batch files already running' );391 //$this->logging->log_file_write( 'Product cronjob | Processing batch files already running' ); 392 392 return; 393 393 } 394 394 395 $this->logging->log_file_write( 'Product cronjob | Processing batches' );395 //$this->logging->log_file_write( 'Product cronjob | Processing batches' ); 396 396 397 397 // Upload directory … … 888 888 889 889 file_put_contents($directory . '/MasterData.json', json_encode($storecontrl_masterdata)); 890 $this->logging->log_file_write( 'MasterData | SAVED ( Product changes )' );890 //$this->logging->log_file_write( 'MasterData | SAVED ( Product changes )' ); 891 891 892 892 $web_api->curl_request("/Data/RetrievedMasterdataChanges", "GET", $args); -
storecontrl-wp-connection/trunk/includes/woocommerce/class-storecontrl-woocommerce-functions.php
r3331152 r3350913 406 406 $fee_total = $fee_line->get_total(); 407 407 $fee_total_tax = $fee_line->get_total_tax(); 408 409 408 $fee_amount = $fee_total + $fee_total_tax; 410 409 … … 427 426 } 428 427 429 if( $fee_name == 'gateway fee' ){430 $shipping_cost += $fee_ total;428 if( $fee_name == 'gateway fee' || $fee_name == 'gatewaykosten' ){ 429 $shipping_cost += $fee_amount; 431 430 } 432 431 } -
storecontrl-wp-connection/trunk/readme.txt
r3331152 r3350913 3 3 Donate link: https://www.arture.nl/abonnementen/ 4 4 Tags: storecontrl, woocommerce, arture, kassakoppeling 5 Requires at least: 6. 0.05 Requires at least: 6.6.0 6 6 Tested up to: 6.8.2 7 Stable tag: 4.1. 78 Requires PHP: 7.47 Stable tag: 4.1.8 8 Requires PHP: 8.0 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 38 38 39 39 <strong>Wat kost het:</strong> 40 Voor slechts € 42,50 per maand ben je verzekerd van een volledige integratie tussen StoreContrl C Loud en Woocommerce. Schaf eenvoudig je licentie aan via https://www.arture.nl/abonnementen/40 Voor slechts € 42,50 per maand ben je verzekerd van een volledige integratie tussen StoreContrl Cloud en Woocommerce. Schaf eenvoudig je licentie aan via https://www.arture.nl/abonnementen/ 41 41 42 42 <strong>Wat is mogelijk:</strong> … … 92 92 93 93 == Changelog == 94 95 = 4.1.8 = 96 * Code updates and logging improvements 94 97 95 98 = 4.1.7 = -
storecontrl-wp-connection/trunk/storecontrl-wp-connection.php
r3331152 r3350913 4 4 Plugin URI: http://www.arture.nl/storecontrl 5 5 Description: The Wordpress plugin for connecting Woocommerce with StoreContrl Cloud. With the synchronizing cronjobs your products will be automatically processed, images added, and the categories set. Every 5 minutes all stock changes are processed. We provide a up-to-date plugin, easy setup and always the best support. 6 Version: 4.1. 76 Version: 4.1.8 7 7 Requires Plugins: woocommerce 8 8 Author: Arture
Note: See TracChangeset
for help on using the changeset viewer.