I would like to run the woocommerce setup wizard through command line, to automate my generation of images for testing.
I can execute all steps through the command line except this one.
Is there a way to run the wizard through the CLI?
Something like:
wp wc setup --currency=BRL --weight-unit=kg --dimension-unit=cm ...
if there is no way yet, I suggest this as a new feature, especially in the era we live in, of "containerization" 馃槣
The wizard is visual so I don't think it would work well as a CLI command, but you can set settings directly :) https://github.com/woocommerce/woocommerce/wiki/WC-CLI-Commands#wc-setting
Thanks
I am adding more details here because this is the only high ranking relevant search result and information here is incomplete.
The setting subcommand mentioned above appears to not be public.More details in this comment.
This is working for me for a simple dev setup:
wp option set woocommerce_store_address "123 Main Street"
wp option set woocommerce_store_address_2 ""
wp option set woocommerce_store_city "Toronto"
wp option set woocommerce_default_country "CA:ON"
wp option set woocommerce_store_postalcode "A1B2C3"
wp option set woocommerce_currency "CAD"
wp option set woocommerce_product_type "physical"
wp option set woocommerce_allow_tracking "no"
wp option set --format=json woocommerce_stripe_settings '{"enabled":"no","create_account":false,"email":false}'
wp option set --format=json woocommerce_ppec_paypal_settings '{"reroute_requests":false,"email":false}'
wp option set --format=json woocommerce_cheque_settings '{"enabled":"no"}'
wp option set --format=json woocommerce_bacs_settings '{"enabled":"no"}'
wp option set --format=json woocommerce_cod_settings '{"enabled":"yes"}'
wp wc --user=admin tool run install_pages
Note: there does not appear to be a way to add missing cron commands as far as I can see. Maybe in the future a tool will be added. see wp wc --user=admin tool list
.
wp wc --user=admin payment_gateway update bacs --enabled=true
Works for enabling payment gateways.
Most helpful comment
I am adding more details here because this is the only high ranking relevant search result and information here is incomplete.
The setting subcommand mentioned above appears to not be public.More details in this comment.
This is working for me for a simple dev setup:
Note: there does not appear to be a way to add missing cron commands as far as I can see. Maybe in the future a tool will be added. see
wp wc --user=admin tool list
.