Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks
StoreDetails::is_complete()
Task completion.
Method of the class: StoreDetails{}
No Hooks.
Return
true|false
.
Usage
$StoreDetails = new StoreDetails(); $StoreDetails->is_complete();
StoreDetails::is_complete() StoreDetails::is complete code WC 9.7.1
public function is_complete() { $country = WC()->countries->get_base_country(); $country_locale = WC()->countries->get_country_locale(); $locale = $country_locale[ $country ] ?? array(); $hide_postcode = $locale['postcode']['hidden'] ?? false; // If postcode is hidden, just check that the store address and city are set. if ( $hide_postcode ) { return get_option( 'woocommerce_store_address', '' ) !== '' && get_option( 'woocommerce_store_city', '' ) !== ''; } // Mark as completed if the store address, city and postcode are set. We don't need to check the country because it's set by default. return get_option( 'woocommerce_store_address', '' ) !== '' && get_option( 'woocommerce_store_city', '' ) !== '' && get_option( 'woocommerce_store_postcode', '' ) !== ''; }