WooCommerce Code Reference

WC_Admin_Setup_Wizard
in package

WC_Admin_Setup_Wizard class.

Table of Contents

$deferred_actions  : array
Actions to be executed after the HTTP response has completed
$step  : string
Current step
$steps  : array
Steps for the setup wizard
$tweets  : array
Tweets user can optionally send after install
$wc_admin_plugin_minimum_wordpress_version  : string
The version of WordPress required to run the WooCommerce Admin plugin
__construct()  : mixed
Hook in tabs.
admin_menus()  : mixed
Add admin menus/screens.
display_service_item()  : mixed
Display service item in list.
enqueue_scripts()  : mixed
Register/enqueue scripts and styles for the Setup Wizard.
get_next_step_link()  : string
Get the URL for the next step's screen.
get_wizard_in_cart_payment_gateways()  : array
Simple array of "in cart" gateways to show in wizard.
get_wizard_manual_payment_gateways()  : array
Simple array of "manual" gateways to show in wizard.
is_featured_service()  : bool
Is it a featured service?
is_not_featured_service()  : bool
Is this a non featured service?
plugin_install_info()  : mixed
Plugin install info message markup with heading.
run_deferred_actions()  : mixed
Function called after the HTTP request is finished, so it's executed without the client having to wait for it.
setup_wizard()  : mixed
Show the setup wizard.
setup_wizard_content()  : mixed
Output the content for the current step.
setup_wizard_footer()  : mixed
Setup Wizard Footer.
setup_wizard_header()  : mixed
Setup Wizard Header.
setup_wizard_steps()  : mixed
Output the steps.
tracking_modal()  : mixed
Template for the usage tracking modal.
wc_setup_activate()  : mixed
Activate step.
wc_setup_activate_save()  : mixed
Activate step save.
wc_setup_new_onboarding()  : mixed
Display's a prompt for users to try out the new improved WooCommerce onboarding experience in WooCommerce Admin.
wc_setup_new_onboarding_save()  : mixed
Installs WooCommerce admin and redirects to the new onboarding experience.
wc_setup_payment()  : mixed
Payment Step.
wc_setup_payment_save()  : mixed
Payment Step save.
wc_setup_ready()  : mixed
Final step.
wc_setup_recommended()  : mixed
Recommended step
wc_setup_recommended_save()  : mixed
Recommended step save.
wc_setup_shipping()  : mixed
Shipping.
wc_setup_shipping_save()  : mixed
Save shipping options.
wc_setup_store_setup()  : mixed
Initial "store setup" step.
wc_setup_store_setup_save()  : mixed
Save initial store settings.
close_http_connection()  : mixed
Finishes replying to the client, but keeps the process running for further (async) code execution.
display_recommended_item()  : mixed
get_activate_error_message()  : mixed
get_all_activate_errors()  : mixed
get_current_user_email()  : string
Helper method to retrieve the current user's email address.
get_product_dimension_selection()  : string
Render a product dimension unit dropdown.
get_product_weight_selection()  : string
Render a product weight unit dropdown.
get_wcs_requisite_plugins()  : array
Retrieve info for missing WooCommerce Services and/or Jetpack plugin.
get_wizard_available_in_cart_payment_gateways()  : array
Array of all possible "in cart" gateways that can be offered.
get_wizard_shipping_methods()  : array
Get shipping methods based on country code.
install_jetpack()  : mixed
Helper method to install Jetpack.
install_plugin()  : mixed
Helper method to queue the background install of a plugin.
install_theme()  : mixed
Helper method to queue the background install of a theme.
install_woocommerce_services()  : mixed
Helper method to install WooCommerce Services and its Jetpack dependency.
is_eway_payments_supported_country()  : mixed
Is eWAY Payments country supported
is_klarna_checkout_supported_country()  : mixed
Is Klarna Checkout country supported.
is_klarna_payments_supported_country()  : mixed
Is Klarna Payments country supported.
is_paypal_supported_currency()  : bool
Is PayPal currency supported.
is_shipstation_supported_country()  : mixed
Is ShipStation country supported
is_square_supported_country()  : mixed
Is Square country supported
is_stripe_supported_country()  : mixed
Is Stripe country supported https://stripe.com/global .
is_wc_admin_active()  : bool
Is the WooCommerce Admin actively included in the WooCommerce core? Based on presence of a basic WC Admin function.
is_wcs_shipping_labels_supported_country()  : mixed
Is WooCommerce Services shipping label country supported
shipping_method_selection_form()  : mixed
Render the available shipping methods for a given country code.
should_show_automated_tax()  : mixed
The "automated tax" extra should only be shown if the current user can install plugins and the store is in a supported country.
should_show_facebook()  : bool
Should we show the Facebook install option? True only if the user can install plugins, and up until the end date of the recommendation.
should_show_mailchimp()  : bool
Should we show the MailChimp install option? True only if the user can install plugins.
should_show_recommended_step()  : bool
Should we display the 'Recommended' step? True if at least one of the recommendations will be displayed.
should_show_theme()  : bool
The theme "extra" should only be shown if the current user can modify themes and the store doesn't already have a WooCommerce theme.
should_show_wc_admin()  : bool
Should we show the WooCommerce Admin install option? True only if the user can install plugins, and is running the correct version of WordPress.
should_show_wc_admin_onboarding()  : bool
Should we show the new WooCommerce Admin onboarding experience?
wc_setup_activate_actions()  : mixed
Go to the next step if Jetpack was connected.
wc_setup_activate_get_feature_list()  : mixed
wc_setup_activate_get_feature_list_str()  : mixed
get_postcodes()  : array
Helper method to get postcode configurations from `WC()->countries->get_country_locale()`.
wc_setup_redirect_to_wc_admin_onboarding()  : mixed
Redirects to the onboarding wizard in WooCommerce Admin.

