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

Add woocommerce_order_get_tax_location filter #25727

Conversation

leanzafrancesco
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR adds woocommerce_order_get_tax_location filter in WC_Abstract_Order::get_tax_location.
This way it'll be possible to filter the tax location, for example, based on a specific meta of the order.
Example: This could be useful if I want to set different tax locations for each order: maybe I'm creating orders through a plugin (or through REST API) and I want to set the tax location depending on the place where I am, so I can filter that value through the new woocommerce_order_get_tax_location filter.

How to test the changes in this Pull Request:

  1. create different tax rates lines based on different countries (for example 23% for Italy and 10% for Spain)
  2. use the woocommerce_order_get_tax_location filter to set country, state, postcode and city, based on some specific order meta
  3. try to create different orders programmatically or through REST API, by using different order meta to specify the tax location for the orders.

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

Dev: added woocommerce_order_get_tax_location filter

@rodrigoprimo rodrigoprimo self-requested a review March 5, 2020 16:47
Copy link
Contributor

@rodrigoprimo rodrigoprimo left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for your contribution.

@rodrigoprimo rodrigoprimo added this to the 4.1.0 milestone Mar 5, 2020
@rodrigoprimo rodrigoprimo merged commit e40ddc5 into woocommerce:master Mar 5, 2020
@woocommercebot woocommercebot added release: add changelog Mark all PRs that have not had their changelog entries added. [auto] release: add testing instructions PRs that have not had testing instructions added to the wiki. [auto] labels Mar 5, 2020
@rodrigoprimo rodrigoprimo removed the release: add testing instructions PRs that have not had testing instructions added to the wiki. [auto] label Mar 5, 2020
@vedanshujain vedanshujain removed the release: add changelog Mark all PRs that have not had their changelog entries added. [auto] label Apr 7, 2020
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.

None yet

4 participants