fix(customer): add first and last name for company customers - #219
Open
faisalahammad wants to merge 1 commit into
Open
fix(customer): add first and last name for company customers#219faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
Company-type customers were generated without first_name or last_name, so saving them through WooCommerce's customer data store failed with 'First name is a required field.' This crashed order generation, which creates customers as part of the order. Generate a contact person name for company customers and include it in billing and shipping data so the customer saves correctly. Closes woocommerce#162
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Closes #162
Company-type customers were generated without a first name or last name, so saving them through WooCommerce's customer data store failed with
WC_Data_Exception: First name is a required field.Order generation creates customers as part of building an order, sowp wc generate orderscrashed for affected users.The fix generates a contact person name for company customers and includes it in both billing and shipping data, so the customer saves correctly. Person-type customers were already correct.
How to test the changes in this Pull Request:
wp wc generate orders 10.wp wc generate customers 10 --type=company.Expected: orders and company customers generate without errors, and company customers have a contact name.
Other information:
Changelog entry
Fix fatal error when generating orders caused by company customers missing a first and last name.
FOR PR REVIEWER ONLY: