Toggle the “Physical products” checkbox on by default (https://github.com/woocommerce/woocommerce-admin/pull/4702)
* Toggle the “Physical products” checkbox on by default * change 'preselect' to 'default' Co-authored-by: Rebecca Scott <me@becdetat.com>
This commit is contained in:
parent
739a801c2e
commit
3e79e973ab
|
@ -26,9 +26,13 @@ class ProductTypes extends Component {
|
|||
super();
|
||||
const profileItems = get( props, 'profileItems', {} );
|
||||
|
||||
const { productTypes = {} } = getSetting( 'onboarding', {} );
|
||||
const defaultProductTypes = Object.keys( productTypes )
|
||||
.filter( key => !! productTypes[ key ].default );
|
||||
|
||||
this.state = {
|
||||
error: null,
|
||||
selected: profileItems.product_types || [],
|
||||
selected: profileItems.product_types || defaultProductTypes,
|
||||
};
|
||||
|
||||
this.onContinue = this.onContinue.bind( this );
|
||||
|
@ -106,6 +110,7 @@ class ProductTypes extends Component {
|
|||
render() {
|
||||
const { productTypes = {} } = getSetting( 'onboarding', {} );
|
||||
const { error, selected } = this.state;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<H className="woocommerce-profile-wizard__header-title">
|
||||
|
|
|
@ -340,6 +340,7 @@ class Onboarding {
|
|||
'physical' => array(
|
||||
'label' => __( 'Physical products', 'woocommerce-admin' ),
|
||||
'description' => __( 'Products you ship to customers.', 'woocommerce-admin' ),
|
||||
'default' => true,
|
||||
),
|
||||
'downloads' => array(
|
||||
'label' => __( 'Downloads', 'woocommerce-admin' ),
|
||||
|
|
Loading…
Reference in New Issue