Skip to content
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

Companies without personal details and only allowed countries #107

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

michi-dev
Copy link
Contributor

@michi-dev michi-dev commented Jan 30, 2023

All Submissions:

Changes proposed in this Pull Request:

Closes #108 and #66

How to test the changes in this Pull Request:

  1. use wp wc generate customers 10 to generate 10 customers
  2. Check the page /wp-admin/edit.php?post_type=shop_order orders for orders

feature #108

In 3/4 cases there is a business involved with an order. It can be shipping, billing, or both. If there is a business involved, there will be a 1/2 chance that the address will be assigned to only the business. The other 1/2 would be that the address will be assigned to a business with a person. That means that the fields firstname and lastname will be filled out.

with billing / shipping addresses wich do have a business (the field company with a value) but do not have personal details (firstname and lastname empty)

feature #66

There is the woocommerce option woocommerce_allowed_countries, which can be set in the page /wp-admin/admin.php?page=wc-settings to three different options:

  • all countries
  • just a few specified ones
  • all others than the ones specified

every option has its own logic added to the pull request.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?

Changelog entry

Now, it is also possible to generate customers with businesses for orders, which are not assigned to a person. They do not have the fields first name and last name in shipping and billing.

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@michi-dev michi-dev changed the title Companies without personal details (firstname, lastname) Companies without personal details and only allowed countries Jan 30, 2023
@masteradhoc
Copy link

@coreymckrill any option to check and include this next?

@coreymckrill
Copy link
Contributor

@masteradhoc it's going to be a while before I have time for another round of improvements, but I agree that this should get reviewed soon.

@@ -73,13 +61,37 @@ public static function generate( $save = true ) {
default:
break;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@masteradhoc While it may be a bit before we get to review this, the added code isn't formatted according to WP Coding Standards which we would need before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Billing / Shipping in Customer Details: Company without personal details
4 participants