'tab', 'tabname' => __('General', 'woothemes') ), array( 'name' => 'General settings', 'type' => 'title', 'desc' => '' ), array( 'name' => __('Base Country/Region', 'woothemes'), 'desc' => __('This is the base country for your business. Tax rates will be based on this country.', 'woothemes'), 'id' => 'woocommerce_default_country', 'css' => 'min-width:175px;', 'std' => 'GB', 'type' => 'single_select_country' ), array( 'name' => __('Allowed Countries', 'woothemes'), 'desc' => __('These are countries that you are willing to ship to.', 'woothemes'), 'id' => 'woocommerce_allowed_countries', 'css' => 'min-width:175px;', 'std' => 'all', 'type' => 'select', 'options' => array( 'all' => __('All Countries', 'woothemes'), 'specific' => __('Specific Countries', 'woothemes') ) ), array( 'name' => __('Specific Countries', 'woothemes'), 'desc' => '', 'id' => 'woocommerce_specific_allowed_countries', 'css' => '', 'std' => '', 'type' => 'multi_select_countries' ), array( 'name' => __('Guest checkout', 'woothemes'), 'desc' => __('Allow guest users to checkout without an account', 'woothemes'), 'id' => 'woocommerce_enable_guest_checkout', 'std' => 'yes', 'type' => 'checkbox' ), array( 'name' => __('Force SSL', 'woothemes'), 'desc' => __('Force SSL on the checkout for added security (SSL Certificate required).', 'woothemes'), 'id' => 'woocommerce_force_ssl_checkout', 'std' => 'no', 'type' => 'checkbox' ), array( 'name' => __('ShareThis Publisher ID', 'woothemes'), 'desc' => __("Enter your ShareThis publisher ID to show ShareThis on product pages.", 'woothemes'), 'id' => 'woocommerce_sharethis', 'css' => 'width:300px;', 'type' => 'text', 'std' => '' ), array( 'name' => __('WooCommerce CSS', 'woothemes'), 'desc' => __('Enable WooCommerce frontend CSS styles', 'woothemes'), 'id' => 'woocommerce_frontend_css', 'std' => 'yes', 'type' => 'checkbox' ), array( 'name' => __('Demo store', 'woothemes'), 'desc' => __('Enable the "Demo Store" notice on your site', 'woothemes'), 'id' => 'woocommerce_demo_store', 'std' => 'no', 'type' => 'checkbox' ), array( 'type' => 'sectionend'), array( 'type' => 'tabend'), array( 'type' => 'tab', 'tabname' => __('Pages', 'woothemes') ), array( 'name' => 'Page setup', 'type' => 'title', 'desc' => '' ), array( 'name' => __('Shop Base Page', 'woothemes'), 'desc' => sprintf( __("This sets the base page of your shop. IMPORTANT: You must re-save your permalinks for this change to take effect.", 'woothemes'), 'options-permalink.php' ), 'id' => 'woocommerce_shop_page_id', 'css' => 'min-width:175px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __('Prepend base page', 'woothemes'), 'desc' => __('Prepend shop categories/tags with shop base page', 'woothemes'), 'id' => 'woocommerce_prepend_shop_page_to_urls', 'std' => 'no', 'type' => 'checkbox', ), array( 'name' => __('Terms page ID', 'woothemes'), 'desc' => __('If you define a "Terms" page the customer will be asked if they accept them when checking out.', 'woothemes'), 'tip' => '', 'id' => 'woocommerce_terms_page_id', 'css' => 'min-width:50px;', 'std' => '', 'type' => 'single_select_page', 'args' => 'show_option_none=' . __('None', 'woothemes'), ), array( 'type' => 'sectionend'), array( 'name' => 'Shop pages', 'type' => 'title', 'desc' => 'The following pages need selecting so that WooCommerce knows which are which. These pages should have been created upon installation of the plugin.' ), array( 'name' => __('Cart Page', 'woothemes'), 'desc' => __('Page contents: [woocommerce_cart]', 'woothemes'), 'id' => 'woocommerce_cart_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __('Checkout Page', 'woothemes'), 'desc' => __('Page contents: [woocommerce_checkout]', 'woothemes'), 'id' => 'woocommerce_checkout_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __('Pay Page', 'woothemes'), 'desc' => __('Page contents: [woocommerce_pay] Parent: "Checkout"', 'woothemes'), 'id' => 'woocommerce_pay_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __('Thanks Page', 'woothemes'), 'desc' => __('Page contents: [woocommerce_thankyou] Parent: "Checkout"', 'woothemes'), 'id' => 'woocommerce_thanks_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __('My Account Page', 'woothemes'), 'desc' => __('Page contents: [woocommerce_my_account]', 'woothemes'), 'id' => 'woocommerce_myaccount_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __('Edit Address Page', 'woothemes'), 'desc' => __('Page contents: [woocommerce_edit_address] Parent: "My Account"', 'woothemes'), 'id' => 'woocommerce_edit_address_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __('View Order Page', 'woothemes'), 'desc' => __('Page contents: [woocommerce_view_order] Parent: "My Account"', 'woothemes'), 'id' => 'woocommerce_view_order_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __('Change Password Page', 'woothemes'), 'desc' => __('Page contents: [woocommerce_change_password] Parent: "My Account"', 'woothemes'), 'id' => 'woocommerce_change_password_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'type' => 'sectionend'), array( 'type' => 'tabend'), array( 'type' => 'tab', 'tabname' => __('Catalog', 'woothemes') ), array( 'name' => __('Catalog Settings', 'woothemes'), 'type' => 'title','desc' => '', 'id' => '' ), array( 'name' => __('Product fields', 'woothemes'), 'desc' => __('Enable the SKU field for products', 'woothemes'), 'id' => 'woocommerce_enable_sku', 'std' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start' ), array( 'desc' => __('Enable the weight field for products', 'woothemes'), 'id' => 'woocommerce_enable_weight', 'std' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'end' ), array( 'name' => __('Weight Unit', 'woothemes'), 'desc' => __("This controls what unit you will define weights in.", 'woothemes'), 'id' => 'woocommerce_weight_unit', 'css' => 'min-width:175px;', 'std' => 'GBP', 'type' => 'select', 'options' => array( 'kg' => __('kg', 'woothemes'), 'lbs' => __('lbs', 'woothemes') ) ), array( 'type' => 'sectionend'), array( 'name' => __('Pricing Settings', 'woothemes'), 'type' => 'title','desc' => '', 'id' => '' ), array( 'name' => __('Currency', 'woothemes'), 'desc' => sprintf( __("This controls what currency prices are listed at in the catalog, and which currency PayPal, and other gateways, will take payments in. See the list of supported PayPal currencies.", 'woothemes'), 'https://www.paypal.com/cgi-bin/webscr?cmd=p/sell/mc/mc_intro-outside' ), 'tip' => '', 'id' => 'woocommerce_currency', 'css' => 'min-width:175px;', 'std' => 'GBP', 'type' => 'select', 'options' => apply_filters('woocommerce_currencies', array( 'USD' => __('US Dollars ($)', 'woothemes'), 'EUR' => __('Euros (€)', 'woothemes'), 'GBP' => __('Pounds Sterling (£)', 'woothemes'), 'AUD' => __('Australian Dollars ($)', 'woothemes'), 'BRL' => __('Brazilian Real ($)', 'woothemes'), 'CAD' => __('Canadian Dollars ($)', 'woothemes'), 'CZK' => __('Czech Koruna', 'woothemes'), 'DKK' => __('Danish Krone', 'woothemes'), 'HKD' => __('Hong Kong Dollar ($)', 'woothemes'), 'HUF' => __('Hungarian Forint', 'woothemes'), 'ILS' => __('Israeli Shekel', 'woothemes'), 'JPY' => __('Japanese Yen (¥)', 'woothemes'), 'MYR' => __('Malaysian Ringgits', 'woothemes'), 'MXN' => __('Mexican Peso ($)', 'woothemes'), 'NZD' => __('New Zealand Dollar ($)', 'woothemes'), 'NOK' => __('Norwegian Krone', 'woothemes'), 'PHP' => __('Philippine Pesos', 'woothemes'), 'PLN' => __('Polish Zloty', 'woothemes'), 'SGD' => __('Singapore Dollar ($)', 'woothemes'), 'SEK' => __('Swedish Krona', 'woothemes'), 'CHF' => __('Swiss Franc', 'woothemes'), 'TWD' => __('Taiwan New Dollars', 'woothemes'), 'THB' => __('Thai Baht', 'woothemes') ) ) ), array( 'name' => __('Currency Position', 'woothemes'), 'desc' => __("This controls the position of the currency symbol.", 'woothemes'), 'tip' => '', 'id' => 'woocommerce_currency_pos', 'css' => 'min-width:175px;', 'std' => 'left', 'type' => 'select', 'options' => array( 'left' => __('Left', 'woothemes'), 'right' => __('Right', 'woothemes'), 'left_space' => __('Left (with space)', 'woothemes'), 'right_space' => __('Right (with space)', 'woothemes') ) ), array( 'name' => __('Thousand separator', 'woothemes'), 'desc' => __('This sets the thousand separator of displayed prices.', 'woothemes'), 'tip' => '', 'id' => 'woocommerce_price_thousand_sep', 'css' => 'width:30px;', 'std' => ',', 'type' => 'text', ), array( 'name' => __('Decimal separator', 'woothemes'), 'desc' => __('This sets the decimal separator of displayed prices.', 'woothemes'), 'tip' => '', 'id' => 'woocommerce_price_decimal_sep', 'css' => 'width:30px;', 'std' => '.', 'type' => 'text', ), array( 'name' => __('Number of decimals', 'woothemes'), 'desc' => __('This sets the number of decimal points shown in displayed prices.', 'woothemes'), 'tip' => '', 'id' => 'woocommerce_price_num_decimals', 'css' => 'width:30px;', 'std' => '2', 'type' => 'text', ), array( 'type' => 'sectionend'), array( 'name' => __('Inventory Settings', 'woothemes'), 'type' => 'title','desc' => '', 'id' => '' ), array( 'name' => __('Manage stock', 'woothemes'), 'desc' => __('Enable stock management', 'woothemes'), 'id' => 'woocommerce_manage_stock', 'std' => 'yes', 'type' => 'checkbox' ), array( 'name' => __('Notifications', 'woothemes'), 'desc' => __('Enable low stock notifications', 'woothemes'), 'id' => 'woocommerce_notify_low_stock', 'std' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start' ), array( 'desc' => __('Enable out of stock notifications', 'woothemes'), 'id' => 'woocommerce_notify_no_stock', 'std' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'end' ), array( 'name' => __('Low stock threshold', 'woothemes'), 'desc' => '', 'tip' => '', 'id' => 'woocommerce_notify_low_stock_amount', 'css' => 'min-width:50px;', 'type' => 'text', 'std' => '2' ), array( 'name' => __('Out of stock threshold', 'woothemes'), 'desc' => '', 'tip' => '', 'id' => 'woocommerce_notify_no_stock_amount', 'css' => 'min-width:50px;', 'type' => 'text', 'std' => '0' ), array( 'type' => 'sectionend'), array( 'type' => 'tabend'), array( 'type' => 'tab', 'tabname' => __('Shipping', 'woothemes') ), array( 'name' => __('Shipping Options', 'woothemes'), 'type' => 'title','desc' => '', 'id' => '' ), array( 'name' => __('Calculate shipping', 'woothemes'), 'desc' => __('Enable shipping/shipping calculations', 'woothemes'), 'id' => 'woocommerce_calc_shipping', 'std' => 'yes', 'type' => 'checkbox' ), array( 'name' => __('Shipping calculator', 'woothemes'), 'desc' => __('Enable the shipping calculator on the cart page', 'woothemes'), 'id' => 'woocommerce_enable_shipping_calc', 'std' => 'yes', 'type' => 'checkbox' ), array( 'name' => __('Ship to billing', 'woothemes'), 'desc' => __('Only ship to the users billing address', 'woothemes'), 'id' => 'woocommerce_ship_to_billing_address_only', 'std' => 'no', 'type' => 'checkbox' ), array( 'type' => 'sectionend'), array( 'type' => 'shipping_options'), array( 'type' => 'tabend'), array( 'type' => 'tab', 'tabname' => __('Tax', 'woothemes') ), array( 'name' => __('Tax Options', 'woothemes'), 'type' => 'title','desc' => '', 'id' => '' ), array( 'name' => __('Calculate Taxes', 'woothemes'), 'desc' => __('Enable taxes and tax calculations', 'woothemes'), 'id' => 'woocommerce_calc_taxes', 'std' => 'yes', 'type' => 'checkbox' ), array( 'name' => __('Prices inclusive of tax', 'woothemes'), 'desc' => __('Catalog Prices include tax', 'woothemes'), 'id' => 'woocommerce_prices_include_tax', 'std' => 'yes', 'type' => 'checkbox' ), array( 'name' => __('Cart totals display...', 'woothemes'), 'desc' => '', 'tip' => __('Should the subtotal be shown including or excluding tax on the frontend?', 'woothemes'), 'id' => 'woocommerce_display_totals_tax', 'css' => 'min-width:100px;', 'std' => 'excluding', 'type' => 'select', 'options' => array( 'including' => __('price including tax', 'woothemes'), 'excluding' => __('price excluding tax', 'woothemes') ) ), array( 'name' => __('Additional Tax classes', 'woothemes'), 'desc' => __('List 1 per line. This is in addition to the default Standard Rate.', 'woothemes'), 'tip' => __('List product and shipping tax classes here, e.g. Zero Tax, Reduced Rate.', 'woothemes'), 'id' => 'woocommerce_tax_classes', 'css' => 'width:100%; height: 75px;', 'type' => 'textarea', 'std' => "Reduced Rate\nZero Rate" ), array( 'name' => __('Tax rates', 'woothemes'), 'desc' => 'All fields are required.', 'tip' => 'To avoid rounding errors, insert tax rates with 4 decimal places.', 'id' => 'woocommerce_tax_rates', 'css' => 'min-width:50px;', 'type' => 'tax_rates', 'std' => '' ), array( 'type' => 'sectionend'), array( 'type' => 'tabend'), array( 'type' => 'tab', 'tabname' => __('Payment Gateways', 'woothemes') ), array( 'type' => 'gateway_options'), array( 'type' => 'tabend') ) ); /** * Update options * * Updates the options on the woocommerce settings page. */ function woocommerce_update_options($options) { if(isset($_POST['submitted']) && $_POST['submitted'] == 'yes') { foreach ($options as $value) { if (isset($value['id']) && $value['id']=='woocommerce_tax_rates') : $tax_classes = array(); $tax_countries = array(); $tax_rate = array(); $tax_rates = array(); $tax_shipping = array(); if (isset($_POST['tax_class'])) $tax_classes = $_POST['tax_class']; if (isset($_POST['tax_country'])) $tax_countries = $_POST['tax_country']; if (isset($_POST['tax_rate'])) $tax_rate = $_POST['tax_rate']; if (isset($_POST['tax_shipping'])) $tax_shipping = $_POST['tax_shipping']; for ($i=0; $i $country, 'state' => $state, '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'); } 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'); echo ''.__('Your settings have been saved.', 'woothemes').''; } } /** * 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 ''. "\n\n"; break; case 'sectionend': echo ''; break; case 'text': ?> $val) { ?> selected="selected" > /> name="" id="" style=""> '; $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); ?> $val) : echo ''. $val .''; endforeach; ?> get_tax_classes(); $tax_rates = get_option('woocommerce_tax_rates'); ?> 0) foreach( $tax_rates as $rate ) : $i++; echo ''.__('Standard Rate', 'woothemes').''; if ($tax_classes) foreach ($tax_classes as $class) : echo ''.$class.''; endforeach; echo ''; woocommerce_countries::country_dropdown_options($rate['country'], $rate['state']); echo '% '.__('Apply to shipping', 'woothemes').'×'; endforeach; ?> admin_options(); endforeach; break; case "gateway_options" : foreach (woocommerce_payment_gateways::payment_gateways() as $gateway) : $gateway->admin_options(); endforeach; break; endswitch; endforeach; ?>
'.__('Your settings have been saved.', 'woothemes').'
'.__('Standard Rate', 'woothemes').''; if ($tax_classes) foreach ($tax_classes as $class) : echo ''.$class.''; endforeach; echo ''; woocommerce_countries::country_dropdown_options($rate['country'], $rate['state']); echo '% '.__('Apply to shipping', 'woothemes').'×