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 filter to be able to build custom shipping method rate handers. #2052

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

matt-h
Copy link
Member

@matt-h matt-h commented Aug 8, 2023

Changes proposed in this Pull Request:

Allows other plugins to be able to extend the capabilities to handle shipping method rates.

This adds a woocommerce_gla_handle_shipping_method_to_rates filter to the shipping_method_to_rates function for the unhandled shipping type method so that other plugins can implement handlers for those shipping methods.

@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #2052 (5005c0c) into develop (2da9e70) will increase coverage by 0.1%.
Report is 99 commits behind head on develop.
The diff coverage is 17.9%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             develop   #2052     +/-   ##
===========================================
+ Coverage       58.2%   58.3%   +0.1%     
+ Complexity      4119    4114      -5     
===========================================
  Files            454     454             
  Lines          17701   17680     -21     
===========================================
+ Hits           10297   10301      +4     
+ Misses          7404    7379     -25     
Flag Coverage Δ
php-unit-tests 58.3% <17.9%> (+0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
google-listings-and-ads.php 6.4% <0.0%> (ø)
src/Admin/Admin.php 0.0% <0.0%> (ø)
src/ConnectionTest.php 0.0% <ø> (ø)
src/Google/GlobalSiteTag.php 0.0% <0.0%> (ø)
src/Shipping/ZoneMethodsParser.php 98.4% <100.0%> (+0.1%) ⬆️

@puntope
Copy link
Contributor

puntope commented Aug 14, 2023

Thanks for the contribution. Overall looking good for me, just have a question regarding the need of sending the class instance as a parameter.

@matt-h
Copy link
Member Author

matt-h commented Aug 14, 2023

@puntope I didn't need it specifically, was just trying err on the side of passing enough data to solve all potential use cases to filters, even if they aren't needed right away.

Feel free to remove that parameter.

@puntope
Copy link
Contributor

puntope commented Aug 14, 2023

@puntope I didn't need it specifically, was just trying err on the side of passing enough data to solve all potential use cases to filters, even if they aren't needed right away.

Yes, I think is better to keep it as simpler as possible.

Feel free to remove that parameter.

You can change it yourself in your side and I can then approve the PR. 👌

@matt-h
Copy link
Member Author

matt-h commented Aug 14, 2023

@puntope I have removed it, should be all set.

…ers.

Allows other plugins to be able to extend the capabilities to handle shipping method rates.
@eason9487 eason9487 added the changelog: add A new feature, function, or functionality was added. label Oct 3, 2023
@puntope puntope merged commit 7264052 into woocommerce:develop Nov 16, 2023
10 of 11 checks passed
@jorgemd24 jorgemd24 mentioned this pull request Nov 22, 2023
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: add A new feature, function, or functionality was added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants