Jump to content

martin2020

New Members
  • Posts

    2
  • Joined

  • Last visited

martin2020's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. discovered the solution: $countries = array( 'US' => $countries['US'], 'CA' => $countries['CA'] );
  2. Hi all Got a problem that seems simple, but I fail to solve it. Anybody who can help with country array? Right now the following code is active, which limits the available country to US only, for a certain language/area selection. It works fine. I would now only like to include an additional country (CA) as a choice besides US for the same language/area selection (without changing the language/area selection). If anyone knows the trick pls help. Existing Code: if( !function_exists('filter_woocommerce_countries_shipping_countries') ) { function filter_woocommerce_countries_shipping_countries( $countries ) { // Filter countries for language if( function_exists('icl_get_languages') ) { $current_lang = defined( 'ICL_LANGUAGE_CODE' ) ? ICL_LANGUAGE_CODE : 'gl_en'; if( isset( $countries['US'] ) ) { if( $current_lang == 'en' ) { $countries = array( 'US' => $countries['US'] ); } else { unset( $countries['US'] ); } } } return $countries; } }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.