From a539cc0f6deb40fe37e4e7c8caf5312d77e08c18 Mon Sep 17 00:00:00 2001 From: Roman Pyrih Date: Thu, 3 Apr 2025 15:37:50 +0200 Subject: [PATCH] Remove commented-out code for comment and birthday fields in CustomerFormatter --- classes/form/CustomerFormatter.php | 52 ++++++++++++++++-------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/classes/form/CustomerFormatter.php b/classes/form/CustomerFormatter.php index ae5daa44..86e78030 100644 --- a/classes/form/CustomerFormatter.php +++ b/classes/form/CustomerFormatter.php @@ -119,10 +119,11 @@ class CustomerFormatterCore implements FormFormatterInterface ) ) ->setRequired(true) - ->addAvailableValue( - 'comment', - $this->translator->trans('Only letters and the dot (.) character, followed by a space, are allowed.', [], 'Shop.Forms.Help') - ); + // ->addAvailableValue( + // 'comment', + // $this->translator->trans('Only letters and the dot (.) character, followed by a space, are allowed.', [], 'Shop.Forms.Help') + // ) + ; $format['lastname'] = (new FormField()) ->setName('lastname') @@ -134,10 +135,11 @@ class CustomerFormatterCore implements FormFormatterInterface ) ) ->setRequired(true) - ->addAvailableValue( - 'comment', - $this->translator->trans('Only letters and the dot (.) character, followed by a space, are allowed.', [], 'Shop.Forms.Help') - ); + // ->addAvailableValue( + // 'comment', + // $this->translator->trans('Only letters and the dot (.) character, followed by a space, are allowed.', [], 'Shop.Forms.Help') + // ) + ; if (Configuration::get('PS_B2B_ENABLE')) { $format['company'] = (new FormField()) @@ -198,23 +200,23 @@ class CustomerFormatterCore implements FormFormatterInterface ); } - if ($this->ask_for_birthdate) { - $format['birthday'] = (new FormField()) - ->setName('birthday') - ->setType('text') - ->setLabel( - $this->translator->trans( - 'Birthdate', - [], - 'Shop.Forms.Labels' - ) - ) - ->addAvailableValue('placeholder', Tools::getDateFormat()) - ->addAvailableValue( - 'comment', - $this->translator->trans('(E.g.: %date_format%)', ['%date_format%' => Tools::formatDateStr('31 May 1970')], 'Shop.Forms.Help') - ); - } + // if ($this->ask_for_birthdate) { + // $format['birthday'] = (new FormField()) + // ->setName('birthday') + // ->setType('text') + // ->setLabel( + // $this->translator->trans( + // 'Birthdate', + // [], + // 'Shop.Forms.Labels' + // ) + // ) + // ->addAvailableValue('placeholder', Tools::getDateFormat()) + // ->addAvailableValue( + // 'comment', + // $this->translator->trans('(E.g.: %date_format%)', ['%date_format%' => Tools::formatDateStr('31 May 1970')], 'Shop.Forms.Help') + // ); + // } if ($this->ask_for_partner_optin) { $format['optin'] = (new FormField())