|
@@ 167-181 (lines=15) @@
|
| 164 |
|
* Get the allowed countries for the store. |
| 165 |
|
* @return array |
| 166 |
|
*/ |
| 167 |
|
public function get_allowed_countries() { |
| 168 |
|
if ( get_option( 'woocommerce_allowed_countries' ) !== 'specific' ) { |
| 169 |
|
return $this->countries; |
| 170 |
|
} |
| 171 |
|
|
| 172 |
|
$countries = array(); |
| 173 |
|
|
| 174 |
|
$raw_countries = get_option( 'woocommerce_specific_allowed_countries' ); |
| 175 |
|
|
| 176 |
|
foreach ( $raw_countries as $country ) { |
| 177 |
|
$countries[ $country ] = $this->countries[ $country ]; |
| 178 |
|
} |
| 179 |
|
|
| 180 |
|
return apply_filters( 'woocommerce_countries_allowed_countries', $countries ); |
| 181 |
|
} |
| 182 |
|
|
| 183 |
|
/** |
| 184 |
|
* Get the countries you ship to. |
|
@@ 211-227 (lines=17) @@
|
| 208 |
|
* get_allowed_country_states function. |
| 209 |
|
* @return array |
| 210 |
|
*/ |
| 211 |
|
public function get_allowed_country_states() { |
| 212 |
|
if ( get_option( 'woocommerce_allowed_countries' ) !== 'specific' ) { |
| 213 |
|
return $this->states; |
| 214 |
|
} |
| 215 |
|
|
| 216 |
|
$states = array(); |
| 217 |
|
|
| 218 |
|
$raw_countries = get_option( 'woocommerce_specific_allowed_countries' ); |
| 219 |
|
|
| 220 |
|
foreach ( $raw_countries as $country ) { |
| 221 |
|
if ( isset( $this->states[ $country ] ) ) { |
| 222 |
|
$states[ $country ] = $this->states[ $country ]; |
| 223 |
|
} |
| 224 |
|
} |
| 225 |
|
|
| 226 |
|
return apply_filters( 'woocommerce_countries_allowed_country_states', $states ); |
| 227 |
|
} |
| 228 |
|
|
| 229 |
|
/** |
| 230 |
|
* get_shipping_country_states function. |