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

How to get availableShippingMethods include tax when taxable setting is on #802

Open
oat-tigerheart opened this issue Sep 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@oat-tigerheart
Copy link

I want to show correct price for shipping options but availableShippingMethods in Cart always show price with with no tax include
{ cart { displayPricesIncludeTax availableShippingMethods { rates { id instanceId label methodId cost } } } }

How to make price include tax when taxable option is enable in setting or can we get Tax status field from setting

@kidunot89 kidunot89 added the bug Something isn't working label Oct 3, 2023
@MonPetitUd
Copy link

@oat-tigerheart now encountering this issue as well.

For now manually extending the ShippingRate graphql object to access the get_shipping_tax function e.g.

add_action( 'graphql_register_types', function() { register_graphql_fields( 'ShippingRate', array( 'tax' => array( 'type' => 'Float', 'description' => __( 'Shipping rate tax amount', 'wp-graphql-woocommerce' ), 'resolve' => static function ( $source ) { return ! empty( $source->get_shipping_tax() ) ? $source->get_shipping_tax() : 0; }, ) )); });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants