Skip to content

Custom Attribute such as House Number on checkout is not working #39433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 5 tasks
hariwebdeveloper1989 opened this issue Dec 4, 2024 · 19 comments
Open
1 of 5 tasks
Assignees
Labels
Area: Account Component: CustomerAttributes Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.7 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@hariwebdeveloper1989
Copy link

Preconditions and environment

  • Magento version : checked with version magento 2.4.6, 2.4.6-p1, 2.4.6-p2, 2.4.6-p3, 2.4.6-p4, 2.4.6-p5, 2.4.6-p7 and 2.4.7
  • Anything else that would help a developer reproduce the bug

Follow the steps below

Steps to reproduce

  1. First create a custom attribute such as House Number or you can use extension from adobe such as Magezon custom attributes.
  2. Add any product to cart.
  3. Checkout via adding a new address with House Number in billing and with same billing address.
  4. Checkout
  5. Goto Myaccount >> Address Book
  6. Edit the address and check the House Number.

Expected result

House Number should be save with address and at order billing address and shipping address.

Actual result

House Number is not save with address or with order

Additional information

NA

Release note

Custom attribute or extension attribute for customer addresses not save with address and in with order.

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Dec 4, 2024

Hi @hariwebdeveloper1989. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@hariwebdeveloper1989
Copy link
Author

Hi

This has been tested in vanilla version of Magento and issue is reproducible.

@engcom-Bravo engcom-Bravo self-assigned this Dec 4, 2024
Copy link

m2-assistant bot commented Dec 4, 2024

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.7 Indicates original Magento version for the Issue report. label Dec 4, 2024
@hariwebdeveloper1989
Copy link
Author

Can we make sure it work with 2.4.6-p1 as well as I need to provide solution to one my client on 2.4.6-p1

@engcom-Bravo
Copy link
Contributor

Hi @hariwebdeveloper1989,

Thanks for reporting and collaboration.

We have verified the issue in Latest 2.4-develop instance with EE edition and the issue is not reproducible.Kindly refer the screenshots.

Screenshot 2024-12-05 at 10 47 25 am

Edit-Address-12-05-2024_10_49_AM

House Number saved with address and at order billing address and shipping address.

Kindly recheck the issue in Latest 2.4-develop instance with EE edition and elaborate the steps to reproduce if the issue is still reproducible.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Dec 5, 2024
@engcom-Bravo engcom-Bravo moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Dec 5, 2024
@hariwebdeveloper1989
Copy link
Author

Hi Team,

I will reverify the issue in latest 2.4-develop and update it here latest by tomorrow.

Though my issue is with version 2.4.6-p1
Step 1: Login as general customer
Step 2: added a product to cart
Step 3: Goto checkout on landing find below page
image

Step 4: Click on Add New Address and fill the address
image

Step 5: Go to payment screen and check the My billing and shipping address are same
image

Step 6: Place Order

Step 7: Goto My Account >> Address Book
image

Step8: Open the latest address via edit link
image

You will see the custom address field is empty.

Will it be possible by developer or engineer to share the code files as zip which he has work with me. So I can upload same in my vanilla environment to verify his code.

Let me know if you have any further question or suggestion

Regards,
Hari Agarwal

@hariwebdeveloper1989
Copy link
Author

Hi

I tested with 2.4-develop branch as well and it is not working at my end.

Thankyou

@engcom-Bravo
Copy link
Contributor

engcom-Bravo commented Dec 9, 2024

Hi @hariwebdeveloper1989,

Thanks for your update .

Could you please provide information regarding attributes.Have you created from backend or you have used Magezon custom attributes because since customer address attributes will be for Adobe Magento EE edition.

Please confirm that you have tested in Magento CE or EE edition.

Thanks.

@hariwebdeveloper1989
Copy link
Author

Hi

I have tested in Magento CE via using Magezon Custom Attributes, https://mage2gen.com/ and recommended requires experius/module-extracheckoutaddressfields extension.

I also followed the documentation as well
https://developer.adobe.com/commerce/php/tutorials/frontend/custom-checkout/add-address-field/

Will you able to provide the step by step you guys have followed.

