WC_Checkout::maybe_skip_fieldset()
See if a fieldset should be skipped.
Method of the class: WC_Checkout{}
No Hooks.
Return
true|false
.
Usage
// protected - for code of main (parent) or child class $result = $this->maybe_skip_fieldset( $fieldset_key, $data );
- $fieldset_key(string) (required)
- Fieldset key.
- $data(array) (required)
- Posted data.
Changelog
Since 3.0.0 | Introduced. |
WC_Checkout::maybe_skip_fieldset() WC Checkout::maybe skip fieldset code WC 9.7.1
protected function maybe_skip_fieldset( $fieldset_key, $data ) { if ( 'shipping' === $fieldset_key && ( ! $data['ship_to_different_address'] || ! WC()->cart->needs_shipping_address() ) ) { return true; } if ( 'account' === $fieldset_key && ( is_user_logged_in() || ( ! $this->is_registration_required() && empty( $data['createaccount'] ) ) ) ) { return true; } return false; }