1

I have a bash (.sh) script that I use to install WordPress and install/activate various plugins through WP-CLI commands. Now I want to extend that by installing/activating WooCommerce and setting various wp_options through wp option set command.

I want to enter basic stuff (address etc) that is asked in the WooCommerce onboarding setup steps, but in bash. I don't want to deal with the actual onboarding steps in wp-admin.

Already tried:

wp option set woocommerce_onboarding_opt_in "yes"
wp option set woocommerce_onboarding_profile "" // aleady tried setting it to serialized data as well
wp option set woocommerce_store_address "street address number"
wp option set woocommerce_store_address_2 ""
wp option set woocommerce_store_city "Mycity"
wp option set woocommerce_store_postcode "1234"
wp option set woocommerce_default_country "BE"

But that doesn't seem to be enough. Anyone an idea on how to properly install and configure WooCommerce with WP-CLI without having to deal with the onboarding afterwards in wp-admin?

0

Not very sure, but maybe you need to install WooCommerce pages?

wp option set woocommerce_onboarding_opt_in "yes"
wp option set woocommerce_onboarding_profile ""
wp option set woocommerce_store_address "street address number"
wp option set woocommerce_store_address_2 ""
wp option set woocommerce_store_city "Mycity"
wp option set woocommerce_store_postcode "1234"
wp option set woocommerce_default_country "BE"

wp wc --user=admin tool run install_pages
| improve this answer | |
New contributor
Greys is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.