2011-08-10 17:11:11 +00:00
< ? php
/**
* Functions for the settings page in admin .
*
* The settings page contains options for the WooCommerce plugin - this file contains functions to display
* and save the list of options .
*
* @ author WooThemes
* @ category Admin
* @ package WooCommerce
*/
/**
2011-09-15 16:37:38 +00:00
* Define settings for the WooCommerce settings pages
2011-08-10 17:11:11 +00:00
*/
2011-09-09 14:23:32 +00:00
global $woocommerce_settings ;
2011-08-10 17:11:11 +00:00
2012-04-24 18:15:56 +00:00
$localisation_setting = ( defined ( 'WPLANG' ) ) ? array (
'name' => __ ( 'Localisation' , 'woocommerce' ),
'desc' => __ ( 'Use informal localisation file if it exists' , 'woocommerce' ),
'id' => 'woocommerce_informal_localisation_type' ,
'type' => 'checkbox' ,
'std' => 'no' ,
) : array ();
2011-09-15 16:37:38 +00:00
$woocommerce_settings [ 'general' ] = apply_filters ( 'woocommerce_general_settings' , array (
2011-08-10 17:11:11 +00:00
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'General Options' , 'woocommerce' ), 'type' => 'title' , 'desc' => '' , 'id' => 'general_options' ),
2011-08-10 17:11:11 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Base Country/Region' , 'woocommerce' ),
'desc' => __ ( 'This is the base country for your business. Tax rates will be based on this country.' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_default_country' ,
2011-11-23 10:08:48 +00:00
'css' => 'min-width:300px;' ,
2011-08-10 17:11:11 +00:00
'std' => 'GB' ,
2012-02-24 20:04:05 +00:00
'type' => 'single_select_country' ,
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
2011-11-04 18:15:32 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Currency' , 'woocommerce' ),
'desc' => __ ( " This controls what currency prices are listed at in the catalog and which currency gateways will take payments in. " , 'woocommerce' ),
2011-11-04 18:15:32 +00:00
'id' => 'woocommerce_currency' ,
2011-11-23 10:08:48 +00:00
'css' => 'min-width:300px;' ,
2011-11-04 18:15:32 +00:00
'std' => 'GBP' ,
'type' => 'select' ,
2011-11-23 00:44:11 +00:00
'class' => 'chosen_select' ,
2012-02-24 20:04:05 +00:00
'desc_tip' => true ,
2011-11-24 15:22:28 +00:00
'options' => array_unique ( apply_filters ( 'woocommerce_currencies' , array (
2012-01-05 11:31:22 +00:00
'USD' => __ ( 'US Dollars ($)' , 'woocommerce' ),
'EUR' => __ ( 'Euros (€)' , 'woocommerce' ),
'GBP' => __ ( 'Pounds Sterling (£)' , 'woocommerce' ),
'AUD' => __ ( 'Australian Dollars ($)' , 'woocommerce' ),
'BRL' => __ ( 'Brazilian Real ($)' , 'woocommerce' ),
'CAD' => __ ( 'Canadian Dollars ($)' , 'woocommerce' ),
'CZK' => __ ( 'Czech Koruna (Kč)' , 'woocommerce' ),
'DKK' => __ ( 'Danish Krone' , 'woocommerce' ),
'HKD' => __ ( 'Hong Kong Dollar ($)' , 'woocommerce' ),
'HUF' => __ ( 'Hungarian Forint' , 'woocommerce' ),
'ILS' => __ ( 'Israeli Shekel' , 'woocommerce' ),
2012-03-05 15:11:49 +00:00
'RMB' => __ ( 'Chinese Yuan (¥)' , 'woocommerce' ),
2012-01-05 11:31:22 +00:00
'JPY' => __ ( 'Japanese Yen (¥)' , 'woocommerce' ),
2012-04-17 09:26:11 +00:00
'MYR' => __ ( 'Malaysian Ringgits (RM)' , 'woocommerce' ),
2012-01-05 11:31:22 +00:00
'MXN' => __ ( 'Mexican Peso ($)' , 'woocommerce' ),
'NZD' => __ ( 'New Zealand Dollar ($)' , 'woocommerce' ),
'NOK' => __ ( 'Norwegian Krone' , 'woocommerce' ),
'PHP' => __ ( 'Philippine Pesos' , 'woocommerce' ),
'PLN' => __ ( 'Polish Zloty' , 'woocommerce' ),
'SGD' => __ ( 'Singapore Dollar ($)' , 'woocommerce' ),
'SEK' => __ ( 'Swedish Krona' , 'woocommerce' ),
'CHF' => __ ( 'Swiss Franc' , 'woocommerce' ),
'TWD' => __ ( 'Taiwan New Dollars' , 'woocommerce' ),
'THB' => __ ( 'Thai Baht' , 'woocommerce' ),
'TRY' => __ ( 'Turkish Lira (TL)' , 'woocommerce' ),
'ZAR' => __ ( 'South African rand (R)' , 'woocommerce' ),
2011-11-24 15:22:28 +00:00
))
2011-11-04 18:15:32 +00:00
)
),
2011-08-10 17:11:11 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Allowed Countries' , 'woocommerce' ),
'desc' => __ ( 'These are countries that you are willing to ship to.' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_allowed_countries' ,
'std' => 'all' ,
'type' => 'select' ,
2011-11-23 10:08:48 +00:00
'class' => 'chosen_select' ,
2011-11-23 12:02:36 +00:00
'css' => 'min-width:300px;' ,
2012-02-24 20:04:05 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
'options' => array (
2012-01-05 11:31:22 +00:00
'all' => __ ( 'All Countries' , 'woocommerce' ),
'specific' => __ ( 'Specific Countries' , 'woocommerce' )
2011-08-10 17:11:11 +00:00
)
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Specific Countries' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'desc' => '' ,
'id' => 'woocommerce_specific_allowed_countries' ,
'css' => '' ,
'std' => '' ,
'type' => 'multi_select_countries'
),
2012-04-24 18:15:56 +00:00
$localisation_setting ,
2011-11-28 16:20:39 +00:00
2012-02-24 20:04:05 +00:00
array ( 'type' => 'sectionend' , 'id' => 'general_options' ),
array ( 'name' => __ ( 'Checkout and Accounts' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'The following options control the behaviour of the checkout process and customer accounts.' , 'woocommerce' ), 'id' => 'checkout_account_options' ),
2011-12-21 21:12:34 +00:00
2012-04-24 18:36:52 +00:00
array (
'name' => __ ( 'Checkout' , 'woocommerce' ),
'desc' => __ ( 'Enable guest checkout (no account required)' , 'woocommerce' ),
'id' => 'woocommerce_enable_guest_checkout' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
),
array (
'desc' => __ ( 'Show order comments section' , 'woocommerce' ),
'id' => 'woocommerce_enable_order_comments' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'end'
),
2011-08-10 17:11:11 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Security' , 'woocommerce' ),
2012-04-24 18:36:52 +00:00
'desc' => __ ( 'Force secure checkout' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_force_ssl_checkout' ,
'std' => 'no' ,
2011-11-04 17:48:04 +00:00
'type' => 'checkbox' ,
2011-12-21 21:12:34 +00:00
'checkboxgroup' => 'start' ,
'show_if_checked' => 'option' ,
2012-04-24 18:36:52 +00:00
'desc_tip' => __ ( 'Force SSL (HTTPS) on the checkout pages (an SSL Certificate is required)' , 'woocommerce' ),
2011-11-07 18:37:37 +00:00
),
array (
2012-04-24 18:36:52 +00:00
'desc' => __ ( 'Un-force HTTPS when leaving the checkout' , 'woocommerce' ),
2011-11-07 18:37:37 +00:00
'id' => 'woocommerce_unforce_ssl_checkout' ,
'std' => 'no' ,
'type' => 'checkbox' ,
2011-12-21 21:12:34 +00:00
'checkboxgroup' => 'end' ,
'show_if_checked' => 'yes' ,
2011-08-10 17:11:11 +00:00
),
2012-03-12 09:25:06 +00:00
array (
2012-03-12 15:48:22 +00:00
'name' => __ ( 'Coupons' , 'woocommerce' ),
2012-04-24 18:36:52 +00:00
'desc' => __ ( 'Enable coupons' , 'woocommerce' ),
2012-03-12 09:25:06 +00:00
'id' => 'woocommerce_enable_coupons' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
2012-03-12 15:48:22 +00:00
'checkboxgroup' => 'start' ,
'show_if_checked' => 'option'
2012-03-12 09:25:06 +00:00
),
2012-02-24 20:04:05 +00:00
array (
'desc' => __ ( 'Enable coupon form on checkout' , 'woocommerce' ),
'id' => 'woocommerce_enable_coupon_form_on_checkout' ,
2011-11-14 16:46:11 +00:00
'std' => 'no' ,
'type' => 'checkbox' ,
2012-03-12 15:48:22 +00:00
'checkboxgroup' => 'end' ,
'show_if_checked' => 'yes'
),
2012-02-24 20:04:05 +00:00
array (
'name' => __ ( 'Customer Accounts' , 'woocommerce' ),
'desc' => __ ( 'Allow unregistered users to register from the Checkout' , 'woocommerce' ),
'id' => 'woocommerce_enable_signup_and_login_from_checkout' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
),
array (
'desc' => __ ( 'Allow unregistered users to register from "My Account"' , 'woocommerce' ),
'id' => 'woocommerce_enable_myaccount_registration' ,
'std' => 'no' ,
'type' => 'checkbox' ,
'checkboxgroup' => ''
2012-01-05 15:49:28 +00:00
),
2011-11-26 20:33:15 +00:00
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Clear cart when logging out' , 'woocommerce' ),
2011-11-26 20:33:15 +00:00
'id' => 'woocommerce_clear_cart_on_logout' ,
'std' => 'no' ,
'type' => 'checkbox' ,
'checkboxgroup' => ''
2011-11-14 16:46:11 +00:00
),
2011-11-18 14:31:53 +00:00
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Prevent customers from accessing WordPress admin' , 'woocommerce' ),
2011-11-18 14:31:53 +00:00
'id' => 'woocommerce_lock_down_admin' ,
'std' => 'no' ,
2011-11-26 20:33:15 +00:00
'type' => 'checkbox' ,
2012-03-15 00:25:51 +00:00
'checkboxgroup' => ''
),
array (
2012-04-24 18:15:56 +00:00
'desc' => __ ( 'Allow customers to repurchase past orders' , 'woocommerce' ),
2012-03-15 00:25:51 +00:00
'id' => 'woocommerce_allow_customers_to_reorder' ,
2012-03-15 12:15:22 +00:00
'std' => 'no' ,
2012-03-15 00:25:51 +00:00
'type' => 'checkbox' ,
2011-11-26 20:33:15 +00:00
'checkboxgroup' => 'end'
2011-11-18 14:31:53 +00:00
),
2012-02-24 20:04:05 +00:00
array ( 'type' => 'sectionend' , 'id' => 'checkout_account_options' ),
2012-03-19 12:16:33 +00:00
array ( 'name' => __ ( 'Styles and Scripts' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'The following options affect the styling of your store, as well as how certain features behave.' , 'woocommerce' ), 'id' => 'script_styling_options' ),
2011-11-18 14:31:53 +00:00
2011-08-10 17:11:11 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Styling' , 'woocommerce' ),
'desc' => __ ( 'Enable WooCommerce CSS styles' , 'woocommerce' ),
2011-08-13 13:57:48 +00:00
'id' => 'woocommerce_frontend_css' ,
'std' => 'yes' ,
2011-11-04 17:48:04 +00:00
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
2011-08-13 13:57:48 +00:00
),
2011-09-05 09:04:17 +00:00
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Enable the "Demo Store" notice on your site' , 'woocommerce' ),
2011-12-07 21:26:53 +00:00
'id' => 'woocommerce_demo_store' ,
'std' => 'no' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'end'
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Scripts' , 'woocommerce' ),
'desc' => __ ( 'Enable AJAX add to cart buttons on product archives' , 'woocommerce' ),
2011-11-04 20:57:54 +00:00
'id' => 'woocommerce_enable_ajax_add_to_cart' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
2011-12-07 21:26:53 +00:00
'checkboxgroup' => 'start'
2011-11-04 20:57:54 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Enable WooCommerce lightbox on the product page' , 'woocommerce' ),
2011-09-05 09:04:17 +00:00
'id' => 'woocommerce_enable_lightbox' ,
'std' => 'yes' ,
2011-11-04 17:48:04 +00:00
'type' => 'checkbox' ,
2011-12-02 11:11:33 +00:00
'checkboxgroup' => ''
2011-09-05 09:04:17 +00:00
),
2011-12-15 19:22:15 +00:00
array (
2012-04-24 18:36:52 +00:00
'desc' => __ ( 'Enable enhanced country select boxes' , 'woocommerce' ),
2011-12-15 19:22:15 +00:00
'id' => 'woocommerce_enable_chosen' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => ''
),
2011-12-02 11:11:33 +00:00
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Enable jQuery UI (used by the price slider widget)' , 'woocommerce' ),
2011-12-02 11:11:33 +00:00
'id' => 'woocommerce_enable_jquery_ui' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => ''
),
2011-12-02 07:24:52 +00:00
2011-12-02 11:11:33 +00:00
array (
2012-02-24 20:04:05 +00:00
'desc' => __ ( 'Output WooCommerce JavaScript in the footer' , 'woocommerce' ),
2011-12-02 11:11:33 +00:00
'id' => 'woocommerce_scripts_position' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'end'
),
2012-02-24 20:04:05 +00:00
array ( 'type' => 'sectionend' , 'id' => 'script_styling_options' ),
array ( 'name' => __ ( 'Digital Downloads' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'The following options are specific to downloadable products.' , 'woocommerce' ), 'id' => 'digital_download_options' ),
2011-08-13 13:57:48 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'File download method' , 'woocommerce' ),
'desc' => __ ( 'Forcing downloads will keep URLs hidden, but some servers may serve large files unreliably. If supported, <code>X-Accel-Redirect</code>/ <code>X-Sendfile</code> can be used to serve downloads instead (server requires <code>mod_xsendfile</code>).' , 'woocommerce' ),
2011-12-07 21:26:53 +00:00
'id' => 'woocommerce_file_download_method' ,
'type' => 'select' ,
'class' => 'chosen_select' ,
'css' => 'min-width:300px;' ,
'std' => 'force' ,
2012-02-24 20:04:05 +00:00
'desc_tip' => true ,
2011-12-07 21:26:53 +00:00
'options' => array (
2012-01-05 11:31:22 +00:00
'force' => __ ( 'Force Downloads' , 'woocommerce' ),
'xsendfile' => __ ( 'X-Accel-Redirect/X-Sendfile' , 'woocommerce' ),
'redirect' => __ ( 'Redirect only' , 'woocommerce' ),
2011-12-07 21:26:53 +00:00
)
2011-11-07 21:52:04 +00:00
),
2012-01-29 02:27:49 +00:00
array (
2012-02-06 17:39:18 +00:00
'name' => __ ( 'Require login to download' , 'woocommerce' ),
2012-04-24 18:36:52 +00:00
'desc' => __ ( 'Do not allow downloads if a user is not logged in' , 'woocommerce' ),
2012-01-29 02:27:49 +00:00
'id' => 'woocommerce_downloads_require_login' ,
'type' => 'checkbox' ,
'std' => 'no' ,
2012-04-24 18:36:52 +00:00
'desc_tip' => __ ( 'This setting does not apply to guest downloads.' , 'woocommerce' )
2012-01-29 02:27:49 +00:00
),
2012-02-27 18:22:54 +00:00
array (
'name' => __ ( 'Limit quantity' , 'woocommerce' ),
2012-04-24 18:36:52 +00:00
'desc' => __ ( 'Limit the purchasable quantity of downloadable-virtual items to 1' , 'woocommerce' ),
2012-02-27 18:22:54 +00:00
'id' => 'woocommerce_limit_downloadable_product_qty' ,
'std' => 'yes' ,
'type' => 'checkbox'
),
2011-11-09 12:26:22 +00:00
array (
2012-02-24 20:04:05 +00:00
'name' => __ ( 'Mixed cart handling' , 'woocommerce' ),
2012-04-24 18:36:52 +00:00
'desc' => __ ( 'Grant access to downloadable products after payment' , 'woocommerce' ),
2012-02-24 20:04:05 +00:00
'id' => 'woocommerce_downloads_grant_access_after_payment' ,
2011-11-09 12:26:22 +00:00
'type' => 'checkbox' ,
2012-02-24 20:04:05 +00:00
'std' => 'yes' ,
2012-04-24 18:36:52 +00:00
'desc_tip' => __ ( 'Turn this option off to only grant access when an order is "complete"' , 'woocommerce' )
2011-11-09 12:26:22 +00:00
),
2012-02-24 20:04:05 +00:00
array ( 'type' => 'sectionend' , 'id' => 'digital_download_options' ),
2011-09-15 16:37:38 +00:00
)); // End general settings
2012-02-18 10:19:07 +00:00
// Get shop page
2012-01-06 17:14:31 +00:00
$shop_page_id = woocommerce_get_page_id ( 'shop' );
2012-02-18 10:19:07 +00:00
2011-10-10 21:32:07 +00:00
$base_slug = ( $shop_page_id > 0 && get_page ( $shop_page_id )) ? get_page_uri ( $shop_page_id ) : 'shop' ;
2012-02-18 10:19:07 +00:00
$woocommerce_prepend_shop_page_to_products_warning = '' ;
if ( $shop_page_id > 0 && sizeof ( get_pages ( " child_of= $shop_page_id " )) > 0 )
$woocommerce_prepend_shop_page_to_products_warning = ' <mark class="notice">' . __ ( 'Note: The shop page has children - child pages will not work if you enable this option.' , 'woocommerce' ) . '</mark>' ;
2011-10-10 21:32:07 +00:00
2011-09-15 16:37:38 +00:00
$woocommerce_settings [ 'pages' ] = apply_filters ( 'woocommerce_page_settings' , array (
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'Page Setup' , 'woocommerce' ), 'type' => 'title' , 'desc' => '' , 'id' => 'page_options' ),
2011-08-13 13:57:48 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Shop Base Page' , 'woocommerce' ),
2012-02-26 01:13:03 +00:00
'desc' => sprintf ( __ ( 'This sets the base page of your shop - this is where your product archive will be.' , 'woocommerce' ), '<a target="_blank" href="options-permalink.php">' , '</a>' ),
2011-08-13 13:57:48 +00:00
'id' => 'woocommerce_shop_page_id' ,
'type' => 'single_select_page' ,
2011-11-23 12:02:36 +00:00
'std' => '' ,
'class' => 'chosen_select_nostd' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'desc_tip' => true ,
2011-08-13 13:57:48 +00:00
),
2011-10-12 11:17:06 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Base Page Title' , 'woocommerce' ),
'desc' => __ ( 'This title to show on the shop base page. Leave blank to use the page title.' , 'woocommerce' ),
2011-10-12 11:17:06 +00:00
'id' => 'woocommerce_shop_page_title' ,
'type' => 'text' ,
2011-11-23 12:02:36 +00:00
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'std' => 'All Products' , // Default value for the page title - changed in settings
'desc_tip' => true ,
2011-10-12 11:17:06 +00:00
),
2011-08-10 17:11:11 +00:00
2011-08-13 13:57:48 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Terms page ID' , 'woocommerce' ),
'desc' => __ ( 'If you define a "Terms" page the customer will be asked if they accept them when checking out.' , 'woocommerce' ),
2011-08-13 13:57:48 +00:00
'tip' => '' ,
'id' => 'woocommerce_terms_page_id' ,
'std' => '' ,
2011-11-23 12:02:36 +00:00
'class' => 'chosen_select_nostd' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'type' => 'single_select_page' ,
'desc_tip' => true ,
2011-08-13 13:57:48 +00:00
),
2011-10-29 16:10:33 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Logout link' , 'woocommerce' ),
'desc' => sprintf ( __ ( 'Append a logout link to menus containing "My Account"' , 'woocommerce' ), $base_slug ),
2011-10-29 16:10:33 +00:00
'id' => 'woocommerce_menu_logout_link' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
),
2011-10-10 21:32:07 +00:00
array ( 'type' => 'sectionend' , 'id' => 'page_options' ),
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'Permalinks' , 'woocommerce' ), 'type' => 'title' , 'desc' => '' , 'id' => 'permalink_options' ),
2011-10-10 21:32:07 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Taxonomy base page' , 'woocommerce' ),
'desc' => sprintf ( __ ( 'Prepend shop categories/tags with shop base page (<code>%s</code>)' , 'woocommerce' ), $base_slug ),
2011-10-10 21:32:07 +00:00
'id' => 'woocommerce_prepend_shop_page_to_urls' ,
'std' => 'no' ,
'type' => 'checkbox' ,
),
2011-12-05 14:02:33 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Product category slug' , 'woocommerce' ),
'desc' => __ ( 'Shows in the product category URLs. Leave blank to use the default slug.' , 'woocommerce' ),
2011-12-05 14:02:33 +00:00
'id' => 'woocommerce_product_category_slug' ,
'type' => 'text' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'std' => '' ,
'desc_tip' => true ,
2011-12-05 14:02:33 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Product tag slug' , 'woocommerce' ),
'desc' => __ ( 'Shows in the product tag URLs. Leave blank to use the default slug.' , 'woocommerce' ),
2011-12-05 14:02:33 +00:00
'id' => 'woocommerce_product_tag_slug' ,
'type' => 'text' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'std' => '' ,
'desc_tip' => true ,
2011-12-05 14:02:33 +00:00
),
2011-10-10 21:32:07 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Product base page' , 'woocommerce' ),
2012-02-18 10:19:07 +00:00
'desc' => sprintf ( __ ( 'Prepend product permalinks with shop base page (<code>%s</code>)' , 'woocommerce' ), $base_slug ) . $woocommerce_prepend_shop_page_to_products_warning ,
2011-10-10 21:32:07 +00:00
'id' => 'woocommerce_prepend_shop_page_to_products' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Product base category' , 'woocommerce' ),
'desc' => __ ( 'Prepend product permalinks with product category' , 'woocommerce' ),
2011-10-10 21:32:07 +00:00
'id' => 'woocommerce_prepend_category_to_products' ,
2011-10-12 11:17:06 +00:00
'std' => 'no' ,
2011-10-10 21:32:07 +00:00
'type' => 'checkbox' ,
'checkboxgroup' => 'end'
),
array ( 'type' => 'sectionend' , 'id' => 'permalink_options' ),
2011-08-13 13:57:48 +00:00
2012-02-26 01:13:03 +00:00
array ( 'name' => __ ( 'Shop Pages' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'The following pages need selecting so that WooCommerce knows where they are. These pages should have been created upon installation of the plugin, if not you will need to create them.' , 'woocommerce' ) ),
2011-08-10 17:11:11 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Cart Page' , 'woocommerce' ),
'desc' => __ ( 'Page contents: [woocommerce_cart]' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_cart_page_id' ,
'type' => 'single_select_page' ,
2011-11-23 12:02:36 +00:00
'std' => '' ,
'class' => 'chosen_select_nostd' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Checkout Page' , 'woocommerce' ),
'desc' => __ ( 'Page contents: [woocommerce_checkout]' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_checkout_page_id' ,
'type' => 'single_select_page' ,
2011-11-23 12:02:36 +00:00
'std' => '' ,
'class' => 'chosen_select_nostd' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Pay Page' , 'woocommerce' ),
'desc' => __ ( 'Page contents: [woocommerce_pay] Parent: "Checkout"' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_pay_page_id' ,
'type' => 'single_select_page' ,
2011-11-23 12:02:36 +00:00
'std' => '' ,
'class' => 'chosen_select_nostd' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Thanks Page' , 'woocommerce' ),
'desc' => __ ( 'Page contents: [woocommerce_thankyou] Parent: "Checkout"' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_thanks_page_id' ,
'type' => 'single_select_page' ,
2011-11-23 12:02:36 +00:00
'std' => '' ,
'class' => 'chosen_select_nostd' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'My Account Page' , 'woocommerce' ),
'desc' => __ ( 'Page contents: [woocommerce_my_account]' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_myaccount_page_id' ,
'type' => 'single_select_page' ,
2011-11-23 12:02:36 +00:00
'std' => '' ,
'class' => 'chosen_select_nostd' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Edit Address Page' , 'woocommerce' ),
'desc' => __ ( 'Page contents: [woocommerce_edit_address] Parent: "My Account"' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_edit_address_page_id' ,
'type' => 'single_select_page' ,
2011-11-23 12:02:36 +00:00
'std' => '' ,
'class' => 'chosen_select_nostd' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'View Order Page' , 'woocommerce' ),
'desc' => __ ( 'Page contents: [woocommerce_view_order] Parent: "My Account"' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_view_order_page_id' ,
'type' => 'single_select_page' ,
2011-11-23 12:02:36 +00:00
'std' => '' ,
'class' => 'chosen_select_nostd' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Change Password Page' , 'woocommerce' ),
'desc' => __ ( 'Page contents: [woocommerce_change_password] Parent: "My Account"' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_change_password_page_id' ,
'type' => 'single_select_page' ,
2011-11-23 12:02:36 +00:00
'std' => '' ,
'class' => 'chosen_select_nostd' ,
'css' => 'min-width:300px;' ,
2012-02-26 01:13:03 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
2011-09-15 12:59:06 +00:00
array ( 'type' => 'sectionend' , 'id' => 'page_options' ),
2011-09-15 16:37:38 +00:00
)); // End pages settings
$woocommerce_settings [ 'catalog' ] = apply_filters ( 'woocommerce_catalog_settings' , array (
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'Catalog Options' , 'woocommerce' ), 'type' => 'title' , 'desc' => '' , 'id' => 'catalog_options' ),
2012-03-19 12:16:33 +00:00
array (
'name' => __ ( 'Default product sorting' , 'woocommerce' ),
'desc' => __ ( 'This controls the default sort order of the catalog.' , 'woocommerce' ),
'id' => 'woocommerce_default_catalog_orderby' ,
'css' => 'min-width:150px;' ,
'std' => 'title' ,
'type' => 'select' ,
'options' => apply_filters ( 'woocommerce_default_catalog_orderby_options' , array (
'title' => __ ( 'Sort by title' , 'woocommerce' ),
'date' => __ ( 'Sort by date' , 'woocommerce' ),
'price' => __ ( 'Sort by price' , 'woocommerce' ),
)),
'desc_tip' => true ,
),
2011-10-07 19:27:10 +00:00
array (
2012-03-19 12:16:33 +00:00
'name' => __ ( 'Show subcategories' , 'woocommerce' ),
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Show subcategories on category pages' , 'woocommerce' ),
2011-10-07 19:27:10 +00:00
'id' => 'woocommerce_show_subcategories' ,
'std' => 'no' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
),
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Show subcategories on the shop page' , 'woocommerce' ),
2011-10-07 19:27:10 +00:00
'id' => 'woocommerce_shop_show_subcategories' ,
'std' => 'no' ,
'type' => 'checkbox' ,
2011-10-22 19:20:39 +00:00
'checkboxgroup' => ''
),
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'When showing subcategories, hide products' , 'woocommerce' ),
2011-10-22 19:20:39 +00:00
'id' => 'woocommerce_hide_products_when_showing_subcategories' ,
'std' => 'no' ,
'type' => 'checkbox' ,
2011-10-07 19:27:10 +00:00
'checkboxgroup' => 'end'
),
2012-03-19 12:16:33 +00:00
array (
'name' => __ ( 'Redirects' , 'woocommerce' ),
'desc' => __ ( 'Redirect to cart after adding a product to the cart (on single product pages)' , 'woocommerce' ),
'id' => 'woocommerce_cart_redirect_after_add' ,
'std' => 'no' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
),
array (
'desc' => __ ( 'Redirect to the product page on a single matching search result' , 'woocommerce' ),
'id' => 'woocommerce_redirect_on_single_search_result' ,
'std' => 'no' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'end'
),
array ( 'type' => 'sectionend' , 'id' => 'catalog_options' ),
array ( 'name' => __ ( 'Product Data' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'The following options affect the fields available on the edit product page.' , 'woocommerce' ), 'id' => 'product_data_options' ),
2011-08-13 13:57:48 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Product fields' , 'woocommerce' ),
'desc' => __ ( 'Enable the SKU field for products' , 'woocommerce' ),
2011-08-13 13:57:48 +00:00
'id' => 'woocommerce_enable_sku' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
),
2011-08-10 17:11:11 +00:00
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Enable the weight field for products' , 'woocommerce' ),
2011-08-13 13:57:48 +00:00
'id' => 'woocommerce_enable_weight' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
2011-10-08 11:57:04 +00:00
'checkboxgroup' => ''
),
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Enable the dimension fields for products' , 'woocommerce' ),
2011-10-08 11:57:04 +00:00
'id' => 'woocommerce_enable_dimensions' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
2011-11-14 17:18:13 +00:00
'checkboxgroup' => ''
),
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Show weight and dimension fields in product attributes tab' , 'woocommerce' ),
2011-11-14 17:18:13 +00:00
'id' => 'woocommerce_enable_dimension_product_attributes' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
2011-08-13 13:57:48 +00:00
'checkboxgroup' => 'end'
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Weight Unit' , 'woocommerce' ),
'desc' => __ ( 'This controls what unit you will define weights in.' , 'woocommerce' ),
2011-08-13 13:57:48 +00:00
'id' => 'woocommerce_weight_unit' ,
2011-11-23 12:02:36 +00:00
'css' => 'min-width:150px;' ,
2012-03-08 12:57:15 +00:00
'std' => 'kg' ,
2011-08-10 17:11:11 +00:00
'type' => 'select' ,
2011-08-13 13:57:48 +00:00
'options' => array (
2012-02-07 14:14:19 +00:00
'kg' => __ ( 'kg' , 'woocommerce' ),
'g' => __ ( 'g' , 'woocommerce' ),
'lbs' => __ ( 'lbs' , 'woocommerce' ),
),
2012-03-19 12:16:33 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
2011-10-08 11:57:04 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Dimensions Unit' , 'woocommerce' ),
'desc' => __ ( 'This controls what unit you will define lengths in.' , 'woocommerce' ),
2011-10-08 11:57:04 +00:00
'id' => 'woocommerce_dimension_unit' ,
2011-11-23 12:02:36 +00:00
'css' => 'min-width:150px;' ,
2011-12-02 18:54:52 +00:00
'std' => 'cm' ,
2011-10-08 11:57:04 +00:00
'type' => 'select' ,
'options' => array (
2012-02-07 14:14:19 +00:00
'm' => __ ( 'm' , 'woocommerce' ),
2012-01-05 11:31:22 +00:00
'cm' => __ ( 'cm' , 'woocommerce' ),
2012-02-07 14:14:19 +00:00
'mm' => __ ( 'mm' , 'woocommerce' ),
'in' => __ ( 'in' , 'woocommerce' ),
2012-04-18 12:18:59 +00:00
'yd' => __ ( 'yd' , 'woocommerce' ),
2012-02-07 14:14:19 +00:00
),
2012-03-19 12:16:33 +00:00
'desc_tip' => true ,
2011-08-18 23:14:35 +00:00
),
2012-03-27 19:35:35 +00:00
array (
2012-04-24 18:15:56 +00:00
'name' => __ ( 'Product Ratings' , 'woocommerce' ),
2012-03-27 19:35:35 +00:00
'desc' => __ ( 'Enable the star rating field on the review form' , 'woocommerce' ),
'id' => 'woocommerce_enable_review_rating' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'start' ,
'show_if_checked' => 'option' ,
),
array (
'desc' => __ ( 'Ratings are required to leave a review' , 'woocommerce' ),
'id' => 'woocommerce_review_rating_required' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'end' ,
'show_if_checked' => 'yes' ,
),
2011-08-13 13:57:48 +00:00
2012-03-27 19:35:35 +00:00
array ( 'type' => 'sectionend' , 'id' => 'product_review_options' ),
2012-03-19 12:16:33 +00:00
array ( 'name' => __ ( 'Pricing Options' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'The following options affect how prices are displayed on the frontend.' , 'woocommerce' ), 'id' => 'pricing_options' ),
2011-08-13 13:57:48 +00:00
2011-08-10 17:11:11 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Currency Position' , 'woocommerce' ),
'desc' => __ ( 'This controls the position of the currency symbol.' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'tip' => '' ,
'id' => 'woocommerce_currency_pos' ,
2011-11-23 12:02:36 +00:00
'css' => 'min-width:150px;' ,
2011-08-10 17:11:11 +00:00
'std' => 'left' ,
'type' => 'select' ,
'options' => array (
2012-01-05 11:31:22 +00:00
'left' => __ ( 'Left' , 'woocommerce' ),
'right' => __ ( 'Right' , 'woocommerce' ),
'left_space' => __ ( 'Left (with space)' , 'woocommerce' ),
'right_space' => __ ( 'Right (with space)' , 'woocommerce' )
2012-03-19 12:16:33 +00:00
),
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Thousand separator' , 'woocommerce' ),
'desc' => __ ( 'This sets the thousand separator of displayed prices.' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'tip' => '' ,
'id' => 'woocommerce_price_thousand_sep' ,
'css' => 'width:30px;' ,
'std' => ',' ,
'type' => 'text' ,
2012-03-19 12:16:33 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Decimal separator' , 'woocommerce' ),
'desc' => __ ( 'This sets the decimal separator of displayed prices.' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'tip' => '' ,
'id' => 'woocommerce_price_decimal_sep' ,
'css' => 'width:30px;' ,
'std' => '.' ,
'type' => 'text' ,
2012-03-19 12:16:33 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Number of decimals' , 'woocommerce' ),
'desc' => __ ( 'This sets the number of decimal points shown in displayed prices.' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'tip' => '' ,
'id' => 'woocommerce_price_num_decimals' ,
'css' => 'width:30px;' ,
'std' => '2' ,
'type' => 'text' ,
2012-03-19 12:16:33 +00:00
'desc_tip' => true ,
2011-08-10 17:11:11 +00:00
),
2011-12-01 11:34:26 +00:00
array (
2012-03-19 12:16:33 +00:00
'name' => __ ( 'Trailing zeros' , 'woocommerce' ),
'desc' => __ ( 'Remove zeros after the decimal point. e.g. <code>$10.00</code> becomes <code>$10</code>' , 'woocommerce' ),
2011-12-01 11:34:26 +00:00
'id' => 'woocommerce_price_trim_zeros' ,
'std' => 'yes' ,
'type' => 'checkbox'
),
2011-09-09 15:09:22 +00:00
array ( 'type' => 'sectionend' , 'id' => 'pricing_options' ),
2011-10-03 10:29:36 +00:00
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'Image Options' , 'woocommerce' ), 'type' => 'title' , 'desc' => sprintf ( __ ( 'These settings affect the actual dimensions of images in your catalog - the display on the front-end will still be affected by CSS styles. After changing these settings you may need to <a href="%s">regenerate your thumbnails</a>.' , 'woocommerce' ), 'http://wordpress.org/extend/plugins/regenerate-thumbnails/' ), 'id' => 'image_options' ),
2011-10-03 10:29:36 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Catalog Images' , 'woocommerce' ),
'desc' => __ ( 'This size is usually used in product listings' , 'woocommerce' ),
2011-10-03 10:29:36 +00:00
'id' => 'woocommerce_catalog_image' ,
'css' => '' ,
'type' => 'image_width' ,
2012-03-19 12:16:33 +00:00
'std' => '150' ,
'desc_tip' => true ,
2011-10-03 10:29:36 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Single Product Image' , 'woocommerce' ),
'desc' => __ ( 'This is the size used by the main image on the product page.' , 'woocommerce' ),
2011-10-03 10:29:36 +00:00
'id' => 'woocommerce_single_image' ,
'css' => '' ,
'type' => 'image_width' ,
2012-03-19 12:16:33 +00:00
'std' => '300' ,
'desc_tip' => true ,
2011-10-03 10:29:36 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Product Thumbnails' , 'woocommerce' ),
'desc' => __ ( 'This size is usually used for the gallery of images on the product page.' , 'woocommerce' ),
2011-10-03 10:29:36 +00:00
'id' => 'woocommerce_thumbnail_image' ,
'css' => '' ,
'type' => 'image_width' ,
2012-03-19 12:16:33 +00:00
'std' => '90' ,
'desc_tip' => true ,
2011-10-03 10:29:36 +00:00
),
array ( 'type' => 'sectionend' , 'id' => 'image_options' ),
2011-08-10 17:11:11 +00:00
2011-09-15 16:37:38 +00:00
)); // End catalog settings
$woocommerce_settings [ 'inventory' ] = apply_filters ( 'woocommerce_inventory_settings' , array (
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'Inventory Options' , 'woocommerce' ), 'type' => 'title' , 'desc' => '' , 'id' => 'inventory_options' ),
2011-08-10 17:11:11 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Manage stock' , 'woocommerce' ),
'desc' => __ ( 'Enable stock management' , 'woocommerce' ),
2011-08-13 13:57:48 +00:00
'id' => 'woocommerce_manage_stock' ,
'std' => 'yes' ,
'type' => 'checkbox'
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Notifications' , 'woocommerce' ),
'desc' => __ ( 'Enable low stock notifications' , 'woocommerce' ),
2011-08-13 13:57:48 +00:00
'id' => 'woocommerce_notify_low_stock' ,
2011-08-10 17:11:11 +00:00
'std' => 'yes' ,
2011-08-13 13:57:48 +00:00
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Enable out of stock notifications' , 'woocommerce' ),
2011-08-13 13:57:48 +00:00
'id' => 'woocommerce_notify_no_stock' ,
2011-08-10 17:11:11 +00:00
'std' => 'yes' ,
2011-08-13 13:57:48 +00:00
'type' => 'checkbox' ,
'checkboxgroup' => 'end'
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Low stock threshold' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'desc' => '' ,
'tip' => '' ,
'id' => 'woocommerce_notify_low_stock_amount' ,
2011-11-23 12:02:36 +00:00
'css' => 'width:30px;' ,
2011-08-10 17:11:11 +00:00
'type' => 'text' ,
'std' => '2'
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Out of stock threshold' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'desc' => '' ,
'tip' => '' ,
'id' => 'woocommerce_notify_no_stock_amount' ,
2011-11-23 12:02:36 +00:00
'css' => 'width:30px;' ,
2011-08-10 17:11:11 +00:00
'type' => 'text' ,
'std' => '0'
),
2011-08-17 23:42:07 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Out of stock visibility' , 'woocommerce' ),
'desc' => __ ( 'Hide out of stock items from the catalog' , 'woocommerce' ),
2011-08-17 23:42:07 +00:00
'id' => 'woocommerce_hide_out_of_stock_items' ,
'std' => 'no' ,
'type' => 'checkbox'
),
2012-04-24 18:15:56 +00:00
array (
'name' => __ ( 'Stock display format' , 'woocommerce' ),
'desc' => __ ( 'This controls how stock is displayed on the frontend.' , 'woocommerce' ),
'id' => 'woocommerce_stock_format' ,
'css' => 'min-width:150px;' ,
'std' => '' ,
'type' => 'select' ,
'options' => array (
'' => __ ( 'Always show stock e.g. "12 in stock"' , 'woocommerce' ),
'low_amount' => __ ( 'Only show stock when low e.g. "Only 2 left in stock" vs. "In Stock"' , 'woocommerce' ),
'no_amount' => __ ( 'Never show stock amount' , 'woocommerce' ),
),
'desc_tip' => true ,
),
2011-09-09 15:09:22 +00:00
array ( 'type' => 'sectionend' , 'id' => 'inventory_options' ),
2011-09-15 16:37:38 +00:00
)); // End inventory settings
$woocommerce_settings [ 'shipping' ] = apply_filters ( 'woocommerce_shipping_settings' , array (
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'Shipping Options' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'Shipping can be enabled and disabled from this section.' , 'woocommerce' ), 'id' => 'shipping_options' ),
2011-08-10 17:11:11 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Shipping calculations' , 'woocommerce' ),
'desc' => __ ( 'Enable shipping' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_calc_shipping' ,
'std' => 'yes' ,
2011-11-04 17:48:04 +00:00
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Shipping calculations' , 'woocommerce' ),
'desc' => __ ( 'Enable the shipping calculator on the cart page' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_enable_shipping_calc' ,
'std' => 'yes' ,
2011-11-04 17:48:04 +00:00
'type' => 'checkbox' ,
2012-04-11 11:00:56 +00:00
'checkboxgroup' => ''
),
array (
'name' => __ ( 'Shipping calculations' , 'woocommerce' ),
2012-04-11 12:08:04 +00:00
'desc' => __ ( 'Hide shipping costs until an address is entered' , 'woocommerce' ),
'id' => 'woocommerce_shipping_cost_requires_address' ,
2012-04-11 11:00:56 +00:00
'std' => 'no' ,
'type' => 'checkbox' ,
2011-11-04 17:48:04 +00:00
'checkboxgroup' => 'end'
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Shipping destination' , 'woocommerce' ),
'desc' => __ ( 'Only ship to the users billing address' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_ship_to_billing_address_only' ,
'std' => 'no' ,
2011-12-21 21:12:34 +00:00
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
),
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Ship to billing address by default' , 'woocommerce' ),
2011-12-21 21:12:34 +00:00
'id' => 'woocommerce_ship_to_same_address' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
2012-04-21 18:30:37 +00:00
'checkboxgroup' => ''
),
array (
'desc' => __ ( 'Collect shipping address even when not required' , 'woocommerce' ),
'id' => 'woocommerce_require_shipping_address' ,
'std' => 'no' ,
'type' => 'checkbox' ,
2011-12-21 21:12:34 +00:00
'checkboxgroup' => 'end'
2011-08-10 17:11:11 +00:00
),
2011-09-19 08:42:28 +00:00
array ( 'type' => 'sectionend' , 'id' => 'shipping_options' ),
2011-09-15 16:37:38 +00:00
)); // End shipping settings
$woocommerce_settings [ 'tax' ] = apply_filters ( 'woocommerce_tax_settings' , array (
2011-08-19 20:11:04 +00:00
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'Tax Options' , 'woocommerce' ), 'type' => 'title' , 'desc' => '' , 'id' => 'tax_options' ),
2011-11-22 13:18:33 +00:00
2011-11-21 11:33:46 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Tax calculations' , 'woocommerce' ),
'desc' => __ ( 'Enable taxes and tax calculations' , 'woocommerce' ),
2011-11-21 11:33:46 +00:00
'id' => 'woocommerce_calc_taxes' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
),
2012-01-09 18:00:52 +00:00
array (
'desc' => __ ( 'Display taxes on cart page' , 'woocommerce' ),
'id' => 'woocommerce_display_cart_taxes' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
'checkboxgroup' => ''
),
2011-12-28 23:59:33 +00:00
2012-03-12 12:50:38 +00:00
array (
2012-03-22 10:25:28 +00:00
'desc' => __ ( 'Display taxes even when the amount is zero' , 'woocommerce' ),
2012-03-12 12:50:38 +00:00
'id' => 'woocommerce_display_cart_taxes_if_zero' ,
'std' => 'no' ,
'type' => 'checkbox' ,
'checkboxgroup' => '' ,
),
2011-11-22 14:22:35 +00:00
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Round tax at subtotal level, instead of per line' , 'woocommerce' ),
2011-12-28 23:59:33 +00:00
'id' => 'woocommerce_tax_round_at_subtotal' ,
2011-11-30 16:07:05 +00:00
'std' => 'no' ,
2011-11-22 14:22:35 +00:00
'type' => 'checkbox' ,
2011-12-28 23:59:33 +00:00
'checkboxgroup' => 'end'
2011-11-22 14:22:35 +00:00
),
2011-11-21 11:33:46 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Catalog Prices' , 'woocommerce' ),
'desc' => __ ( 'Catalog prices defined including tax' , 'woocommerce' ),
2011-12-28 23:59:33 +00:00
'id' => 'woocommerce_prices_include_tax' ,
2011-11-21 11:33:46 +00:00
'std' => 'no' ,
'type' => 'checkbox' ,
2011-12-28 23:59:33 +00:00
'checkboxgroup' => 'start' ,
'show_if_checked' => 'option' ,
2011-11-21 11:33:46 +00:00
),
2011-11-22 13:18:33 +00:00
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Display cart contents excluding tax' , 'woocommerce' ),
2011-11-22 13:18:33 +00:00
'id' => 'woocommerce_display_cart_prices_excluding_tax' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
2011-12-28 23:59:33 +00:00
'checkboxgroup' => '' ,
'show_if_checked' => 'yes' ,
2011-11-22 13:18:33 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'desc' => __ ( 'Display cart totals excluding tax' , 'woocommerce' ),
2011-11-22 13:18:33 +00:00
'id' => 'woocommerce_display_totals_excluding_tax' ,
'std' => 'yes' ,
'type' => 'checkbox' ,
2011-12-28 23:59:33 +00:00
'checkboxgroup' => 'end' ,
'show_if_checked' => 'yes' ,
2011-11-22 13:18:33 +00:00
),
2011-08-10 17:11:11 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Additional Tax classes' , 'woocommerce' ),
'desc' => __ ( 'List 1 per line. This is in addition to the default <em>Standard Rate</em>.' , 'woocommerce' ),
'tip' => __ ( 'List product and shipping tax classes here, e.g. Zero Tax, Reduced Rate.' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_tax_classes' ,
'css' => 'width:100%; height: 75px;' ,
'type' => 'textarea' ,
2012-02-01 11:06:08 +00:00
'std' => sprintf ( __ ( 'Reduced Rate%sZero Rate' , 'woocommerce' ), PHP_EOL )
2011-08-10 17:11:11 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Tax rates' , 'woocommerce' ),
'desc' => __ ( 'All fields are required.' , 'woocommerce' ),
'tip' => __ ( 'To avoid rounding errors, insert tax rates with 4 decimal places.' , 'woocommerce' ),
2011-08-10 17:11:11 +00:00
'id' => 'woocommerce_tax_rates' ,
'css' => 'min-width:50px;' ,
'type' => 'tax_rates' ,
'std' => ''
),
2011-09-19 08:42:28 +00:00
array ( 'type' => 'sectionend' , 'id' => 'tax_options' ),
2011-08-13 13:57:48 +00:00
2011-09-15 16:37:38 +00:00
)); // End tax settings
2011-08-13 13:57:48 +00:00
2011-10-25 12:54:16 +00:00
$woocommerce_settings [ 'email' ] = apply_filters ( 'woocommerce_email_settings' , array (
2011-11-01 17:11:57 +00:00
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'Email Recipient Options' , 'woocommerce' ), 'type' => 'title' , '' , 'id' => 'email_recipient_options' ),
2011-11-01 17:11:57 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'New order notifications' , 'woocommerce' ),
'desc' => __ ( 'The recipient of new order emails. Defaults to the admin email.' , 'woocommerce' ),
2011-11-01 17:11:57 +00:00
'id' => 'woocommerce_new_order_email_recipient' ,
'type' => 'text' ,
2011-11-23 12:02:36 +00:00
'css' => 'min-width:300px;' ,
2011-11-01 17:11:57 +00:00
'std' => esc_attr ( get_option ( 'admin_email' ))
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Inventory notifications' , 'woocommerce' ),
'desc' => __ ( 'The recipient of stock emails. Defaults to the admin email.' , 'woocommerce' ),
2011-11-01 17:11:57 +00:00
'id' => 'woocommerce_stock_email_recipient' ,
'type' => 'text' ,
2011-11-23 12:02:36 +00:00
'css' => 'min-width:300px;' ,
2011-11-01 17:11:57 +00:00
'std' => esc_attr ( get_option ( 'admin_email' ))
),
array ( 'type' => 'sectionend' , 'id' => 'email_recipient_options' ),
2012-02-26 01:13:03 +00:00
array ( 'name' => __ ( 'Email Sender Options' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'The following options affect the sender (email address and name) used in WooCommerce emails.' , 'woocommerce' ), 'id' => 'email_options' ),
2011-10-25 12:54:16 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( '"From" name' , 'woocommerce' ),
2012-02-26 01:13:03 +00:00
'desc' => '' ,
2011-10-25 12:54:16 +00:00
'id' => 'woocommerce_email_from_name' ,
'type' => 'text' ,
2011-11-23 12:02:36 +00:00
'css' => 'min-width:300px;' ,
2011-10-25 12:54:16 +00:00
'std' => esc_attr ( get_bloginfo ( 'name' ))
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( '"From" email address' , 'woocommerce' ),
2012-02-26 01:13:03 +00:00
'desc' => '' ,
2011-10-25 12:54:16 +00:00
'id' => 'woocommerce_email_from_address' ,
'type' => 'text' ,
2011-11-23 12:02:36 +00:00
'css' => 'min-width:300px;' ,
2011-10-25 12:54:16 +00:00
'std' => get_option ( 'admin_email' )
),
array ( 'type' => 'sectionend' , 'id' => 'email_options' ),
2012-02-24 22:12:25 +00:00
array ( 'name' => __ ( 'Email template' , 'woocommerce' ), 'type' => 'title' , 'desc' => sprintf ( __ ( 'This section lets you customise the WooCommerce emails. <a href="%s" target="_blank">Click here to preview your email template</a>. For more advanced control copy <code>woocommerce/templates/emails/</code> to <code>yourtheme/woocommerce/emails/</code>.' , 'woocommerce' ), wp_nonce_url ( admin_url ( '?preview_woocommerce_mail=true' ), 'preview-mail' )), 'id' => 'email_template_options' ),
2011-10-25 12:54:16 +00:00
2011-10-26 17:13:29 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Header image' , 'woocommerce' ),
'desc' => sprintf ( __ ( 'Enter a URL to an image you want to show in the email\'s header. Upload your image using the <a href="%s">media uploader</a>.' , 'woocommerce' ), admin_url ( 'media-new.php' )),
2011-10-26 17:13:29 +00:00
'id' => 'woocommerce_email_header_image' ,
'type' => 'text' ,
2011-11-23 12:02:36 +00:00
'css' => 'min-width:300px;' ,
2011-10-26 17:13:29 +00:00
'std' => ''
),
2011-10-25 12:54:16 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Email footer text' , 'woocommerce' ),
'desc' => __ ( 'The text to appear in the footer of WooCommerce emails.' , 'woocommerce' ),
2011-10-25 12:54:16 +00:00
'id' => 'woocommerce_email_footer_text' ,
2011-10-26 13:11:20 +00:00
'css' => 'width:100%; height: 75px;' ,
'type' => 'textarea' ,
2012-01-05 11:31:22 +00:00
'std' => get_bloginfo ( 'name' ) . ' - ' . __ ( 'Powered by WooCommerce' , 'woocommerce' )
2011-10-25 12:54:16 +00:00
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Base colour' , 'woocommerce' ),
'desc' => __ ( 'The base colour for WooCommerce email templates. Default <code>#557da1</code>.' , 'woocommerce' ),
2011-10-25 12:54:16 +00:00
'id' => 'woocommerce_email_base_color' ,
'type' => 'color' ,
2011-11-23 12:02:36 +00:00
'css' => 'width:6em;' ,
2011-10-25 12:54:16 +00:00
'std' => '#557da1'
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Background colour' , 'woocommerce' ),
'desc' => __ ( 'The background colour for WooCommerce email templates. Default <code>#eeeeee</code>.' , 'woocommerce' ),
2011-10-25 12:54:16 +00:00
'id' => 'woocommerce_email_background_color' ,
'type' => 'color' ,
2011-11-23 12:02:36 +00:00
'css' => 'width:6em;' ,
2011-10-25 12:54:16 +00:00
'std' => '#eeeeee'
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Email body background colour' , 'woocommerce' ),
'desc' => __ ( 'The main body background colour. Default <code>#fdfdfd</code>.' , 'woocommerce' ),
2011-10-25 12:54:16 +00:00
'id' => 'woocommerce_email_body_background_color' ,
'type' => 'color' ,
2011-11-23 12:02:36 +00:00
'css' => 'width:6em;' ,
2011-10-25 12:54:16 +00:00
'std' => '#fdfdfd'
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Email body text colour' , 'woocommerce' ),
'desc' => __ ( 'The main body text colour. Default <code>#505050</code>.' , 'woocommerce' ),
2011-10-25 12:54:16 +00:00
'id' => 'woocommerce_email_text_color' ,
'type' => 'color' ,
2011-11-23 12:02:36 +00:00
'css' => 'width:6em;' ,
2011-10-25 12:54:16 +00:00
'std' => '#505050'
),
array ( 'type' => 'sectionend' , 'id' => 'email_template_options' ),
)); // End email settings
2011-12-19 18:05:42 +00:00
$woocommerce_settings [ 'integration' ] = apply_filters ( 'woocommerce_intregation_settings' , array (
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'ShareThis' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'ShareThis offers a sharing widget which will allow customers to share links to products with their friends.' , 'woocommerce' ), 'id' => 'share_this' ),
2011-12-19 18:05:42 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'ShareThis Publisher ID' , 'woocommerce' ),
'desc' => sprintf ( __ ( 'Enter your %1$sShareThis publisher ID%2$s to show social sharing buttons on product pages.' , 'woocommerce' ), '<a href="http://sharethis.com/account/">' , '</a>' ),
2011-12-19 18:05:42 +00:00
'id' => 'woocommerce_sharethis' ,
'type' => 'text' ,
'std' => '' ,
'css' => 'min-width:300px;' ,
),
2012-02-06 17:28:18 +00:00
array ( 'type' => 'sectionend' , 'id' => 'share_this' ),
2012-04-28 17:28:18 +00:00
array ( 'name' => __ ( 'ShareDaddy' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'ShareDaddy is a sharing plugin bundled with JetPack.' , 'woocommerce' ), 'id' => 'sharedaddy' ),
2012-02-06 17:28:18 +00:00
array (
'name' => __ ( 'Output ShareDaddy button?' , 'woocommerce' ),
'desc' => __ ( 'Enable this option to show the ShareDaddy button (if installed) on the product page.' , 'woocommerce' ),
'id' => 'woocommerce_sharedaddy' ,
'type' => 'checkbox' ,
'std' => 'no' ,
),
2012-04-28 17:28:18 +00:00
array ( 'type' => 'sectionend' , 'id' => 'sharedaddy' ),
array ( 'name' => __ ( 'ShareYourCart' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'ShareYourCart helps you get more customers by motivating satisfied customers to talk with their friends about your products.' , 'woocommerce' ), 'id' => 'shareyourcart' ),
array (
'name' => __ ( 'ShareYourCart integration' , 'woocommerce' ),
'desc' => __ ( 'Enable this option to enable ShareYourCart' , 'woocommerce' ),
'id' => 'woocommerce_shareyourcart' ,
'type' => 'checkbox' ,
'std' => 'no' ,
),
array ( 'type' => 'sectionend' , 'id' => 'shareyourcart' ),
2011-12-19 18:05:42 +00:00
2012-01-05 11:31:22 +00:00
array ( 'name' => __ ( 'Google Analytics' , 'woocommerce' ), 'type' => 'title' , 'desc' => __ ( 'Google Analytics is a free service offered by Google that generates detailed statistics about the visitors to a website.' , 'woocommerce' ), 'id' => 'google_analytics' ),
2011-12-19 18:05:42 +00:00
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Google Analytics ID' , 'woocommerce' ),
'desc' => __ ( 'Log into your google analytics account to find your ID. e.g. <code>UA-XXXXX-X</code>' , 'woocommerce' ),
2011-12-19 18:05:42 +00:00
'id' => 'woocommerce_ga_id' ,
'type' => 'text' ,
'css' => 'min-width:300px;' ,
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Tracking code' , 'woocommerce' ),
'desc' => __ ( 'Add tracking code to your site\'s footer. You don\'t need to enable this if using a 3rd party analytics plugin.' , 'woocommerce' ),
2011-12-19 18:05:42 +00:00
'id' => 'woocommerce_ga_standard_tracking_enabled' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'start'
),
array (
2012-01-05 11:31:22 +00:00
'name' => __ ( 'Tracking code' , 'woocommerce' ),
'desc' => __ ( 'Add eCommerce tracking code to the thankyou page' , 'woocommerce' ),
2011-12-19 18:05:42 +00:00
'id' => 'woocommerce_ga_ecommerce_tracking_enabled' ,
'type' => 'checkbox' ,
'checkboxgroup' => 'end'
),
array ( 'type' => 'sectionend' , 'id' => 'google_analytics' ),
)); // End integration settings
2011-08-13 13:57:48 +00:00
/**
* Settings page
*
2011-09-09 14:23:32 +00:00
* Handles the display of the main woocommerce settings page in admin .
2011-08-13 13:57:48 +00:00
*/
2011-09-19 09:49:52 +00:00
if ( ! function_exists ( 'woocommerce_settings' )) {
2011-08-13 13:57:48 +00:00
function woocommerce_settings () {
2011-09-15 16:37:38 +00:00
global $woocommerce , $woocommerce_settings ;
2011-09-09 14:23:32 +00:00
2012-04-11 09:01:22 +00:00
$current_tab = ( empty ( $_GET [ 'tab' ] ) ) ? 'general' : urldecode ( $_GET [ 'tab' ] );
$current_section = ( empty ( $_GET [ 'section' ] ) ) ? '' : urldecode ( $_GET [ 'section' ] );
2011-09-15 16:37:38 +00:00
2012-02-17 12:49:32 +00:00
// Save settings
2012-04-11 09:01:22 +00:00
if ( ! empty ( $_POST ) ) {
2012-02-17 12:49:32 +00:00
if ( ! wp_verify_nonce ( $_REQUEST [ '_wpnonce' ], 'woocommerce-settings' ) )
die ( __ ( 'Action failed. Please refresh the page and retry.' , 'woocommerce' ) );
2011-09-15 16:37:38 +00:00
2012-04-11 09:01:22 +00:00
if ( ! $current_section ) {
switch ( $current_tab ) {
case " general " :
case " pages " :
case " catalog " :
case " inventory " :
case " shipping " :
case " tax " :
case " email " :
case " integration " :
woocommerce_update_options ( $woocommerce_settings [ $current_tab ] );
break ;
}
2011-09-15 16:37:38 +00:00
2012-04-11 09:01:22 +00:00
do_action ( 'woocommerce_update_options' );
do_action ( 'woocommerce_update_options_' . $current_tab );
} else {
2011-12-19 19:25:25 +00:00
2012-04-11 09:01:22 +00:00
// Save section only
do_action ( 'woocommerce_update_options_' . $current_tab . '_' . $current_section );
}
2011-12-19 19:25:25 +00:00
2012-04-11 09:01:22 +00:00
// Flush rules and clear any unwanted data
2011-09-15 16:37:38 +00:00
flush_rewrite_rules ( false );
2012-03-19 12:16:33 +00:00
unset ( $_SESSION [ 'orderby' ]);
2012-04-18 20:31:27 +00:00
$woocommerce -> clear_product_transients ();
2012-03-19 12:16:33 +00:00
2012-04-11 09:01:22 +00:00
// Redirect back
$redirect = add_query_arg ( 'saved' , 'true' );
2012-02-17 12:49:32 +00:00
2012-04-11 09:01:22 +00:00
if ( ! empty ( $_POST [ 'subtab' ] ) ) $redirect = add_query_arg ( 'subtab' , esc_attr ( str_replace ( '#' , '' , $_POST [ 'subtab' ] ) ), $redirect );
2012-02-17 21:25:06 +00:00
2012-04-11 09:01:22 +00:00
wp_redirect ( $redirect );
exit ;
2012-02-17 12:49:32 +00:00
}
2011-09-09 14:23:32 +00:00
2012-02-17 12:49:32 +00:00
// Settings saved message
2012-04-11 09:01:22 +00:00
if ( ! empty ( $_GET [ 'saved' ] ) ) {
2012-01-05 11:31:22 +00:00
echo '<div id="message" class="updated fade"><p><strong>' . __ ( 'Your settings have been saved.' , 'woocommerce' ) . '</strong></p></div>' ;
2012-02-17 12:49:32 +00:00
2011-09-05 08:28:17 +00:00
flush_rewrite_rules ( false );
2011-12-19 00:32:34 +00:00
do_action ( 'woocommerce_settings_saved' );
2012-02-17 12:49:32 +00:00
}
// Hide WC Link
if ( isset ( $_GET [ 'hide-wc-extensions-message' ]))
update_option ( 'hide-wc-extensions-message' , 1 );
2011-09-20 13:04:40 +00:00
2011-11-02 18:25:04 +00:00
// Install/page installer
$install_complete = false ;
2012-01-31 23:18:40 +00:00
2011-11-02 18:25:04 +00:00
// Add pages button
2012-02-17 12:49:32 +00:00
if ( isset ( $_GET [ 'install_woocommerce_pages' ]) && $_GET [ 'install_woocommerce_pages' ]) {
2012-02-15 17:31:44 +00:00
2011-12-19 03:17:02 +00:00
require_once ( 'woocommerce-admin-install.php' );
2011-11-02 18:25:04 +00:00
woocommerce_create_pages ();
update_option ( 'skip_install_woocommerce_pages' , 1 );
$install_complete = true ;
// Skip button
2012-02-17 12:49:32 +00:00
} elseif ( isset ( $_GET [ 'skip_install_woocommerce_pages' ]) && $_GET [ 'skip_install_woocommerce_pages' ]) {
2011-11-02 18:25:04 +00:00
update_option ( 'skip_install_woocommerce_pages' , 1 );
$install_complete = true ;
2012-02-17 12:49:32 +00:00
}
2012-02-15 17:31:44 +00:00
2012-02-17 12:49:32 +00:00
if ( $install_complete ) {
?>
2012-02-15 23:45:55 +00:00
< div id = " message " class = " updated woocommerce-message wc-connect " >
< div class = " squeezer " >
< h4 >< ? php _e ( '<strong>Congratulations!</strong> – WooCommerce has been installed and setup. Enjoy :)' , 'woocommerce' ); ?> </h4>
2012-02-16 15:53:15 +00:00
< p >< a href = " https://twitter.com/share " class = " twitter-share-button " data - url = " http://www.woothemes.com/woocommerce/ " data - text = " A open-source (free) #ecommerce plugin for #WordPress that helps you sell anything. Beautifully. " data - via = " WooThemes " data - size = " large " data - hashtags = " WooCommerce " > Tweet </ a >
2012-02-15 23:45:55 +00:00
< script >! function ( d , s , id ){ var js , fjs = d . getElementsByTagName ( s )[ 0 ]; if ( ! d . getElementById ( id )){ js = d . createElement ( s ); js . id = id ; js . src = " //platform.twitter.com/widgets.js " ; fjs . parentNode . insertBefore ( js , fjs );}}( document , " script " , " twitter-wjs " ); </ script ></ p >
</ div >
</ div >
< ? php
2011-11-02 18:25:04 +00:00
2012-02-17 12:49:32 +00:00
// Flush rules after install
flush_rewrite_rules ( false );
// Set installed option
update_option ( 'woocommerce_installed' , 0 );
}
2011-08-13 13:57:48 +00:00
?>
< div class = " wrap woocommerce " >
< form method = " post " id = " mainform " action = " " >
2012-04-10 17:13:31 +00:00
< div class = " icon32 icon32-woocommerce-settings " id = " icon-woocommerce " >< br /></ div >< h2 class = " nav-tab-wrapper woo-nav-tab-wrapper " >
2011-09-09 14:23:32 +00:00
< ? php
2011-09-15 16:37:38 +00:00
$tabs = array (
2012-01-05 11:31:22 +00:00
'general' => __ ( 'General' , 'woocommerce' ),
'catalog' => __ ( 'Catalog' , 'woocommerce' ),
2012-03-19 12:16:33 +00:00
'pages' => __ ( 'Pages' , 'woocommerce' ),
2012-01-05 11:31:22 +00:00
'inventory' => __ ( 'Inventory' , 'woocommerce' ),
'tax' => __ ( 'Tax' , 'woocommerce' ),
'shipping' => __ ( 'Shipping' , 'woocommerce' ),
'payment_gateways' => __ ( 'Payment Gateways' , 'woocommerce' ),
'email' => __ ( 'Emails' , 'woocommerce' ),
'integration' => __ ( 'Integration' , 'woocommerce' )
2011-09-15 16:37:38 +00:00
);
2011-11-13 13:13:49 +00:00
$tabs = apply_filters ( 'woocommerce_settings_tabs_array' , $tabs );
2012-04-11 09:01:22 +00:00
foreach ( $tabs as $name => $label ) {
2011-09-19 08:42:28 +00:00
echo '<a href="' . admin_url ( 'admin.php?page=woocommerce&tab=' . $name ) . '" class="nav-tab ' ;
2012-04-11 09:01:22 +00:00
if ( $current_tab == $name ) echo 'nav-tab-active' ;
2011-09-19 08:42:28 +00:00
echo '">' . $label . '</a>' ;
2012-04-11 09:01:22 +00:00
}
2011-10-05 15:25:12 +00:00
do_action ( 'woocommerce_settings_tabs' );
2011-09-09 14:23:32 +00:00
?>
</ h2 >
2011-09-19 08:42:28 +00:00
< ? php wp_nonce_field ( 'woocommerce-settings' , '_wpnonce' , true , true ); ?>
2012-01-18 12:26:31 +00:00
2012-01-31 23:18:40 +00:00
< ? php if ( ! get_option ( 'hide-wc-extensions-message' )) : ?>
2012-04-08 23:57:38 +00:00
< div id = " woocommerce_extensions " >< a href = " <?php echo add_query_arg('hide-wc-extensions-message', 'true') ?> " class = " hide " >& times ; </ a >< ? php printf ( __ ( 'More functionality and gateway options available via <a href="%s" target="_blank">WC official extensions</a>.' , 'woocommerce' ), 'http://www.woothemes.com/extensions/woocommerce-extensions/' ); ?> </div>
2012-01-31 23:18:40 +00:00
< ? php endif ; ?>
2012-01-18 12:26:31 +00:00
2011-09-15 16:37:38 +00:00
< ? php
switch ( $current_tab ) :
case " general " :
case " pages " :
case " catalog " :
case " inventory " :
case " tax " :
2011-10-25 12:54:16 +00:00
case " email " :
2011-12-19 18:05:42 +00:00
case " integration " :
2011-09-19 08:42:28 +00:00
woocommerce_admin_fields ( $woocommerce_settings [ $current_tab ] );
2011-09-15 16:37:38 +00:00
break ;
2011-12-19 14:05:32 +00:00
case " shipping " :
2011-09-15 16:37:38 +00:00
2012-04-11 09:01:22 +00:00
$current = ( empty ( $_GET [ 'section' ] ) ) ? 'class="current"' : '' ;
2012-04-16 09:13:13 +00:00
$links = array ( '<a href="' . admin_url ( 'admin.php?page=woocommerce&tab=shipping' ) . '" ' . $current . '>' . __ ( 'Shipping Options' , 'woocommerce' ) . '</a>' );
2011-12-19 14:05:32 +00:00
2012-04-11 09:01:22 +00:00
foreach ( $woocommerce -> shipping -> shipping_methods as $method ) {
2011-12-19 14:05:32 +00:00
$title = ( isset ( $method -> method_title ) && $method -> method_title ) ? ucwords ( $method -> method_title ) : ucwords ( $method -> id );
2012-04-11 09:01:22 +00:00
$current = ( ! empty ( $_GET [ 'section' ] ) && $method -> id == urldecode ( $_GET [ 'section' ] ) ) ? 'class="current"' : '' ;
2012-04-16 09:13:13 +00:00
$links [] = '<a href="' . add_query_arg ( 'section' , $method -> id , admin_url ( 'admin.php?page=woocommerce&tab=shipping' ) ) . '"' . $current . '>' . $title . '</a>' ;
2012-04-11 09:01:22 +00:00
}
2011-09-15 16:37:38 +00:00
2012-04-11 09:01:22 +00:00
echo '<ul class="subsubsub"><li>' . implode ( ' | </li><li>' , $links ) . '</li></ul><br class="clear" />' ;
2011-12-19 14:05:32 +00:00
// Gateway ordering
2012-04-11 09:01:22 +00:00
if ( empty ( $_GET [ 'section' ] ) ) {
2011-12-19 14:05:32 +00:00
2012-04-11 09:01:22 +00:00
woocommerce_admin_fields ( $woocommerce_settings [ $current_tab ] );
?>
< h3 >< ? php _e ( 'Shipping Methods' , 'woocommerce' ); ?> </h3>
< p >< ? php _e ( 'Your activated shipping methods are listed below. Drag and drop rows to re-order them for display on the frontend.' , 'woocommerce' ); ?> </p>
< table class = " wc_shipping widefat " cellspacing = " 0 " >
< thead >
< tr >
< th >< ? php _e ( 'Default' , 'woocommerce' ); ?> </th>
< th >< ? php _e ( 'Shipping Method' , 'woocommerce' ); ?> </th>
< th >< ? php _e ( 'Status' , 'woocommerce' ); ?> </th>
</ tr >
</ thead >
< tbody >
< ? php
foreach ( $woocommerce -> shipping -> shipping_methods as $method ) {
$default_shipping_method = get_option ( 'woocommerce_default_shipping_method' );
echo ' < tr >
< td width = " 1% " class = " radio " >
< input type = " radio " name = " default_shipping_method " value = " ' . $method->id . ' " ' . checked( $default_shipping_method, $method->id, false ) . ' />
< input type = " hidden " name = " method_order[] " value = " ' . $method->id . ' " />
< td >
< p >< strong > ' . $method->title . ' </ strong >< br />
< small > ' . __(' Method ID ', ' woocommerce ') . ' : ' . $method->id . ' </ small ></ p >
</ td >
< td > ' ;
if ( $method -> enabled == 'yes' )
echo '<img src="' . $woocommerce -> plugin_url () . '/assets/images/success.png" alt="yes" />' ;
else
echo '<img src="' . $woocommerce -> plugin_url () . '/assets/images/success-off.png" alt="no" />' ;
echo ' </ td >
</ tr > ' ;
}
?>
</ tbody >
</ table >
< ? php
} else {
2011-12-19 14:05:32 +00:00
2012-04-11 09:01:22 +00:00
// Specific method options
foreach ( $woocommerce -> shipping -> shipping_methods as $method ) {
if ( $method -> id == urldecode ( $_GET [ 'section' ] ) ) {
$method -> admin_options ();
break ;
}
}
2011-09-15 16:37:38 +00:00
2012-04-11 09:01:22 +00:00
}
2011-09-15 16:37:38 +00:00
break ;
case " payment_gateways " :
2012-01-05 11:31:22 +00:00
$links = array ( '<a href="#gateway-order">' . __ ( 'Payment Gateways' , 'woocommerce' ) . '</a>' );
2011-12-08 12:50:50 +00:00
2011-09-15 16:37:38 +00:00
foreach ( $woocommerce -> payment_gateways -> payment_gateways () as $gateway ) :
2011-09-16 11:15:49 +00:00
$title = ( isset ( $gateway -> method_title ) && $gateway -> method_title ) ? ucwords ( $gateway -> method_title ) : ucwords ( $gateway -> id );
2011-09-15 16:37:38 +00:00
$links [] = '<a href="#gateway-' . $gateway -> id . '">' . $title . '</a>' ;
endforeach ;
echo '<div class="subsubsub_section"><ul class="subsubsub"><li>' . implode ( ' | </li><li>' , $links ) . '</li></ul><br class="clear" />' ;
2011-12-06 16:45:08 +00:00
// Gateway ordering
echo '<div class="section" id="gateway-order">' ;
?>
2012-01-05 11:31:22 +00:00
< h3 >< ? php _e ( 'Payment Gateways' , 'woocommerce' ); ?> </h3>
< p >< ? php _e ( 'Your activated payment gateways are listed below. Drag and drop rows to re-order them for display on the checkout.' , 'woocommerce' ); ?> </p>
2011-12-06 16:45:08 +00:00
< table class = " wc_gateways widefat " cellspacing = " 0 " >
< thead >
< tr >
2012-01-05 11:31:22 +00:00
< th width = " 1% " >< ? php _e ( 'Default' , 'woocommerce' ); ?> </th>
< th >< ? php _e ( 'Gateway' , 'woocommerce' ); ?> </th>
< th >< ? php _e ( 'Status' , 'woocommerce' ); ?> </th>
2011-12-06 16:45:08 +00:00
</ tr >
</ thead >
< tbody >
< ? php
foreach ( $woocommerce -> payment_gateways -> payment_gateways () as $gateway ) :
$default_gateway = get_option ( 'woocommerce_default_gateway' );
echo ' < tr >
< td width = " 1% " class = " radio " >
< input type = " radio " name = " default_gateway " value = " '. $gateway->id .' " '.checked($default_gateway, $gateway->id, false).' />
< input type = " hidden " name = " gateway_order[] " value = " '. $gateway->id .' " />
</ td >
< td >
< p >< strong > '.$gateway->title.' </ strong >< br />
2012-01-05 11:31:22 +00:00
< small > '.__(' Gateway ID ', ' woocommerce ').' : '.$gateway->id.' </ small ></ p >
2011-12-06 16:45:08 +00:00
</ td >
< td > ' ;
if ( $gateway -> enabled == 'yes' )
2012-01-28 15:04:53 +00:00
echo '<img src="' . $woocommerce -> plugin_url () . '/assets/images/success.png" alt="yes" />' ;
2011-12-06 16:45:08 +00:00
else
2012-01-28 15:04:53 +00:00
echo '<img src="' . $woocommerce -> plugin_url () . '/assets/images/success-off.png" alt="no" />' ;
2011-12-06 16:45:08 +00:00
echo ' </ td >
</ tr > ' ;
endforeach ;
?>
</ tbody >
</ table >
< ? php
echo '</div>' ;
// Specific gateway options
2011-09-19 08:42:28 +00:00
foreach ( $woocommerce -> payment_gateways -> payment_gateways () as $gateway ) :
2011-09-15 16:37:38 +00:00
echo '<div class="section" id="gateway-' . $gateway -> id . '">' ;
$gateway -> admin_options ();
echo '</div>' ;
endforeach ;
echo '</div>' ;
break ;
default :
do_action ( 'woocommerce_settings_tabs_' . $current_tab );
break ;
endswitch ;
?>
2011-11-24 15:52:32 +00:00
< p class = " submit " >
2012-01-05 11:31:22 +00:00
< input name = " save " class = " button-primary " type = " submit " value = " <?php _e( 'Save changes', 'woocommerce' ); ?> " />
2011-11-24 15:52:32 +00:00
< input type = " hidden " name = " subtab " id = " last_tab " />
</ p >
2011-08-13 13:57:48 +00:00
</ form >
2011-09-15 16:37:38 +00:00
< script type = " text/javascript " >
2011-12-06 16:45:08 +00:00
jQuery ( window ) . load ( function (){
2011-10-25 12:54:16 +00:00
2011-12-06 16:45:08 +00:00
// Subsubsub tabs
2012-04-11 09:01:22 +00:00
jQuery ( 'div.subsubsub_section ul.subsubsub li a:eq(0)' ) . addClass ( 'current' );
jQuery ( 'div.subsubsub_section .section:gt(0)' ) . hide ();
2011-09-15 16:37:38 +00:00
2012-04-11 09:01:22 +00:00
jQuery ( 'div.subsubsub_section ul.subsubsub li a' ) . click ( function (){
2011-12-06 16:45:08 +00:00
jQuery ( 'a' , jQuery ( this ) . closest ( 'ul.subsubsub' )) . removeClass ( 'current' );
jQuery ( this ) . addClass ( 'current' );
jQuery ( '.section' , jQuery ( this ) . closest ( '.subsubsub_section' )) . hide ();
jQuery ( jQuery ( this ) . attr ( 'href' ) ) . show ();
jQuery ( '#last_tab' ) . val ( jQuery ( this ) . attr ( 'href' ) );
return false ;
2011-09-15 16:37:38 +00:00
});
2012-04-11 09:01:22 +00:00
< ? php if ( isset ( $_GET [ 'subtab' ]) && $_GET [ 'subtab' ]) echo 'jQuery("div.subsubsub_section ul.subsubsub li a[href=#' . $_GET [ 'subtab' ] . ']").click();' ; ?>
2011-12-06 16:45:08 +00:00
// Countries
jQuery ( 'select#woocommerce_allowed_countries' ) . change ( function (){
if ( jQuery ( this ) . val () == " specific " ) {
jQuery ( this ) . parent () . parent () . next ( 'tr' ) . show ();
2011-09-15 16:37:38 +00:00
} else {
2011-12-06 16:45:08 +00:00
jQuery ( this ) . parent () . parent () . next ( 'tr' ) . hide ();
}
}) . change ();
// Color picker
jQuery ( '.colorpick' ) . each ( function (){
jQuery ( '.colorpickdiv' , jQuery ( this ) . parent ()) . farbtastic ( this );
jQuery ( this ) . click ( function () {
if ( jQuery ( this ) . val () == " " ) jQuery ( this ) . val ( '#' );
jQuery ( '.colorpickdiv' , jQuery ( this ) . parent () ) . show ();
});
});
jQuery ( document ) . mousedown ( function (){
jQuery ( '.colorpickdiv' ) . hide ();
});
// Edit prompt
jQuery ( function (){
var changed = false ;
jQuery ( 'input, textarea, select, checkbox' ) . change ( function (){
changed = true ;
});
jQuery ( '.woo-nav-tab-wrapper a' ) . click ( function (){
if ( changed ) {
window . onbeforeunload = function () {
2012-01-05 11:31:22 +00:00
return '<?php echo __( ' The changes you made will be lost if you navigate away from this page . ', ' woocommerce ' ); ?>' ;
2011-12-06 16:45:08 +00:00
}
} else {
window . onbeforeunload = '' ;
}
});
jQuery ( '.submit input' ) . click ( function (){
2011-09-15 16:37:38 +00:00
window . onbeforeunload = '' ;
2011-12-06 16:45:08 +00:00
});
});
// Sorting
2011-12-19 14:05:32 +00:00
jQuery ( 'table.wc_gateways tbody, table.wc_shipping tbody' ) . sortable ({
2011-12-06 16:45:08 +00:00
items : 'tr' ,
cursor : 'move' ,
axis : 'y' ,
handle : 'td' ,
scrollSensitivity : 40 ,
helper : function ( e , ui ){
ui . children () . each ( function (){
jQuery ( this ) . width ( jQuery ( this ) . width ());
});
ui . css ( 'left' , '0' );
return ui ;
},
start : function ( event , ui ){
ui . item . css ( 'background-color' , '#f6f6f6' );
},
stop : function ( event , ui ){
ui . item . removeAttr ( 'style' );
2011-09-15 16:37:38 +00:00
}
});
2011-12-06 16:45:08 +00:00
// Chosen selects
jQuery ( " select.chosen_select " ) . chosen ();
jQuery ( " select.chosen_select_nostd " ) . chosen ({
allow_single_deselect : 'true'
2011-09-15 16:37:38 +00:00
});
2011-12-06 16:45:08 +00:00
2011-11-23 12:02:36 +00:00
});
2011-09-15 16:37:38 +00:00
</ script >
2011-08-13 13:57:48 +00:00
</ div >
< ? php
2011-09-19 09:49:52 +00:00
}
2011-08-15 16:48:24 +00:00
}