$primary, 'secondary' => $secondary, 'highlight' => $highlight, 'content_bg' => $content_bg, 'subtext' => $subtext ); $old_colors = get_option( 'woocommerce_frontend_css_colors' ); update_option( 'woocommerce_frontend_css_colors', $colors ); if ( $old_colors != $colors ) woocommerce_compile_less_styles(); } } else { // If saving a shipping methods options, load 'er up if ( $current_tab == 'shipping' && class_exists( $current_section ) ) { $current_section_class = new $current_section(); do_action( 'woocommerce_update_options_' . $current_tab . '_' . $current_section_class->id ); // If saving an email's options, load theme } elseif ( $current_tab == 'email' ) { // Load mailer $mailer = $woocommerce->mailer(); if ( class_exists( $current_section ) ) { $current_section_class = new $current_section(); do_action( 'woocommerce_update_options_' . $current_tab . '_' . $current_section_class->id ); } else { do_action( 'woocommerce_update_options_' . $current_tab . '_' . $current_section ); } } else { // Save section only do_action( 'woocommerce_update_options_' . $current_tab . '_' . $current_section ); } } // Clear any unwanted data $woocommerce->clear_product_transients(); // Redirect back to the settings page $redirect = add_query_arg( 'saved', 'true' ); if ( ! empty( $_POST['subtab'] ) ) $redirect = add_query_arg( 'subtab', esc_attr( str_replace( '#', '', $_POST['subtab'] ) ), $redirect ); wp_safe_redirect( $redirect ); exit; } // Get any returned messages $error = ( empty( $_GET['wc_error'] ) ) ? '' : urldecode( stripslashes( $_GET['wc_error'] ) ); $message = ( empty( $_GET['wc_message'] ) ) ? '' : urldecode( stripslashes( $_GET['wc_message'] ) ); if ( $error || $message ) { if ( $error ) { echo '

' . esc_html( $error ) . '

'; } else { echo '

' . esc_html( $message ) . '

'; } } elseif ( ! empty( $_GET['saved'] ) ) { echo '

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

'; } // Were the settings saved? if ( ! empty( $_GET['saved'] ) ) { do_action('woocommerce_settings_saved'); } // Hide WC Link if (isset($_GET['hide-wc-extensions-message'])) update_option('hide-wc-extensions-message', 1); // Install/page installer $install_complete = false; // Add pages button if (isset($_GET['install_woocommerce_pages']) && $_GET['install_woocommerce_pages']) { require_once( 'woocommerce-admin-install.php' ); woocommerce_create_pages(); update_option('skip_install_woocommerce_pages', 1); $install_complete = true; // Skip button } elseif (isset($_GET['skip_install_woocommerce_pages']) && $_GET['skip_install_woocommerce_pages']) { update_option('skip_install_woocommerce_pages', 1); $install_complete = true; } if ($install_complete) { ?>

Congratulations! – WooCommerce has been installed and setup. Enjoy :)', 'woocommerce' ); ?>


