$country, 'state' => $state, 'rate' => $rate, 'shipping' => $shipping, 'class' => $class ); endif; endfor; update_option($value['id'], $tax_rates); elseif (isset($value['id']) && $value['id']=='jigoshop_coupons') : $coupon_code = array(); $coupon_type = array(); $coupon_amount = array(); $product_ids = array(); $coupons = array(); $individual = array(); if (isset($_POST['coupon_code'])) $coupon_code = $_POST['coupon_code']; if (isset($_POST['coupon_type'])) $coupon_type = $_POST['coupon_type']; if (isset($_POST['coupon_amount'])) $coupon_amount = $_POST['coupon_amount']; if (isset($_POST['product_ids'])) $product_ids = $_POST['product_ids']; if (isset($_POST['individual'])) $individual = $_POST['individual']; for ($i=0; $i $code, 'amount' => $amount, 'type' => $type, 'products' => $products, 'individual_use' => $individual_use ); endif; endif; endfor; update_option($value['id'], $coupons); 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); else : if(isset($value['id']) && isset($_POST[$value['id']])) { update_option($value['id'], jigowatt_clean($_POST[$value['id']])); } else { @delete_option($value['id']); } endif; } do_action('jigoshop_update_options'); echo '

'.__('Your settings have been saved.','jigoshop').'

'; } } /** * Admin fields * * Loops though the jigoshop options array and outputs each field. * * @since 1.0 * @usedby jigoshop_settings() * * @param array $options List of options to go through and save */ function jigoshop_admin_fields($options) { ?>

'; foreach ($options as $value) { if (in_array('tab', $value)) : echo '
  • '.$value['tabname'].'
  • '. "\n"; $counter = $counter + 1; endif; } echo ''; $counter = 1; foreach ($options as $value) : switch($value['type']) : case 'tab': echo '
    '; echo ''. "\n\n"; break; case 'title': ?>'; $counter = $counter + 1; break; case 'single_select_country' : $countries = jigoshop_countries::$countries; $country_setting = (string) get_option($value['id']); if (strstr($country_setting, ':')) : $country = current(explode(':', $country_setting)); $state = end(explode(':', $country_setting)); else : $country = $country_setting; $state = '*'; endif; ?>get_coupons(); ?>get_tax_classes(); $tax_rates = get_option('jigoshop_tax_rates'); ?>admin_options(); endforeach; break; case "gateway_options" : foreach (jigoshop_payment_gateways::payment_gateways() as $gateway) : $gateway->admin_options(); endforeach; break; endswitch; endforeach; ?>


     
    :
    :
    :
    :
    :
      $val) : echo '
    • '; endforeach; ?>
    : 0) foreach( $coupon_codes as $coupon ) : $i++; echo ''; endforeach; ?>
    ×

    :
    0) foreach( $tax_rates as $rate ) : $i++; echo '

    % ×

    '; endforeach; ?>