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

Unable to add configurable product to cart on any non-default store view #31736

Merged

Conversation

shikhamis11
Copy link
Member

@shikhamis11 shikhamis11 commented Jan 18, 2021

Description (*)

Note: Simple Products work across website/store code, this bug is specific to configurable products

PWA Repro:

URL - https://integration-5ojmyuq-jnz3dtiuj77ca.us-4.magentosite.cloud/montana-wind-jacket.html

Steps -

Go to above URL.

Switch to French Store and try adding configurable to to cart.

Expected - Product should get added.

Actual - User gets error "Could not add item to cart. Please check required options and try again."

GQL Repro:

Using a backend on 2.4.2-beta3, create a cart
Attempt to add a configurable item to the "french" store:

// Query

mutation addConfigurableProductToCart(
  $cartId: String!
  $quantity: Float!
  $sku: String!
  $parentSku: String!
) {
  addConfigurableProductsToCart(
    input: {
      cart_id: $cartId
      cart_items: [
        { data: { quantity: $quantity, sku: $sku }, parent_sku: $parentSku }
      ]
    }
  ) {
    cart {
      id
      total_quantity
    }
  }
}
{code}

{code:java}
// Query Variables
{
  "cartId":"9cfw1jBRxnyyic8jVoBLXELkDOZtobJ4",
  "quantity": 1,
  "sku": "WT09-XL-Yellow",
  "parentSku": "WT09"
} {code}
{code:java}
// Header
{ 
  "store": "fr" 
}{code}
 

Expected:
{code:java}
 {
  "data": {
    "addConfigurableProductsToCart": {
      "cart": {
        "id": "9cfw1jBRxnyyic8jVoBLXELkDOZtobJ4",
        "total_quantity": 4
      }
    }
  }
}{code}
 

Actual:
{code:java}
{
  "errors": [
    {
      "message": "Could not add the product with SKU WT09 to the shopping cart: The website with id 2 that was requested wasn't found. Verify the website and try again.",
      "extensions": {
        "category": "graphql-input"
      },
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "addConfigurableProductsToCart"
      ]
    }
  >,
  "data": {
    "addConfigurableProductsToCart": null
  }
} 

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Unable to add configurable product to cart on any non-default store view (French store). #31660

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jan 18, 2021

Hi @shikhamis11. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests 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

@shikhamis11 shikhamis11 added the PAP Partners acceleration program label Jan 18, 2021
@shikhamis11
Copy link
Member Author

@magento give me test instance

@magento-deployment-service
Copy link

Hi @shikhamis11. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@shikhamis11
Copy link
Member Author

@magento run Static Tests

1 similar comment
@shikhamis11
Copy link
Member Author

@magento run Static Tests

@m2-community-project m2-community-project bot removed this from Pending Review in Pull Requests Dashboard Jan 18, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jan 18, 2021

Hi @shikhamis11, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@m2-assistant
Copy link

m2-assistant bot commented Jan 19, 2021

Hi @shikhamis11. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

@m2-community-project m2-community-project bot added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S1 Affects critical data or functionality and forces users to employ a workaround. labels Jan 19, 2021
@shikhamis11
Copy link
Member Author

@magento run all tests

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔ Approved.

Failing tests looks not related to changes form this PR.

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-8673 has been created to process this Pull Request
✳️ @ihor-sviziev, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@ihor-sviziev ihor-sviziev added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Jan 21, 2021
@m2-community-project m2-community-project bot added this to Ready for Testing in GraphQL Pull Requests Dashboard Jan 21, 2021
@m2-community-project m2-community-project bot removed this from Ready for Testing in High Priority Pull Requests Dashboard Jan 21, 2021
@ihor-sviziev
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE

@magento-engcom-team magento-engcom-team merged commit 7b13fd0 into magento:2.4-develop Feb 16, 2021
@m2-assistant
Copy link

m2-assistant bot commented Feb 16, 2021

Hi @shikhamis11, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@sdzhepa sdzhepa moved this from Ready for Testing to Recently Merged in GraphQL Pull Requests Dashboard Nov 8, 2021
@ihor-sviziev ihor-sviziev moved this from Ready for Testing to Recently Merged in High Priority Pull Requests Dashboard Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: test coverage Component: ConfigurableProductGraphQl PAP Partners acceleration program Partner: Cedcommerce partners-contribution Pull Request is created by Magento Partner Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: ready for testing Project: GraphQL Release Line: 2.4 Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Unable to add configurable product to cart on any non-default store view (French store).
5 participants