Properties

$tweets

Tweets user can optionally send after install

private array $tweets = array('Someone give me woo-t, I just set up a new store with #WordPress and @WooCommerce!', 'Someone give me high five, I just set up a new store with #WordPress and @WooCommerce!')

$wc_admin_plugin_minimum_wordpress_version

The version of WordPress required to run the WooCommerce Admin plugin

private string $wc_admin_plugin_minimum_wordpress_version = '5.3'

Methods

display_service_item()

Display service item in list.

public display_service_item(int $item_id, array $item_info) : mixed
Parameters
$item_id : int

Item ID.

$item_info : array

Item info array.

Return values
mixed

Get the URL for the next step's screen.

public get_next_step_link([string $step = '' ]) : string
Parameters
$step : string = ''

slug (default: current step).

Tags
since
3.0.0
Return values
stringURL for next step if a next step exists. Admin URL if it's the last step. Empty string on failure.

Is this a non featured service?

public is_not_featured_service(array $service) : bool
Parameters
$service : array

Service info array.

Return values
bool

run_deferred_actions()

Function called after the HTTP request is finished, so it's executed without the client having to wait for it.

public run_deferred_actions() : mixed
Tags
see
WC_Admin_Setup_Wizard::install_plugin
see
WC_Admin_Setup_Wizard::install_theme
Return values
mixed

wc_setup_new_onboarding()

Display's a prompt for users to try out the new improved WooCommerce onboarding experience in WooCommerce Admin.

public wc_setup_new_onboarding() : mixed
Return values
mixed

get_wizard_available_in_cart_payment_gateways()

Array of all possible "in cart" gateways that can be offered.

protected get_wizard_available_in_cart_payment_gateways() : array
Return values
array

get_wizard_shipping_methods()

Get shipping methods based on country code.

protected get_wizard_shipping_methods(string $country_code, string $currency_code) : array
Parameters
$country_code : string

Country code.

$currency_code : string

Currency code.

Return values
array

install_plugin()

Helper method to queue the background install of a plugin.

protected install_plugin(string $plugin_id, array $plugin_info) : mixed
Parameters
$plugin_id : string

Plugin id used for background install.

$plugin_info : array

Plugin info array containing name and repo-slug, and optionally file if different from [repo-slug].php.

Return values
mixed

install_theme()

Helper method to queue the background install of a theme.

protected install_theme(string $theme_id) : mixed
Parameters
$theme_id : string

Theme id used for background install.

Return values
mixed

is_eway_payments_supported_country()

Is eWAY Payments country supported

protected is_eway_payments_supported_country(string $country_code) : mixed
Parameters
$country_code : string

Country code.

Return values
mixed

is_klarna_checkout_supported_country()

Is Klarna Checkout country supported.

protected is_klarna_checkout_supported_country(string $country_code) : mixed
Parameters
$country_code : string

Country code.

Return values
mixed

is_klarna_payments_supported_country()

Is Klarna Payments country supported.

protected is_klarna_payments_supported_country(string $country_code) : mixed
Parameters
$country_code : string

Country code.

Return values
mixed

is_paypal_supported_currency()

Is PayPal currency supported.

protected is_paypal_supported_currency(string $currency) : bool
Parameters
$currency : string

Currency code.

Return values
bool

is_shipstation_supported_country()

Is ShipStation country supported

protected is_shipstation_supported_country(string $country_code) : mixed
Parameters
$country_code : string

Country code.

Return values
mixed

is_square_supported_country()

Is Square country supported

protected is_square_supported_country(string $country_code) : mixed
Parameters
$country_code : string

Country code.

Return values
mixed

is_stripe_supported_country()

Is Stripe country supported https://stripe.com/global .

protected is_stripe_supported_country(string $country_code) : mixed
Parameters
$country_code : string

Country code.

Return values
mixed

is_wc_admin_active()

Is the WooCommerce Admin actively included in the WooCommerce core? Based on presence of a basic WC Admin function.

protected is_wc_admin_active() : bool
Return values
bool

is_wcs_shipping_labels_supported_country()

Is WooCommerce Services shipping label country supported

protected is_wcs_shipping_labels_supported_country(string $country_code) : mixed
Parameters
$country_code : string

Country code.

Return values
mixed

shipping_method_selection_form()

Render the available shipping methods for a given country code.

protected shipping_method_selection_form(string $country_code, string $currency_code, string $input_prefix) : mixed
Parameters
$country_code : string

Country code.

$currency_code : string

Currency code.

$input_prefix : string

Input prefix.

Return values
mixed

should_show_automated_tax()

The "automated tax" extra should only be shown if the current user can install plugins and the store is in a supported country.

protected should_show_automated_tax() : mixed
Return values
mixed

should_show_facebook()

Should we show the Facebook install option? True only if the user can install plugins, and up until the end date of the recommendation.

protected should_show_facebook() : bool
Return values
bool

Should we display the 'Recommended' step? True if at least one of the recommendations will be displayed.

protected should_show_recommended_step() : bool
Return values
bool

should_show_theme()

The theme "extra" should only be shown if the current user can modify themes and the store doesn't already have a WooCommerce theme.

protected should_show_theme() : bool
Return values
bool

get_postcodes()

Helper method to get postcode configurations from `WC()->countries->get_country_locale()`.

private get_postcodes() : array

We don't use wp_list_pluck because it will throw notices when postcode configuration is not defined for a country.

Return values
array

wc_setup_redirect_to_wc_admin_onboarding()

Redirects to the onboarding wizard in WooCommerce Admin.

private wc_setup_redirect_to_wc_admin_onboarding() : mixed
Return values
mixed