$counties_array,
'rate' => $rate,
'shipping' => $shipping,
'class' => $class
);
endif;
endfor;
update_option($value['id'], $tax_rates);
elseif (isset($value['type']) && $value['type']=='multi_select_countries') :
// Get countries array
if (isset($_POST[$value['id']])) $selected_countries = $_POST[$value['id']]; else $selected_countries = array();
update_option($value['id'], $selected_countries);
/* price separators get a special treatment as they should allow a spaces (don't trim) */
elseif ( isset($value['id']) && ( $value['id'] == 'woocommerce_price_thousand_sep' || $value['id'] == 'woocommerce_price_decimal_sep' ) ):
if( isset( $_POST[ $value['id'] ] ) ) {
update_option($value['id'], $_POST[$value['id']] );
} else {
@delete_option($value['id']);
}
elseif (isset($value['type']) && $value['type']=='checkbox') :
if(isset($value['id']) && isset($_POST[$value['id']])) {
update_option($value['id'], 'yes');
} else {
update_option($value['id'], 'no');
}
elseif (isset($value['type']) && $value['type']=='image_width') :
if(isset($value['id'])) {
update_option($value['id'].'_width', (int) woocommerce_clean($_POST[$value['id'].'_width']));
update_option($value['id'].'_height', (int) woocommerce_clean($_POST[$value['id'].'_height']));
} else {
update_option($value['id'].'_width', $value['std']);
update_option($value['id'].'_height', $value['std']);
}
else :
if(isset($value['id']) && isset($_POST[$value['id']])) {
update_option($value['id'], woocommerce_clean($_POST[$value['id']]));
} else {
@delete_option($value['id']);
}
endif;
}
do_action('woocommerce_update_options');
wp_redirect( add_query_arg('saved', 'true', admin_url('admin.php?page=woocommerce') ));
}
}
/**
* Admin fields
*
* Loops though the woocommerce options array and outputs each field.
*/
function woocommerce_admin_fields($options) {
?>
'.$value['tabname'].'';
$counter++;
endif;
}
?>
';
break;
case 'title':
if (isset($value['name']) && $value['name']) echo ''.$value['name'].'
';
if (isset($value['desc']) && $value['desc']) echo wpautop(wptexturize($value['desc']));
echo '';
break;
case 'text':
?>
|
|
|
|
|
|
|
|
|
|
';
$counter++;
break;
case 'single_select_page' :
$page_setting = (int) get_option($value['id']);
$args = array( 'name' => $value['id'],
'id' => $value['id']. '" style="width: 200px;',
'sort_column' => 'menu_order',
'sort_order' => 'ASC',
'selected' => $page_setting);
if( isset($value['args']) ) $args = wp_parse_args($value['args'], $args);
?>
|
|
|
|
|
|
get_tax_classes();
$tax_rates = get_option('woocommerce_tax_rates');
?>
|
0) foreach( $tax_rates as $rate ) : $i++; ?>
|
title) ? ucwords($method->title) : ucwords($method->id);
$links[] = ''.$title.'';
endforeach;
echo '- ' . implode(' |
- ', $links) . '
';
foreach (woocommerce_shipping::$shipping_methods as $method) :
echo '
';
$method->admin_options();
echo '
';
endforeach;
echo '
';
break;
case "gateway_options" :
$links = array();
foreach (woocommerce_payment_gateways::payment_gateways() as $gateway) :
$title = ($gateway->title) ? ucwords($gateway->title) : ucwords($gateway->id);
$links[] = ''.$title.'';
endforeach;
echo '- ' . implode(' |
- ', $links) . '
';
foreach (woocommerce_payment_gateways::payment_gateways() as $gateway) :
echo '
';
$gateway->admin_options();
echo '
';
endforeach;
echo '
';
break;
endswitch;
endforeach;
?>
'.__('Your settings have been saved.', 'woothemes').'
';
?>