get_shipping_countries() public method

Get the countries you ship to.
public get_shipping_countries ( ) : array
return array
Exemplo n.º 1
0
         $update['shipping_address']['email'] = $current_user->user_email;
     }
     if ($woocommerce->customer->get_shipping_postcode()) {
         $update['shipping_address']['postal_code'] = $woocommerce->customer->get_shipping_postcode();
     }
 }
 if ($this->is_rest()) {
     $update['order_amount'] = (int) $klarna_order_total;
     $update['order_tax_amount'] = (int) $klarna_tax_total;
     // Only add shipping options if the option is unchecked for UK
     $checkout_settings = get_option('woocommerce_klarna_checkout_settings');
     if ('gb' == $this->klarna_country && 'yes' == $checkout_settings['uk_ship_only_to_base']) {
         $update['shipping_countries'] = array();
     } else {
         $wc_countries = new WC_Countries();
         $update['shipping_countries'] = array_keys($wc_countries->get_shipping_countries());
     }
     if ('billing_only' != get_option('woocommerce_ship_to_destination')) {
         $update['options']['allow_separate_shipping_address'] = true;
     }
     /* 
     // Add shipping options
     WC()->cart->calculate_shipping();
     $packages = WC()->shipping->get_packages();
     foreach ( $packages as $i => $package ) {
     	$chosen_method = isset( WC()->session->chosen_shipping_methods[ $i ] ) ? WC()->session->chosen_shipping_methods[ $i ] : '';
     	$available_methods = $package['rates'];
     	$show_package_details = sizeof( $packages ) > 1;
     
     	if ( ! empty( $available_methods ) ) {
     		if ( count( $available_methods ) > 1 ) {