WC_Checkout::maybe_skip_fieldset( string $fieldset_key, array $data )

See if a fieldset should be skipped.


Description Description


Parameters Parameters

$fieldset_key

(Required) Fieldset key.

$data

(Required) Posted data.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/class-wc-checkout.php

	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;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.