-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Billing address parameter 'same_as_shipping' cause error 'The shipping method is missing' #30924
Comments
Hi @OleksiyOleksiyovych. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento I am working on this |
@magento export issue to Jira project MCLOUD as Bug |
✅ Jira issue (https://jira.corp.magento.com/browse/MCLOUD-7748) is successfully created for this issue. |
@mauragcyrus which commit and pull request regarding to this fix as it was marked completed |
Issue
Error after place order: The shipping method is missing. Select the shipping method and try again
Steps to reproduce
quote_address
- shipping method is selected for quote addresssame*as*shipping = true
Reason for issue
I think we have an issue in logic after these changes
Replace usefor_shipping with same_asshipping
It can not be a simple rename -
use*for_shipping
tosame_as*shipping
as we have in this commit bb25f9abecause these options have a different logic:
use*for*shipping
- set shipping address based on billing addresssame*as*shipping
- set billing address based on shipping addressClass Magento\QuoteGraphQl\Model\Cart\SetBillingAddressOnCart
$this->assignBillingAddressToCart->execute($cart, $billingAddress, $sameAsShipping);
finally, it calls a function
assign($cartId, \Magento\Quote\Api\Data\AddressInterface $address, $useForShipping = false)
in class Magento\Quote\Model\BillingAddressManagement which waiting foruse*for_shipping
parameter instead ofsame_as*shipping
The implementation needs to be updated to reflect this change in logic for the GraphQL call. The logic should now ignore the passed address if
same_as_shipping
istrue
and use the shipping address instead. **Possible fixes
I can see 2 variants of how we can resolve it:
Variant 1
We can remove
same*as_shipping
from GraphQl schema as it does not make sense for backend logic - we do not have a field in database tablequote*address
for this option.We have the field
same*as_billing
inquote*address
table (we use it when we place an order from the admin panel and fill the billing address first).So, the checkbox on checkout 'My billing and shipping address are the same' will be used only for frontend logic in javascript (as on standard checkout on Luma theme) and do not use in mutation.
use*for*shipping
can be removerd from GraphQl schema too.Variant 2
Add logic for
same*as_shipping
on the backend side. In this case, we should dobilling_address
insetBillingAddressOnCart
mutation as not required when we setsame_as_shipping=true
as it does not make sense. We will checksame_as*shipping
in resolver and if it's "true" - load shipping address from the quote and save to billing address.As for me, variant 1 is a more correct way.
Acceptance Criteria
setBillingAddressToCart
mutation is updated to correctly use thesame*as*shipping
input correctly: to set the billing address to match the shipping address, not vice versa.Test Plan
Use input billing address
Input: valid billing address,
same*as*shipping
=false
Expected Result: billing address is set to input address
Use shipping address
Input: empty billing address,
same*as*shipping
=true
Expected Result: billing address matches shipping address
Use shipping address, ignore input billing address
Input: valid billing address,
same*as*shipping
=true
Expected Result: billing address matches shipping address
No provided address
Input: empty billing address,
same*as*shipping
=false
Expected Result: GraphQlInputException
No existing shipping address
Input: any billing address,
same*as*shipping
=true
and no existing shipping addressExpected Result: GraphQlInputException
The text was updated successfully, but these errors were encountered: