Plugin Directory

Changeset 3350913


Ignore:
Timestamp:
08/27/2025 07:32:53 AM (7 months ago)
Author:
arture
Message:

Version 4.1.8

Location:
storecontrl-wp-connection/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • storecontrl-wp-connection/trunk/includes/admin/class-storecontrl-wp-connection-admin.php

    r3331152 r3350913  
    10361036                        // Iterate Woocommerce payment methods
    10371037                        if( is_array($wc_payment_gateways) ):
     1038
     1039
    10381040                            foreach( $wc_payment_gateways as $gateway_name => $wc_payment_gateway ):
    10391041
     
    10441046                                $value = get_option( "storecontrl_wc_payment_method_".$gateway_name ); ?>
    10451047                                <tr>
    1046                                     <td><?php echo $wc_payment_gateway->title; ?></td>
     1048                                    <td><?php echo $wc_payment_gateway->get_title(); ?></td>
    10471049                                    <td>
    10481050                                        <select class="storecontrl_wc_payment_method" name="storecontrl_wc_payment_method_<?php echo $gateway_name; ?>">
     
    13541356        }
    13551357        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                }
    13701374            }
    13711375            else{
  • storecontrl-wp-connection/trunk/includes/admin/partials/storecontrl_wp_connection_settings_page.php

    r3331152 r3350913  
    2020
    2121            <?php
    22 
    23 //            $test = new StoreContrl_Woocommerce_Functions();
    24 //            $test->check_storecontrl_gift_voucher();
    25 
    2622            $storecontrl_api_arture_key = get_option('storecontrl_api_arture_key');
    2723            if( !isset($storecontrl_api_arture_key) || empty($storecontrl_api_arture_key) ): ?>
  • storecontrl-wp-connection/trunk/includes/api/class-arture-web-api.php

    r2933302 r3350913  
    3434        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    3535        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
     36        curl_setopt($curl, CURLOPT_TIMEOUT, 10);
    3637
    3738        // Get the response from the api call
  • storecontrl-wp-connection/trunk/includes/api/class-storecontrl-web-api-functions.php

    r3331152 r3350913  
    7676                    if (isset($product['sku_id'])) {
    7777                        $total_sychronized_stock_changes++;
    78                         $logging->log_file_write('StoreContrl | Update stock of SKU: ' . $product['sku_id']. ' with new stock total: ' .$product['stock_total']);
    7978
    8079                        // Save new product stock values
     
    9998        } while (is_array($results) && count($results) > '280');
    10099
    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        }
    102103    }
    103104
     
    18031804                $Variation->set_manage_stock('yes');
    18041805
     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
    18051809                // Remove sale dates from variation if zero stock otherwise it gets backorder status by WC
    18061810                if( $product_variation['stock_total'] == 0 ){
     
    18161820
    18171821                $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']);
    18181825            }
    18191826        }
  • storecontrl-wp-connection/trunk/includes/api/class-storecontrl-web-api.php

    r3119018 r3350913  
    1616    private $sessionid = '';
    1717    private $functions;
    18     private $debug_email = '';
    1918
    2019    public function __construct() {
     
    2423        $this->storecontrl_api_url = $this->functions->getStoreContrlAPIURI();
    2524
    26         $this->storecontrl_api_url = str_replace('http://', 'https://', $this->storecontrl_api_url);
    27 
    28         // Check whether the url contains the right amount of characters
    29         if (strlen($this -> storecontrl_api_url) > 6) {
    30             // Check whether WebApi is included in the string
    31             if (substr($this -> storecontrl_api_url, strlen($this -> storecontrl_api_url) - 6) != "WebApi") {
    32                 // Check whether the slash is present
    33                 if(substr($this -> storecontrl_api_url, strlen($this -> storecontrl_api_url) - 1) != "/") {
    34                     // Add it if it doesn't exist
    35                     $this -> storecontrl_api_url = $this->storecontrl_api_url . "/";
    36                 }
    37 
    38                 // Add it if it doesn't exist
    39                 $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 
    5025        $salt = mt_rand();
    5126        $this->storecontrl_api_salt = $salt;
     
    6237        // API full request url
    6338        $api_url = $this->storecontrl_api_url.''.$request_url;
     39
     40        if( !str_contains($api_url, 'sc-cloud-01.nl') ){
     41            return [];
     42        }
    6443
    6544        // Define headers
  • storecontrl-wp-connection/trunk/includes/class-storecontrl-wp-connection-functions.php

    r3226914 r3350913  
    44    public function getStoreContrlAPIURI() {
    55        $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
    1219        return $storecontrl_api_uri;
    1320    }
  • storecontrl-wp-connection/trunk/includes/cronjob/class-storecontrl-cronjob-functions.php

    r3331152 r3350913  
    389389        $past_minute = time() - 60*6;
    390390        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' );
    392392            return;
    393393        }
    394394
    395         $this->logging->log_file_write( 'Product cronjob | Processing batches' );
     395        //$this->logging->log_file_write( 'Product cronjob | Processing batches' );
    396396
    397397        // Upload directory
     
    888888
    889889                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 )' );
    891891
    892892                $web_api->curl_request("/Data/RetrievedMasterdataChanges", "GET", $args);
  • storecontrl-wp-connection/trunk/includes/woocommerce/class-storecontrl-woocommerce-functions.php

    r3331152 r3350913  
    406406                        $fee_total = $fee_line->get_total();
    407407                        $fee_total_tax = $fee_line->get_total_tax();
    408 
    409408                        $fee_amount = $fee_total + $fee_total_tax;
    410409
     
    427426                        }
    428427
    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;
    431430                        }
    432431                    }
  • storecontrl-wp-connection/trunk/readme.txt

    r3331152 r3350913  
    33Donate link: https://www.arture.nl/abonnementen/
    44Tags: storecontrl, woocommerce, arture, kassakoppeling
    5 Requires at least: 6.0.0
     5Requires at least: 6.6.0
    66Tested up to: 6.8.2
    7 Stable tag: 4.1.7
    8 Requires PHP: 7.4
     7Stable tag: 4.1.8
     8Requires PHP: 8.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3838
    3939<strong>Wat kost het:</strong>
    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/
     40Voor 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/
    4141
    4242<strong>Wat is mogelijk:</strong>
     
    9292
    9393== Changelog ==
     94
     95= 4.1.8 =
     96* Code updates and logging improvements
    9497
    9598= 4.1.7 =
  • storecontrl-wp-connection/trunk/storecontrl-wp-connection.php

    r3331152 r3350913  
    44Plugin URI:  http://www.arture.nl/storecontrl
    55Description: 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.7
     6Version:     4.1.8
    77Requires Plugins: woocommerce
    88Author:      Arture
Note: See TracChangeset for help on using the changeset viewer.