×WC official extensions.', 'woocommerce' ), 'http://www.woothemes.com/extensions/woocommerce-extensions/'); ?>
' . __( 'Email Options', 'woocommerce' ) . '' ); // Define emails that can be customised here $mailer = $woocommerce->mailer(); $email_templates = $mailer->get_emails(); foreach ( $email_templates as $email ) { $title = empty( $email->title ) ? ucwords( $email->id ) : ucwords( $email->title ); $current = ( get_class( $email ) == $current_section ) ? 'class="current"' : ''; $links[] = '' . esc_html( $title ) . ''; } echo '
'; // Specific email options if ( $current_section ) { foreach ( $email_templates as $email ) { if ( get_class( $email ) == $current_section ) { $email->admin_options(); break; } } } else { woocommerce_admin_fields( $woocommerce_settings[ $current_tab ] ); } break; case "shipping" : include('settings/settings-shipping-methods.php'); $current = $current_section ? '' : 'class="current"'; $links = array( '' . __( 'Shipping Options', 'woocommerce' ) . '' ); // Load shipping methods so we can show any global options they may have $shipping_methods = $woocommerce->shipping->load_shipping_methods(); foreach ( $shipping_methods as $method ) { if ( ! $method->has_settings() ) continue; $title = empty( $method->method_title ) ? ucwords( $method->id ) : ucwords( $method->method_title ); $current = ( get_class( $method ) == $current_section ) ? 'class="current"' : ''; $links[] = '' . esc_html( $title ) . ''; } echo '
'; // Specific method options if ( $current_section ) { foreach ( $shipping_methods as $method ) { if ( get_class( $method ) == $current_section && $method->has_settings() ) { $method->admin_options(); break; } } } else { woocommerce_admin_fields( $woocommerce_settings[$current_tab] ); } break; case "payment_gateways" : include('settings/settings-payment-gateways.php'); $links = array( ''.__( 'Payment Gateways', 'woocommerce' ).'' ); foreach ( $woocommerce->payment_gateways->payment_gateways() as $gateway ) : $title = empty( $gateway->method_title ) ? ucwords( $gateway->id ) : ucwords( $gateway->method_title ); $links[] = '' . esc_html( $title ) . ''; endforeach; echo '
  • ' . implode( ' |
  • ', $links ) . '

'; echo '
'; woocommerce_admin_fields( $woocommerce_settings[$current_tab] ); echo '
'; // Specific method options foreach ( $woocommerce->payment_gateways->payment_gateways() as $gateway ) { echo '
'; $gateway->admin_options(); echo '
'; } echo '
'; break; case "integration" : $integrations = $woocommerce->integrations->get_integrations(); $current_section = empty( $current_section ) ? key( $integrations ) : $current_section; foreach ( $integrations as $integration ) { $title = empty( $integration->method_title ) ? ucwords( $integration->id ) : ucwords( $integration->method_title ); $current = ( $integration->id == $current_section ) ? 'class="current"' : ''; $links[] = '' . esc_html( $title ) . ''; } echo '
'; if ( isset( $integrations[ $current_section ] ) ) $integrations[ $current_section ]->admin_options(); break; default : do_action( 'woocommerce_settings_tabs_' . $current_tab ); break; endswitch; ?>

plugin_url() . '/assets/images/help.png" />'; } elseif ( $value['desc_tip'] ) { $description = ''; } else { $description = '' . wp_kses_post( $value['desc'] ) . ''; } switch( $value['type'] ) { case 'title': if ( isset($value['name'] ) && $value['name'] ) echo '

' . esc_html( $value['name'] ) . '

'; if ( isset($value['desc'] ) && $value['desc'] ) echo wpautop( wptexturize( wp_kses_post( $value['desc'] ) ) ); echo ''. "\n\n"; if ( isset($value['id'] ) && $value['id'] ) do_action( 'woocommerce_settings_' . sanitize_title($value['id'] ) ); break; case 'sectionend': if ( isset($value['id'] ) && $value['id'] ) do_action( 'woocommerce_settings_' . sanitize_title( $value['id'] ) . '_end' ); echo '
'; if ( isset($value['id'] ) && $value['id'] ) do_action( 'woocommerce_settings_' . sanitize_title( $value['id'] ) . '_after' ); break; case 'text': ?>

' . wp_kses_post( $value['desc'] ) . '

'; ?> $value['id'], 'id' => $value['id'], 'sort_column' => 'menu_order', 'sort_order' => 'ASC', 'show_option_none' => ' ', 'class' => $value['class'], 'echo' => false, 'selected' => $page_setting); if( isset($value['args']) ) $args = wp_parse_args($value['args'], $args); ?> countries->countries; $country_setting = (string) get_option($value['id']); if (strstr($country_setting, ':')) : $country = current(explode(':', $country_setting)); $state = end(explode(':', $country_setting)); else : $country = $country_setting; $state = '*'; endif; ?> countries->countries; asort($countries); $selections = (array) get_option($value['id']); ?>