document how to activate HPOS via WP CLI

Leif Singer 2022-12-13 14:15:09 +01:00
parent b657f41f59
commit 212f65c162
1 changed files with 9 additions and 1 deletions

@ -49,7 +49,15 @@ You can also downgrade the WooCommerce version to a version before the HPOS feat
4. If you have created the tables previously, please delete the old ones and create new ones again, as the database structure has changed a couple of times.
5. Now you can use settings in WC > Settings > Advanced > Custom data stores to switch the data source from posts table to custom table for orders and change other related settings.
## Initial sync of orders
## Using WP CLI
If one or more active extensions aren't yet compatible with HPOS, the UI will not let the user activate HPOS as it would be unsafe to do so on a live site. However, for testing and for upgrading an extension to work with HPOS it can be useful to override this. The option to enable HPOS is called `woocommerce_feature_custom_order_tables_enabled` and can be enabled via WP CLI like so:
```
wp option set woocommerce_feature_custom_order_tables_enabled yes
```
### Initial sync of orders
When getting started and when testing out HPOS, you may occasionally find that orders are waiting to be synced. For instance, within **WooCommerce > Settings > Advanced > Custom Data Stores** you may see a message like, _"There are 1234 orders pending sync!"_