id = 'general'; $this->label = __( 'General', 'woocommerce' ); add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'woocommerce_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'woocommerce_settings_save_' . $this->id, array( $this, 'save' ) ); if ( ( $styles = WC_Frontend_Scripts::get_styles() ) && array_key_exists( 'woocommerce-general', $styles ) ) add_action( 'woocommerce_admin_field_frontend_styles', array( $this, 'frontend_styles_setting' ) ); } /** * Get settings array * * @return array */ public function get_settings() { $currency_code_options = get_woocommerce_currencies(); foreach ( $currency_code_options as $code => $name ) $currency_code_options[ $code ] = $name . ' (' . get_woocommerce_currency_symbol( $code ) . ')'; return apply_filters( 'woocommerce_general_settings', array( array( 'title' => __( 'General Options', 'woocommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ), array( 'title' => __( 'Base Location', 'woocommerce' ), 'desc' => __( 'This is the base location for your business. Tax rates will be based on this country.', 'woocommerce' ), 'id' => 'woocommerce_default_country', 'css' => 'min-width:350px;', 'default' => 'GB', 'type' => 'single_select_country', 'desc_tip' => true, ), array( 'title' => __( 'Selling Location(s)', 'woocommerce' ), 'desc' => __( 'This option lets you limit which countries you are willing to sell to.', 'woocommerce' ), 'id' => 'woocommerce_allowed_countries', 'default' => 'all', 'type' => 'select', 'class' => 'chosen_select', 'css' => 'min-width: 350px;', 'desc_tip' => true, 'options' => array( 'all' => __( 'Sell to all countries', 'woocommerce' ), 'specific' => __( 'Sell to specific countries only', 'woocommerce' ) ) ), array( 'title' => __( 'Specific Countries', 'woocommerce' ), 'desc' => '', 'id' => 'woocommerce_specific_allowed_countries', 'css' => 'min-width: 350px;', 'default' => '', 'type' => 'multi_select_countries' ), array( 'title' => __( 'Store Notice', 'woocommerce' ), 'desc' => __( 'Enable site-wide store notice text', 'woocommerce' ), 'id' => 'woocommerce_demo_store', 'default' => 'no', 'type' => 'checkbox' ), array( 'title' => __( 'Store Notice Text', 'woocommerce' ), 'desc' => '', 'id' => 'woocommerce_demo_store_notice', 'default' => __( 'This is a demo store for testing purposes — no orders shall be fulfilled.', 'woocommerce' ), 'type' => 'text', 'css' => 'min-width:300px;', 'autoload' => false ), array( 'title' => __( 'API', 'woocommerce' ), 'desc' => __( 'Enable the REST API', 'woocommerce' ), 'id' => 'woocommerce_api_enabled', 'type' => 'checkbox', 'default' => 'yes', ), array( 'type' => 'sectionend', 'id' => 'general_options'), array( 'title' => __( 'Currency Options', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'The following options affect how prices are displayed on the frontend.', 'woocommerce' ), 'id' => 'pricing_options' ), array( 'title' => __( 'Currency', 'woocommerce' ), 'desc' => __( "This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.", 'woocommerce' ), 'id' => 'woocommerce_currency', 'css' => 'min-width:350px;', 'default' => 'GBP', 'type' => 'select', 'class' => 'chosen_select', 'desc_tip' => true, 'options' => $currency_code_options ), array( 'title' => __( 'Currency Position', 'woocommerce' ), 'desc' => __( 'This controls the position of the currency symbol.', 'woocommerce' ), 'id' => 'woocommerce_currency_pos', 'css' => 'min-width:350px;', 'class' => 'chosen_select', 'default' => 'left', 'type' => 'select', 'options' => array( 'left' => __( 'Left', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . '99.99)', 'right' => __( 'Right', 'woocommerce' ) . ' (99.99' . get_woocommerce_currency_symbol() . ')', 'left_space' => __( 'Left with space', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ' 99.99)', 'right_space' => __( 'Right with space', 'woocommerce' ) . ' (99.99 ' . get_woocommerce_currency_symbol() . ')' ), 'desc_tip' => true, ), array( 'title' => __( 'Thousand Separator', 'woocommerce' ), 'desc' => __( 'This sets the thousand separator of displayed prices.', 'woocommerce' ), 'id' => 'woocommerce_price_thousand_sep', 'css' => 'width:50px;', 'default' => ',', 'type' => 'text', 'desc_tip' => true, ), array( 'title' => __( 'Decimal Separator', 'woocommerce' ), 'desc' => __( 'This sets the decimal separator of displayed prices.', 'woocommerce' ), 'id' => 'woocommerce_price_decimal_sep', 'css' => 'width:50px;', 'default' => '.', 'type' => 'text', 'desc_tip' => true, ), array( 'title' => __( 'Number of Decimals', 'woocommerce' ), 'desc' => __( 'This sets the number of decimal points shown in displayed prices.', 'woocommerce' ), 'id' => 'woocommerce_price_num_decimals', 'css' => 'width:50px;', 'default' => '2', 'desc_tip' => true, 'type' => 'number', 'custom_attributes' => array( 'min' => 0, 'step' => 1 ) ), array( 'type' => 'sectionend', 'id' => 'pricing_options' ), array( 'title' => __( 'Styles and Scripts', 'woocommerce' ), 'type' => 'title', 'id' => 'script_styling_options' ), array( 'type' => 'frontend_styles' ), array( 'title' => __( 'Scripts', 'woocommerce' ), 'desc' => __( 'Enable Lightbox', 'woocommerce' ), 'id' => 'woocommerce_enable_lightbox', 'default' => 'yes', 'desc_tip' => __( 'Include WooCommerce\'s lightbox. Product gallery images will open in a lightbox.', 'woocommerce' ), 'type' => 'checkbox', 'checkboxgroup' => 'start' ), array( 'desc' => __( 'Enable enhanced country select boxes', 'woocommerce' ), 'id' => 'woocommerce_enable_chosen', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'end', 'desc_tip' => __( 'This will enable a script allowing the country fields to be searchable.', 'woocommerce' ), 'autoload' => false ), array( 'type' => 'sectionend', 'id' => 'script_styling_options' ), )); // End general settings } /** * Output the frontend styles settings. * * @access public * @return void */ public function frontend_styles_setting() { ?>
woocommerce/assets/css/woocommerce-base.less
and woocommerce.css
need to be writable. See the Codex for more information.', 'woocommerce' ) . '';
}
?>