Closed DuckThom closed 1 year ago
Upon further inspection, it looks like this might be a bug within Magento's Quote GraphQL module. The shipping method set on the quote address is split on the first underscore which does not work with sendcloud's sendcloud_checkout
carrier code:
For reference: https://github.com/magento/magento2/issues/36606
Hello @DuckThom
Thank you for reaching out.
Please note that our team will check this issue and we will get back to you with an update as soon as possible
Kind regards.
@teodoratimoti I've been informed by Magento that it's a unspoken/undocumented rule that carrier codes may not contain underscores. For reference, tig_postnl
also has the same issue. In that module, a workaround was implemented: https://github.com/tig-nl/postnl-magento2/blob/master/Plugin/Order/ShipmentPlugin.php#L53
Hello @DuckThom,
Please note that our team is still working on this issue. We will keep you posted about the progress.
Best regards.
Dear @DuckThom,
Thank you for your patience.
The request you made requires more investigation. The Sendcloud support team is best to investigate more indepth. Please forward your request via the Support page in sendcloud: https://app.sendcloud.com/v2/support or reach out to support@sendcloud.com.
We hope we have informed you sufficiently and wish you a great day!
Kind regards.
I'm working on a GraphQL based checkout for a Magento 2.4.5 shop in combination with Sendcloud dynamic checkout shipping methods and I noticed that the carrier and method codes change when setting the shipping method on the cart. In the cart response, on the shipping address, there's 2 fields:
availableShippingMethods
andselectedShippingMethod
.At the top you can see the
carrierCode
andmethodCode
of theselectedShippingMethod
field, at the bottom the same fields but then from theavailableShippingMethods
item.To set the shipping method we use the
setShippingMethodOnCart
GraphQL mutation with the carrier and method code from the availableShippingMethods field. However, when we then look at the returned cart's selectedShippingMethod, the codes do not match.The request:
The response:
This makes it impossible to pre-select the selected shipping method in the shipping step of the checkout as we cannot match the carrier and/or method code against the available methods.