WooCommerce Code Reference

WC_Admin_Setup_Wizard
in package

WC_Admin_Setup_Wizard class.

Table of Contents

$deferred_actions  : array<string|int, mixed>
Actions to be executed after the HTTP response has completed
$step  : string
Current step
$steps  : array<string|int, mixed>
Steps for the setup wizard
$tweets  : array<string|int, mixed>
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()  : void
Hook in tabs.
admin_menus()  : void
Add admin menus/screens.
display_service_item()  : void
Display service item in list.
enqueue_scripts()  : void
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<string|int, mixed>
Simple array of "in cart" gateways to show in wizard.
get_wizard_manual_payment_gateways()  : array<string|int, mixed>
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()  : void
Plugin install info message markup with heading.
run_deferred_actions()  : void
Function called after the HTTP request is finished, so it's executed without the client having to wait for it.
setup_wizard()  : void
Show the setup wizard.
setup_wizard_content()  : void
Output the content for the current step.
setup_wizard_footer()  : void
Setup Wizard Footer.
setup_wizard_header()  : void
Setup Wizard Header.
setup_wizard_steps()  : void
Output the steps.
tracking_modal()  : void
Template for the usage tracking modal.
wc_setup_activate()  : void
Activate step.
wc_setup_activate_save()  : void
Activate step save.
wc_setup_new_onboarding()  : void
Display's a prompt for users to try out the new improved WooCommerce onboarding experience in WooCommerce Admin.
wc_setup_new_onboarding_save()  : void
Installs WooCommerce admin and redirects to the new onboarding experience.
wc_setup_payment()  : void
Payment Step.
wc_setup_payment_save()  : void
Payment Step save.
wc_setup_ready()  : void
Final step.
wc_setup_recommended()  : void
Recommended step
wc_setup_recommended_save()  : void
Recommended step save.
wc_setup_shipping()  : void
Shipping.
wc_setup_shipping_save()  : void
Save shipping options.
wc_setup_store_setup()  : void
Initial "store setup" step.
wc_setup_store_setup_save()  : void
Save initial store settings.
close_http_connection()  : void
Finishes replying to the client, but keeps the process running for further (async) code execution.
display_recommended_item()  : void
Display recommended item.
get_activate_error_message()  : string
Get activate error message.
get_all_activate_errors()  : array<string|int, mixed>
Get all activate errors.
get_current_user_email()  : string
Helper method to retrieve the current user's email address.
get_product_dimension_selection()  : string|false
Render a product dimension unit dropdown.
get_product_weight_selection()  : string|false
Render a product weight unit dropdown.
get_wcs_requisite_plugins()  : array<string|int, mixed>
Retrieve info for missing WooCommerce Services and/or Jetpack plugin.
get_wizard_available_in_cart_payment_gateways()  : array<string|int, mixed>
Array of all possible "in cart" gateways that can be offered.
get_wizard_shipping_methods()  : array<string|int, mixed>
Get shipping methods based on country code.
install_jetpack()  : void
Helper method to install Jetpack.
install_plugin()  : void
Helper method to queue the background install of a plugin.
install_theme()  : void
Helper method to queue the background install of a theme.
install_woocommerce_services()  : void
Helper method to install WooCommerce Services and its Jetpack dependency.
is_eway_payments_supported_country()  : bool
Is eWAY Payments country supported
is_klarna_checkout_supported_country()  : bool
Is Klarna Checkout country supported.
is_klarna_payments_supported_country()  : bool
Is Klarna Payments country supported.
is_paypal_supported_currency()  : bool
Is PayPal currency supported.
is_shipstation_supported_country()  : bool
Is ShipStation country supported
is_square_supported_country()  : bool
Is Square country supported
is_stripe_supported_country()  : bool
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()  : bool
Is WooCommerce Services shipping label country supported
shipping_method_selection_form()  : void
Render the available shipping methods for a given country code.
should_show_automated_tax()  : bool
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()  : void
Go to the next step if Jetpack was connected.
wc_setup_activate_get_feature_list()  : array<string|int, mixed>
Get feature list for activation.
wc_setup_activate_get_feature_list_str()  : string|false
Get feature list string for activation.

Properties

$tweets

Tweets user can optionally send after install

private array<string|int, mixed> $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<string|int, mixed> $item_info) : void
Parameters
$item_id : int

Item ID.

$item_info : array<string|int, mixed>

Item info array.

Tags
deprecated
4.6.0
Return values
void

enqueue_scripts()

Register/enqueue scripts and styles for the Setup Wizard.

public enqueue_scripts() : void

Hooked onto 'admin_enqueue_scripts'.

Tags
deprecated
4.6.0
Return values
void

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
deprecated
4.6.0
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.

get_wizard_in_cart_payment_gateways()

Simple array of "in cart" gateways to show in wizard.

public get_wizard_in_cart_payment_gateways() : array<string|int, mixed>
Tags
deprecated
4.6.0
Return values
array<string|int, mixed>

get_wizard_manual_payment_gateways()

Simple array of "manual" gateways to show in wizard.

public get_wizard_manual_payment_gateways() : array<string|int, mixed>
Tags
deprecated
4.6.0
Return values
array<string|int, mixed>

Is it a featured service?

public is_featured_service(array<string|int, mixed> $service) : bool
Parameters
$service : array<string|int, mixed>

Service info array.

Tags
deprecated
4.6.0
Return values
bool

Is this a non featured service?

