Plugin Directory

Changeset 3436729


Ignore:
Timestamp:
01/10/2026 04:41:35 PM (3 months ago)
Author:
passatgt
Message:

v4.0.2

Location:
hungarian-pickup-points-for-woocommerce/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • hungarian-pickup-points-for-woocommerce/trunk/assets/js/admin.js

    r3435268 r3436729  
    639639            var providers = vp_woo_pont_params.providers;
    640640            providers['postapont'] = 'Postapont';
     641            console.log(providers);
    641642            var billing_country = $('#_billing_country').val();
    642643
    643             var calls = vp_woo_pont_params.files.map(function(file) {
    644                 console.log(file);
    645 
    646                 //Skip for country in case of Kvikk
    647                 if(file.type.includes('kvikk_') && file.country != billing_country) {
    648                     return;
    649                 }
    650 
    651                 return $.getJSON( file.url, function( data ) {
    652                     vp_woo_pont_settings.json_data_points.push({provider: file.type, title: providers[file.type], data: data});
     644            var calls = [];
     645           
     646            Object.keys(vp_woo_pont_params.files).forEach(function(json) {
     647               
     648                //Check for country specific files
     649                vp_woo_pont_params.files[json].forEach(function(file){
     650
     651                    //Skip if the country doesn't match
     652                    if(billing_country != file.country) {
     653                        return; //skip this file
     654                    }
     655
     656                    calls.push($.getJSON(vp_woo_pont_params.db_url+file.file, function (data) {
     657                        vp_woo_pont_settings.json_data_points.push({provider: json, title: providers[json], data: data});
     658                        console.log('loaded json for '+json);
     659                    }));
     660
    653661                });
     662
    654663            });
    655664
     
    28982907        load_replacement_points: function(provider_id) {
    28992908            vp_woo_pont_settings.json_data_points.forEach(function(data_points){
     2909                console.log('load_replacement_points', provider_id, data_points);
    29002910                if(data_points.provider == provider_id && !$('.vp-woo-pont-modal-replace-results li#'+provider_id).length) {
    29012911                    var providerLi = $('<li>').attr('id', data_points.provider);
     
    30873097                vp_woo_pont_settings.load_json_files(function(){
    30883098
     3099                    console.log('JSON files loaded');
     3100
    30893101                    //Load selected values
    30903102                    $selected.trigger('change');
  • hungarian-pickup-points-for-woocommerce/trunk/assets/js/admin.min.js

    r3435268 r3436729  
    640640            var providers = vp_woo_pont_params.providers;
    641641            providers['postapont'] = 'Postapont';
     642            console.log(providers);
    642643            var billing_country = $('#_billing_country').val();
    643644
    644             var calls = vp_woo_pont_params.files.map(function(file) {
    645                 console.log(file);
    646 
    647                 //Skip for country in case of Kvikk
    648                 if(file.type.includes('kvikk_') && file.country != billing_country) {
    649                     return;
    650                 }
    651 
    652                 return $.getJSON( file.url, function( data ) {
    653                     vp_woo_pont_settings.json_data_points.push({provider: file.type, title: providers[file.type], data: data});
     645            var calls = [];
     646           
     647            Object.keys(vp_woo_pont_params.files).forEach(function(json) {
     648               
     649                //Check for country specific files
     650                vp_woo_pont_params.files[json].forEach(function(file){
     651
     652                    //Skip if the country doesn't match
     653                    if(billing_country != file.country) {
     654                        return; //skip this file
     655                    }
     656
     657                    calls.push($.getJSON(vp_woo_pont_params.db_url+file.file, function (data) {
     658                        vp_woo_pont_settings.json_data_points.push({provider: json, title: providers[json], data: data});
     659                        console.log('loaded json for '+json);
     660                    }));
     661
    654662                });
     663
    655664            });
    656665
     
    28992908        load_replacement_points: function(provider_id) {
    29002909            vp_woo_pont_settings.json_data_points.forEach(function(data_points){
     2910                console.log('load_replacement_points', provider_id, data_points);
    29012911                if(data_points.provider == provider_id && !$('.vp-woo-pont-modal-replace-results li#'+provider_id).length) {
    29022912                    var providerLi = $('<li>').attr('id', data_points.provider);
     
    30873097            if(vp_woo_pont_settings.json_data_points.length === 0) {
    30883098                vp_woo_pont_settings.load_json_files(function(){
     3099
     3100                    console.log('JSON files loaded');
    30893101
    30903102                    //Load selected values
  • hungarian-pickup-points-for-woocommerce/trunk/assets/js/frontend.js

    r3435268 r3436729  
    280280            vp_woo_pont_frontend.notes = notes;
    281281
     282            //Set default country
     283            var current_billing_country = vp_woo_pont_frontend_params.default_country || 'HU';
     284
    282285            //Set the billing country
    283             var current_billing_country = $('#billing_country').val() || 'HU';
     286            if($('#billing_country').length && $('#billing_country').val()) {
     287                current_billing_country = $('#billing_country').val();
     288            }
    284289
    285290            //If we don't have a billing country, try shipping country
    286             if(!$('#billing_country').length) {
    287                 current_billing_country = $('#shipping_country').val() || 'HU';
     291            if($('#shipping_country').length && $('#shipping_country').val()) {
     292                current_billing_country = $('#shipping_country').val();
    288293            }
    289294
    290295            //If still nothing, check in case its a block based checkout
    291             if(!$('#billing_country').length) {
    292                 current_billing_country = $('#billing-country').val() || 'HU';
     296            if($('#billing-country').length && $('#billing-country').val()) {
     297                current_billing_country = $('#billing-country').val();
    293298            }
    294299
  • hungarian-pickup-points-for-woocommerce/trunk/assets/js/frontend.min.js

    r3435268 r3436729  
    281281            vp_woo_pont_frontend.notes = notes;
    282282
     283            //Set default country
     284            var current_billing_country = vp_woo_pont_frontend_params.default_country || 'HU';
     285
    283286            //Set the billing country
    284             var current_billing_country = $('#billing_country').val() || 'HU';
     287            if($('#billing_country').length && $('#billing_country').val()) {
     288                current_billing_country = $('#billing_country').val();
     289            }
    285290
    286291            //If we don't have a billing country, try shipping country
    287             if(!$('#billing_country').length) {
    288                 current_billing_country = $('#shipping_country').val() || 'HU';
     292            if($('#shipping_country').length && $('#shipping_country').val()) {
     293                current_billing_country = $('#shipping_country').val();
    289294            }
    290295
    291296            //If still nothing, check in case its a block based checkout
    292             if(!$('#billing_country').length) {
    293                 current_billing_country = $('#billing-country').val() || 'HU';
     297            if($('#billing-country').length && $('#billing-country').val()) {
     298                current_billing_country = $('#billing-country').val();
    294299            }
    295300
  • hungarian-pickup-points-for-woocommerce/trunk/index.php

    r3435761 r3436729  
    88Text Domain: vp-woo-pont
    99Domain Path: /languages/
    10 Version: 4.0.1
     10Version: 4.0.2
    1111WC requires at least: 7.0
    1212WC tested up to: 10.4.3
     
    6969        self::$plugin_basename = plugin_basename(__FILE__);
    7070        self::$plugin_path = trailingslashit(dirname(__FILE__));
    71         self::$version = '4.0.1';
     71        self::$version = '4.0.2';
    7272        self::$plugin_url = plugin_dir_url(self::$plugin_basename);
    7373
     
    328328        $woocommerce_version = defined( 'WC_VERSION' ) ? WC_VERSION : '0.0.0';
    329329        $dependencies = version_compare( $woocommerce_version, '10.3.0', '>=' ) ? array('jquery', 'wc-backbone-modal', 'wc-jquery-blockui', 'jquery-ui-sortable', 'wc-jquery-tiptip') : array('jquery', 'wc-backbone-modal', 'jquery-blockui', 'jquery-ui-sortable', 'jquery-tiptip');
     330        $download_folders = VP_Woo_Pont_Helpers::get_download_folder();
    330331
    331332        if(
     
    354355                'settings' => current_user_can( 'manage_woocommerce' ) ? wp_create_nonce( 'vp-woo-pont-settings' ) : null,
    355356                'tracking' => current_user_can( 'manage_woocommerce' ) ? wp_create_nonce( 'vp-woo-pont-tracking' ) : null,
    356             )
     357            ),
     358            'db_url' => $download_folders['url']
    357359        );
    358360
     
    399401                'features' => VP_Woo_Pont_Helpers::get_enabled_features(),
    400402                'kvikk_map_api_key' => VP_Woo_Pont_Helpers::get_option('kvikk_map_api_key', ''),
     403                'default_country' => WC()->customer && WC()->customer->get_billing_country() ? WC()->customer->get_billing_country() : WC()->countries->get_base_country(),
    401404            );
    402405
  • hungarian-pickup-points-for-woocommerce/trunk/readme.txt

    r3435761 r3436729  
    44Requires at least: 6.0
    55Tested up to: 6.9
    6 Stable tag: 4.0.1
     6Stable tag: 4.0.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5656
    5757== Changelog ==
     58
     594.0.2
     60* Kosárban csomagpont választó javítás, ha csak külföldi pontok vannak használva
     61* Kiválasztott pont cseréje javítás adminban
     62* Sameday pont import javítás
    5863
    59644.0.1
Note: See TracChangeset for help on using the changeset viewer.