как изменить параметры почтового индекса и импортировать почтовые индексы из файла json в woocommerce?

#wordpress #woocommerce

Вопрос:

вот functions.php:

 <?php
/**
 * Astra-child Theme functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package Astra-child
 * @since 1.0.0
 */

/**
 * Define Constants
 */
define( 'CHILD_THEME_ASTRA_CHILD_VERSION', '1.0.0' );

/**
 * Enqueue styles
 */
function child_enqueue_styles() {

    wp_enqueue_style( 'astra-child-theme-css', get_stylesheet_directory_uri() . '/style.css', array('astra-theme-css'), CHILD_THEME_ASTRA_CHILD_VERSION, 'all' );

}

add_action( 'wp_enqueue_scripts', 'child_enqueue_styles', 15 );

/**
* Adding custom json file locations from child theme
* WC Provincia-Canton-Distrito */

function kmchild_prov_cant_dist_json( $json_file ) {
    $json_file = get_stylesheet_directory_uri() . '/prov-cant-dist.json';
    
    return $json_file;
    }
    add_filter('wcpcd_prov_cant_dist_json', 'kmchild_prov_cant_dist_json');
    
    function kmchild_wc_states($states) {
    $states['MY'] = array(
    'JHR' => 'Johor',
    'KDH' => 'Kedah',
    'KTN' => 'Kelantan',
    );
    
    return $states;
}
 

Комментарии:

1. вот мой файл json: