ion (CustomerPayload $payload) { $customer = $payload->getCustomer(); return $customer ? $customer->get_shipping_postcode() : null; } ), new Field( 'woocommerce:customer:shipping-state', Field::TYPE_STRING, __('Shipping state/county', 'mailpoet'), function (CustomerPayload $payload) { $customer = $payload->getCustomer(); return $customer ? $customer->get_shipping_state() : null; } ), new Field( 'woocommerce:customer:shipping-country', Field::TYPE_ENUM, __('Shipping country', 'mailpoet'), function (CustomerPayload $payload) { $customer = $payload->getCustomer(); return $customer ? $customer->get_shipping_country() : null; }, [ 'options' => $this->getShippingCountryOptions(), ] ), ], $this->customerOrderFieldsFactory->getFields(), $this->customerReviewFieldsFactory->getFields() ); } private function getBillingCountryOptions(): array { $options = []; foreach (WC()->countries->get_allowed_countries() as $code => $name) { $options[] = ['id' => $code, 'name' => $name]; } return $options; } private function getShippingCountryOptions(): array { $options = []; foreach (WC()->countries->get_shipping_countries() as $code => $name) { $options[] = ['id' => $code, 'name' => $name]; } return $options; } }
Fatal error: Uncaught Error: Class "MailPoet\Automation\Integrations\WooCommerce\Fields\CustomerFieldsFactory" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:2008 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2164): MailPoetGenerated\FreeCachedContainer->getCustomerFieldsFactoryService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2276): MailPoetGenerated\FreeCachedContainer->getWooCommerceIntegrationService() #2 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #3 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #4 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #5 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #6 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(206): require_once('/htdocs/wp-cont...') #7 /htdocs/wp-settings.php(462): include_once('/htdocs/wp-cont...') #8 /htdocs/wp-config.php(96): require_once('/htdocs/wp-sett...') #9 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #10 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #11 /htdocs/index.php(17): require('/htdocs/wp-blog...') #12 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 2008