? $group . '_address' : $location ); $fields = $this->checkout_fields_controller->get_contextual_fields_for_location( $location, $document_object ); // Holds values to be persisted to the customer object. $persist_fields = []; $errors = new \WP_Error(); // Validate individual fields agains the document object. Errors are added to the $errors object, and each field is validated regardless of other field errors. foreach ( $fields as $field_key => $field ) { $field_value = $field_values[ $field_key ]; if ( empty( $field_value ) ) { if ( true === $field['required'] ) { $errors->add( 'required_field', /* translators: %s: is the field label */ sprintf( __( '%s is required', 'woocommerce' ), '' . $field['label'] . '' ) ); continue; } $persist_fields[ $field_key ] = ''; continue; } $sanitized_field_value = $sanitized_field_values[ $field_key ]; $valid_check = $this->checkout_fields_controller->validate_field( $field, $sanitized_field_value ); if ( is_wp_error( $valid_check ) && $valid_check->has_errors() ) { // Get one error message from the WP_Error object per field to avoid overlapping error messages. $errors->add( $valid_check->get_error_code(), $valid_check->get_error_message() ); continue; } $persist_fields[ $field_key ] = $sanitized_field_value; } // Validate all fields for this location (this runs custom validation callbacks). If an error is found, no values will be persisted to the customer object. $location_validation = $this->checkout_fields_controller->validate_fields_for_location( $sanitized_field_values, $location, $group ); if ( is_wp_error( $location_validation ) && $location_validation->has_errors() ) { $errors->merge_from( $location_validation ); return $errors; } foreach ( $persist_fields as $field_key => $field_value ) { $this->checkout_fields_controller->persist_field_for_customer( $field_key, $field_value, $customer, $group ); } return $errors->has_errors() ? $errors : true; } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Blocks\Domain\Services\CheckoutFieldsFrontend" not found in /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php:350 Stack trace: #0 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Registry/AbstractDependencyType.php(42): Automattic\WooCommerce\Blocks\Domain\Bootstrap->Automattic\WooCommerce\Blocks\Domain\{closure}() #1 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Registry/SharedType.php(28): Automattic\WooCommerce\Blocks\Registry\AbstractDependencyType->resolve_value() #2 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Registry/Container.php(96): Automattic\WooCommerce\Blocks\Registry\SharedType->get() #3 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php(145): Automattic\WooCommerce\Blocks\Registry\Container->get() #4 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php(73): Automattic\WooCommerce\Blocks\Domain\Bootstrap->init() #5 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Package.php(107): Automattic\WooCommerce\Blocks\Domain\Bootstrap->__construct() #6 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Registry/AbstractDependencyType.php(42): Automattic\WooCommerce\Blocks\Package::Automattic\WooCommerce\Blocks\{closure}() #7 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Registry/SharedType.php(28): Automattic\WooCommerce\Blocks\Registry\AbstractDependencyType->resolve_value() #8 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Registry/Container.php(96): Automattic\WooCommerce\Blocks\Registry\SharedType->get() #9 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Package.php(44): Automattic\WooCommerce\Blocks\Registry\Container->get() #10 [internal function]: Automattic\WooCommerce\Blocks\Package::init() #11 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Packages.php(301): call_user_func() #12 /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Packages.php(90): Automattic\WooCommerce\Packages::initialize_packages() #13 /home/hexcom/public_html/gamemart/wp-includes/class-wp-hook.php(353): Automattic\WooCommerce\Packages::on_init() #14 /home/hexcom/public_html/gamemart/wp-includes/class-wp-hook.php(377): WP_Hook->apply_filters() #15 /home/hexcom/public_html/gamemart/wp-includes/plugin.php(523): WP_Hook->do_action() #16 /home/hexcom/public_html/gamemart/wp-settings.php(630): do_action() #17 /home/hexcom/public_html/gamemart/wp-config.php(98): require_once('/home/hexcom/pu...') #18 /home/hexcom/public_html/gamemart/wp-load.php(50): require_once('/home/hexcom/pu...') #19 /home/hexcom/public_html/gamemart/wp-blog-header.php(13): require_once('/home/hexcom/pu...') #20 /home/hexcom/public_html/gamemart/index.php(17): require('/home/hexcom/pu...') #21 {main} thrown in /home/hexcom/public_html/gamemart/wp-content/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php on line 350