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

Customer got an error about Virtual Product after setting the shipping address on Cart that contains Downloadable Product only #26107

Closed
TomashKhamlai opened this issue Aug 12, 2019 · 8 comments · Fixed by #28904
Assignees
Labels
Component: Downloadable Event: mm20in Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development PAP Partners acceleration program Project: GraphQL Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Milestone

Comments

@TomashKhamlai
Copy link
Contributor

Preconditions (*)

  1. No preconditions

Steps to reproduce (*)

  1. Create a cart with a downloadable product and try to set the shipping address

Expected result (*)

  1. A proper message

Actual result (*)

  1. Message about Virtual Product
{
  "errors": [
    {
      "message": "The Cart includes virtual product(s) only, so a shipping address is not used.",
      "category": "graphql-no-such-entity",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "setShippingAddressesOnCart"
      ]
    }
  ],
  "data": {
    "setShippingAddressesOnCart": null
  }
}
@pmclain pmclain self-assigned this Aug 24, 2019
@pmclain
Copy link
Contributor

pmclain commented Aug 24, 2019

The error message originates in Magento_Quote

https://github.com/magento/graphql-ce/blob/6f81c9d5c63b136ce293e2ee84f262201c5b488d/app/code/Magento/Quote/Model/ShippingAddressManagement.php#L90-L92

This exception is caught in Magento_QuoteGraphQl and re-thrown passing the message in the response.

https://github.com/magento/graphql-ce/blob/e02dc94e04228901706936c2cac778679d5dc346/app/code/Magento/QuoteGraphQl/Model/Cart/AssignShippingAddressToCart.php#L51-L52

There are two reasons a NoSuchEntityException would be thrown:

  1. The quote is virtual (no item requiring shipment)
  2. The quote does not exist

I would like to change the exception message to something similar to Shipping address is not allowed on cart: cart contains no items for shipment.. Changing the string would be a BiC change and would need to wait for 2.4.

@lenaorobei Is there an alternative I'm overlooking?

@lenaorobei lenaorobei transferred this issue from magento/graphql-ce Dec 18, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 18, 2019

Hi @TomashKhamlai. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@TomashKhamlai do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Dec 18, 2019
@lenaorobei lenaorobei added Component: Downloadable Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Dec 18, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @lenaorobei
Thank you for verifying the issue. Based on the provided information internal tickets MC-29905 were created

Issue Available: @lenaorobei, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Dec 18, 2019
@sanjay-wagento sanjay-wagento self-assigned this Feb 2, 2020
@m2-assistant
Copy link

m2-assistant bot commented Feb 2, 2020

Hi @sanjay-wagento. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@sanjay-wagento
Copy link
Contributor

#MM20IN

@sanjay-wagento
Copy link
Contributor

@lenaorobei I have reviewed the issue and it seems this is not related to graphql only. The message is comming from Magento core module. It seems above message is not related to virtula product only but it is for all product that does not contain shipping address.

If you think this is valid issue then can you please tell me which type of mesage you want to display through out system for downloadable, virtual and gift card virtula type products?

@lenaorobei
Copy link
Contributor

Hi @sanjay-wagento! Please have a look at the comment from @pmclain. This is the best option we have now - change the exception message.

@magento-engcom-team magento-engcom-team added this to Dev in Progress in Community Backlog Mar 24, 2020
@ghost ghost moved this from Dev in Progress to Ready for Dev in Community Backlog Jun 24, 2020
@nrkapoor nrkapoor moved this from Dev in Progress to Good First Issue in Community Backlog Jun 24, 2020
@nrkapoor nrkapoor added this to the 2.4.1 milestone Jun 24, 2020
@nrkapoor nrkapoor added the PAP Partners acceleration program label Jun 25, 2020
michalderlatka added a commit to michalderlatka/magento2 that referenced this issue Jun 26, 2020
@ghost ghost assigned michalderlatka Jun 26, 2020
@ghost ghost moved this from Good First Issue to PR In Progress in Community Backlog Jun 26, 2020
michalderlatka added a commit to michalderlatka/magento2 that referenced this issue Jun 27, 2020
michalderlatka added a commit to michalderlatka/magento2 that referenced this issue Jun 28, 2020
@magento-engcom-team
Copy link
Contributor

Hi @TomashKhamlai. Thank you for your report.
The issue has been fixed in #28904 by @michalderlatka in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.1 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Jul 15, 2020
@ghost ghost moved this from PR In Progress to Done (last 30 days) in Community Backlog Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Downloadable Event: mm20in Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development PAP Partners acceleration program Project: GraphQL Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
No open projects
Community Backlog
  
Done (last 30 days)
Development

Successfully merging a pull request may close this issue.

8 participants