change save logic
This commit is contained in:
parent
ec004dbdcd
commit
21037bb406
|
@ -86,9 +86,11 @@ export const Edit = ( {
|
|||
} );
|
||||
// Hack to get it update in editor
|
||||
wcSettings.defaultFields.phone.hidden = ! showField;
|
||||
wcSettings.defaultFields.phone.required = showField;
|
||||
if ( showField ) {
|
||||
wcSettings.defaultFields.phone.required = true;
|
||||
}
|
||||
};
|
||||
|
||||
console.log( { requirePhoneField, showPhoneField } );
|
||||
const setRequirePhoneFieldEntity = ( value: string ) => {
|
||||
dispatch( coreStore ).editEntityRecord( 'root', 'site', undefined, {
|
||||
woocommerce_checkout_phone_field:
|
||||
|
@ -245,10 +247,8 @@ export const Edit = ( {
|
|||
value={ {
|
||||
showApartmentField,
|
||||
showCompanyField,
|
||||
showPhoneField,
|
||||
requireApartmentField,
|
||||
requireCompanyField,
|
||||
requirePhoneField,
|
||||
showOrderNotes,
|
||||
showPolicyLinks,
|
||||
showReturnToCart,
|
||||
|
|
|
@ -33,7 +33,7 @@ class Checkout extends AbstractBlock {
|
|||
protected function initialize() {
|
||||
parent::initialize();
|
||||
add_action( 'wp_loaded', array( $this, 'register_patterns' ) );
|
||||
add_action( 'init', array( $this, 'register_settings' ) );
|
||||
add_action( 'wp_loaded', array( $this, 'register_settings' ) );
|
||||
// This prevents the page redirecting when the cart is empty. This is so the editor still loads the page preview.
|
||||
add_filter(
|
||||
'woocommerce_checkout_redirect_empty_cart',
|
||||
|
|
Loading…
Reference in New Issue