M2.4.5, v1.4.2: Not work with default Magento's Gender attribute

Created by Esther Nguyen, Modified on Wed, 01 Mar 2023 at 03:12 PM by Esther Nguyen

ISSUE:

I have installed BSS customer attribute extension in my testing env and set some attributes in the registration form. It does work fine. However, I've also enabled the default Magento's customer attribute - Gender. It becomes unable to save within the customer edit page. 



SOLUTION:

Unfortunately, our module has not worked properly with the default Gender attribute


To resolve the issue, please edit the file app/code/Bss/CustomerAttributes/Plugin/Model/Metadata/Form.php as below:

     public function afterGetAllowedAttributes($subject, $result)
     {
         $page = $this->request->getFullActionName();
-        $attributeDefault = ['firstname', 'lastname', 'email', 'password', 'taxvat'];
+        $attributeDefault = ['firstname', 'lastname', 'middlename', 'email', 'password', 'taxvat', 'gender', 'dob'];
         if ($page == 'customer_account_editPost'
             && $this->customerAttribute->getConfig('bss_customer_attribute/general/enable')
         ) {


If you need any further assistance, please feel free to contact us. We'd be happy to support you!

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article