I have below in my custom extension as well

vendor/extension/registration.php
vendor/extension/etc/module.xml
vendor/extension/etc/extension_attributes.xml
vendor/extension/etc/di.xml
vendor/extension/etc/events.xml
vendor/extension/etc/db_schema.xml
vendor/extension/etc/frontend/di.xml
vendor/extension/Setup/Patch/Data/AddressAttribute.php
vendor/extension/Block/Checkout/LayoutProcessor/NewAddressAttribute.php
vendor/extension/view/frontend/requirejs-config.js
vendor/extension/view/frontend/web/js/action/set-shipping-information-mixin.js
vendor/extension/view/frontend/web/js/action/set-billing-address-mixin.js
vendor/extension/view/frontend/web/js/action/create-shipping-address-mixin.js
vendor/extension/Observer/Sales/ModelServiceQuoteSubmitBefore.php which uses the "sales_model_service_quote_submit_before"

Let me know if there is any DM or email where I can share the complete custom code.

Some of my findings further on debugging

  1. New Custom Address Attribute is not save to "customer_address_entity_varchar" or "customer_address_entity_text" table
  2. New Custom Address Attribute is not save with Shipping Address in sales_order_address row. It Only save with Billing Address in sales_order_address row.

However the same attribute works while editing shipping address in the order or edit address in admin panel under a customer. So the issue is in frontend while checkout new address.

Let me any know if there are any additional questions and information required.

Thanks & Regards,
Hari Agarwal

@engcom-Bravo engcom-Bravo added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Dec 10, 2024
Copy link

m2-assistant bot commented Dec 10, 2024

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel
Copy link
Contributor

Hello @hariwebdeveloper1989,

We have tried to reproduce the issue in the latest development branch i.e. 2.4-develop and the issue has been reproducible for us. Please refer to the below screenshot for reference:

image

For reference, we are attaching the custom module as well which helps us in issue reproduction:
Issue39433.zip

Thanks for the contribution

@engcom-Hotel engcom-Hotel added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Component: CustomerAttributes Area: Account and removed Issue: needs update Additional information is require, waiting for response labels Dec 11, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-13506 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented Dec 11, 2024

✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@hariwebdeveloper1989
Copy link
Author

Thanks for confirming the issue and will wait for its solution eagerly.

@hariwebdeveloper1989
Copy link
Author

Is there any update for this issue. Do we found a solution for resolving it.

@hariwebdeveloper1989
Copy link
Author

Hi Support.

Is there any update on the said issue. Any timeline for the solution.

@ajay2108
Copy link

@magento I am working on this

@ajay2108
Copy link

@hariwebdeveloper1989 @engcom-Bravo @engcom-Hotel - I investigated the issue where the custom address attribute house_number was not saving in the address book after placing an order. The root cause is that Magento does not automatically transfer custom address attributes from customer_address_entity to sales_order_address. While setting 'user_defined' => true ensures it is stored in customer_address_entity, it does not persist in orders. The provided ZIP lacks the necessary plugin to copy the attribute to quote_address and sales_order_address during checkout. Implementing this logic will ensure the attribute is correctly saved in the order. Online module creators are also not providing full code for saving attribute value in database.
I suggest to create it by your own and take help from below articles:
https://magecomp.com/blog/magento-2-add-custom-field-at-customer-address-form-and-save-its-value/
https://magento.stackexchange.com/questions/260408/magento2-new-customer-address-attribute-wont-save-to-database

@hariwebdeveloper1989
Copy link
Author

Hi Ajay2108

https://magecomp.com/blog/magento-2-add-custom-field-at-customer-address-form-and-save-its-value/ This is for adding a custom field in the customer profile entity. I have discover the error is with the customer address entity. If you read entire history of ticket. You will get the issue is in core Magento where a custom field is not getting save and functioning as other default address field. Hence the solution provided by you is not functional. Also stackexchange.com solution is not feasible as well. As the same code I tried and its not functional as well with vanilla Magento I work it as mention in initial requirement of ticket.

Regards, @m2-assistant the issue reported still waiting proper resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Account Component: CustomerAttributes Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.7 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

No branches or pull requests

5 participants