Skip to content

[GraphQl] Selected shipping method does not contain value including tax. #31206

Closed
@Hexmage

Description

@Hexmage

Preconditions (*)

  1. Magento 2.4.1 (also present in at least 2.3.5p2)

Steps to reproduce (*)

  1. Enable the shipping method flatrate and set its price to 10
  2. Configure a default tax class for shipping that's not 0%. My example is 21%
  3. Set tax/calculation/shipping_includes_tax to "Including Tax"
  4. Set tax/cart_display/shipping to "Including Tax"
  5. Set tax/display/shipping to "Including Tax"
  6. Create a Cart through GraphQl
  7. Add a product to your cart through GraphQl
  8. Set a Shipping Address on your cart through GraphQl
  9. Set flatrate/flatrate as your shipping method through GraphQl using the following query.
mutation setShippingMethodsOnCart(
    $cartId: String!, 
) {
    setShippingMethodsOnCart(
        input: {
            cart_id: $cartId, 
            shipping_methods:[{
		carrier_code:"flatrate",
		method_code:"flatrate"
	    }]
        }
    ) {
        cart {
            shipping_addresses {
                selected_shipping_method {
                    amount {
                        currency
                        value
                    }
                }
            }
        }
    }
}

Expected result (*)

{
    "data": {
        "setShippingMethodsOnCart": {
            "cart": {
                "shipping_addresses": [
                    {
                        "selected_shipping_method": {
                            "amount": {
                                "currency": "EUR",
                                "value": 10.00
                            }
                        }
                    }
                ]
            }
        }
    }
}

Actual result (*)

{
    "data": {
        "setShippingMethodsOnCart": {
            "cart": {
                "shipping_addresses": [
                    {
                        "selected_shipping_method": {
                            "amount": {
                                "currency": "EUR",
                                "value": 8.26
                            }
                        }
                    }
                ]
            }
        }
    }
}

There is currently no way to get the value of the selected shipping method including tax. This is a value you want for all countries where its normal to display prices including tax (most if not all EU countries) . Currently the only way to get the value (without code changes) is to match the selected shipping method with available shipping methods and get the price incl tax from there.

I'm not certain if the way forward is giving both values to the endpoint or based on configuration change the response of selected_shipping_method { amount { value }}.


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Area: OrderIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: ready for confirmationPAPPartners acceleration programPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneProject: GraphQLReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions