Upgrade routine for woocommerce_default_customer_address

Closes #7334
This commit is contained in:
Mike Jolley 2015-02-10 11:49:09 +00:00
parent 893babaaef
commit 78be4ad128
1 changed files with 6 additions and 1 deletions

View File

@ -15,3 +15,8 @@ if ( ! defined( 'ABSPATH' ) ) {
// _money_spent and _order_count may be out of sync - clear them
delete_metadata( 'user', 0, '_money_spent', '', true );
delete_metadata( 'user', 0, '_order_count', '', true );
// To prevent taxes being hidden when using a default 'no address' in a store with tax inc prices, set the woocommerce_default_customer_address to use the store base address by default
if ( '' === get_option( 'woocommerce_default_customer_address', false ) && wc_prices_include_tax() ) {
update_option( 'woocommerce_default_customer_address', 'base' );
}