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

@@ -11,9 +11,9 @@ class Wiaas_Delivery_Process_Addon extends Gravity_Flow_Extension {
protected $_slug = 'wiaas_delivery_process';
protected $_title = 'Delivery Process';
protected $_title = 'Delivery Settings';
protected $_short_title = 'Delivery Process';
protected $_short_title = 'Delivery Settings';
public static function get_instance() {
@@ -125,7 +125,7 @@ class Wiaas_Delivery_Process_Addon extends Gravity_Flow_Extension {
$tabs[] = array(
'name' => $this->_slug,
'label' => esc_html__( 'Delivery Process', 'wiaas' ),
'label' => esc_html__( 'Delivery Settings', 'wiaas' ),
'query' => array( 'fid' => null )
);
@@ -218,14 +218,16 @@ class Wiaas_Delivery_Process_Addon extends Gravity_Flow_Extension {
return;
}
$countries = Wiaas_Countries::get_available_countries();
$countries_choices = array();
foreach ($countries as $country) {
$countries_choices[] = array( 'value' => $country['code'] , 'label' => $country['name'] );
}
$this->settings_select(array(
'name' => 'delivery_country',
'choices' => array(
array( 'value' => 'se', 'label' => 'Sweden' ),
array( 'value' => 'dk', 'label' => 'Denmark' ),
array( 'value' => 'fi', 'label' => 'Finland' )
),
'choices' => $countries_choices,
'after_select' => '<p class="description"> Choose country for which this process is defined.</p>'
));
}