public is_not_featured_service(array<string|int, mixed> $service) : bool
Parameters
$service : array<string|int, mixed>

Service info array.

Tags
deprecated
4.6.0
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() : void
Tags
see
WC_Admin_Setup_Wizard::install_plugin
see
WC_Admin_Setup_Wizard::install_theme
deprecated
4.6.0
Return values
void

wc_setup_activate_save()

Activate step save.

public wc_setup_activate_save() : void

Install, activate, and launch connection flow for Jetpack.

Tags
deprecated
4.6.0
Return values
void

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() : void
Tags
deprecated
4.6.0
Return values
void

wc_setup_new_onboarding_save()

Installs WooCommerce admin and redirects to the new onboarding experience.

public wc_setup_new_onboarding_save() : void
Tags
deprecated
4.6.0
Return values
void

Display recommended item.

protected display_recommended_item(array<string|int, mixed> $item_info) : void
Parameters
$item_info : array<string|int, mixed>

Item info array.

Tags
deprecated
4.6.0
Return values
void

get_activate_error_message()

Get activate error message.

protected get_activate_error_message([string $code = '' ]) : string
Parameters
$code : string = ''

Error code.

Tags
deprecated
4.6.0
Return values
string

get_all_activate_errors()

Get all activate errors.

protected get_all_activate_errors() : array<string|int, mixed>
Tags
deprecated
4.6.0
Return values
array<string|int, mixed>

get_current_user_email()

Helper method to retrieve the current user's email address.

protected get_current_user_email() : string
Tags
deprecated
4.6.0
Return values
stringEmail address

get_product_dimension_selection()

Render a product dimension unit dropdown.

protected get_product_dimension_selection() : string|false
Tags
deprecated
4.6.0
Return values
string|false

get_product_weight_selection()

Render a product weight unit dropdown.

protected get_product_weight_selection() : string|false
Tags
deprecated
4.6.0
Return values
string|false

get_wcs_requisite_plugins()

Retrieve info for missing WooCommerce Services and/or Jetpack plugin.

protected get_wcs_requisite_plugins() : array<string|int, mixed>
Tags
deprecated
4.6.0
Return values
array<string|int, 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<string|int, mixed>
Tags
deprecated
4.6.0
Return values
array<string|int, mixed>

get_wizard_shipping_methods()

Get shipping methods based on country code.

protected get_wizard_shipping_methods(string $country_code, string $currency_code) : array<string|int, mixed>
Parameters
$country_code : string

Country code.

$currency_code : string

Currency code.

Tags
deprecated
4.6.0
Return values
array<string|int, mixed>

install_plugin()

Helper method to queue the background install of a plugin.

protected install_plugin(string $plugin_id, array<string|int, mixed> $plugin_info) : void
Parameters
$plugin_id : string

Plugin id used for background install.

$plugin_info : array<string|int, mixed>

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

Tags
deprecated
4.6.0
Return values
void

install_theme()

Helper method to queue the background install of a theme.

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

Theme id used for background install.

Tags
deprecated
4.6.0
Return values
void

install_woocommerce_services()

Helper method to install WooCommerce Services and its Jetpack dependency.

protected install_woocommerce_services() : void
Tags
deprecated
4.6.0
Return values
void

is_eway_payments_supported_country()

Is eWAY Payments country supported

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

Country code.

Tags
deprecated
4.6.0
Return values
bool

is_klarna_checkout_supported_country()

Is Klarna Checkout country supported.

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

Country code.

Tags
deprecated
4.6.0
Return values
bool

is_klarna_payments_supported_country()

Is Klarna Payments country supported.

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

Country code.

Tags
deprecated
4.6.0
Return values
bool

is_paypal_supported_currency()

Is PayPal currency supported.

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

Currency code.

Tags
deprecated
4.6.0
Return values
bool

is_shipstation_supported_country()

Is ShipStation country supported

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

Country code.

Tags
deprecated
4.6.0
Return values
bool

is_square_supported_country()

Is Square country supported

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

Country code.

Tags
deprecated
4.6.0
Return values
bool

is_stripe_supported_country()

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

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

Country code.

Tags
deprecated
4.6.0
Return values
bool

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
Tags
deprecated
4.6.0
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) : bool
Parameters
$country_code : string

Country code.

Tags
deprecated
4.6.0
Return values
bool

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) : void
Parameters
$country_code : string

Country code.

$currency_code : string

Currency code.

$input_prefix : string

Input prefix.

Tags
deprecated
4.6.0
Return values
void

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() : bool
Tags
deprecated
4.6.0
Return values
bool

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
Tags
deprecated
4.6.0
Return values
bool

should_show_mailchimp()

Should we show the MailChimp install option? True only if the user can install plugins.

protected should_show_mailchimp() : bool
Tags
deprecated
4.6.0
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
Tags
deprecated
4.6.0
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
Tags
deprecated
4.6.0
Return values
bool

should_show_wc_admin_onboarding()

Should we show the new WooCommerce Admin onboarding experience?

protected should_show_wc_admin_onboarding() : bool
Tags
deprecated
4.6.0
Return values
bool

wc_setup_activate_get_feature_list()

Get feature list for activation.

protected wc_setup_activate_get_feature_list() : array<string|int, mixed>
Tags
deprecated
4.6.0
Return values
array<string|int, mixed>

wc_setup_activate_get_feature_list_str()

Get feature list string for activation.

protected wc_setup_activate_get_feature_list_str() : string|false
Tags
deprecated
4.6.0
Return values
string|false