Show countries for delivery process forms. Refactor countries.

This commit is contained in:
Almira Krdzic
2018-11-27 00:57:35 +01:00
parent 61ff7dbc60
commit 798ad20534
18 changed files with 1035 additions and 74 deletions

View File

@@ -400,7 +400,22 @@ class Wiaas_Order {
public static function get_order_tender($order_id) {
return get_post_meta($order_id, '_wiaas_tender', true);
}
}
public static function get_order_country_code($order_id) {
$order = wc_get_order($order_id);
$code = $order->get_meta('_wiaas_country_code');
if (empty($code)) {
$code = Wiaas_Countries::get_available_country_code_by_currency($order->get_currency());
$order->add_meta_data('_wiaas_country_code', $code);
$order->save_meta_data();
}
return $code;
}
/**
* PRIVATE