Skip to content

Adding variation from another configurable product to cart if variation belongs to same super attribute is possible #24676

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

Closed
VitaliyBoyko opened this issue Sep 18, 2019 · 6 comments
Assignees
Labels
Component: ConfigurableProductGraphQl 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 Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@VitaliyBoyko
Copy link
Contributor

Preconditions (*)

  1. Magento 2.3 from the latest magento/graphql-ce/2.3-develop

Steps to reproduce (*)

  1. Create 2 Configurable products SKU's: [sku-c1, sku-c2]
  2. Add 1 super attribute option, etc. Color - Red
    image
  3. Create 1 variation with attribute Color -Red for each product SKU's:[sku-c1-Red, sku-c2-Red]
    image
    Don't forget fill out quantity and add all products to the category.

The result should look like:
image

  1. Create empty cart
  2. Run mutation with the wrong parent SKU.
mutation {
  addConfigurableProductsToCart(
    input:{
      cart_id:"NEW_CART_ID"
      cart_items:{
        parent_sku: "sku-c1"
        data:{
          sku:"sku-c2-Red"
          quantity:1
        }
      }
    }
  ) {
    cart {
      items {
        id
        quantity
        product {
          sku
        }
        ... on ConfigurableCartItem {
          configurable_options {
            id
            option_label
            value_id
            value_label
          }
        }
      }
    }
  }
}

Expected result (*)

  1. Error is thrown.

Actual result (*)

  1. sku-c1-Red being added to cart.
    image

I'm not sure whether it is bug or feature. Magento automatically selects the correct child product according to the super attribute. Consider this and unmark/fix the folowing test \Magento\GraphQl\ConfigurableProduct\AddConfigurableProductToCartTest::testAddVariationFromAnotherConfigurableProductWithTheSameSuperAttributeToCart added in PR magento/graphql-ce#866.

@sdzhepa sdzhepa transferred this issue from magento/graphql-ce Sep 20, 2019
@m2-assistant
Copy link

m2-assistant bot commented Sep 20, 2019

Hi @VitaliyBoyko. 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.3-develop instance - upcoming 2.3.x release

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

@VitaliyBoyko 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 Sep 20, 2019
@engcom-Charlie engcom-Charlie self-assigned this Sep 23, 2019
@m2-assistant
Copy link

m2-assistant bot commented Sep 23, 2019

Hi @engcom-Charlie. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

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

  • 4. Verify that the issue is reproducible on 2.3-develop branch

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

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@lenaorobei
Copy link
Contributor

There is no check in GraphQL that data/sku(child) belongs to parent_sku. See \Magento\ConfigurableProductGraphQl\Model\Cart\BuyRequest\SuperAttributeDataProvider::execute.

@VitaliyBoyko VitaliyBoyko self-assigned this Sep 27, 2019
@m2-assistant
Copy link

m2-assistant bot commented Sep 27, 2019

Hi @VitaliyBoyko. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

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

  • 4. Verify that the issue is reproducible on 2.3-develop branch

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


@rogyar rogyar added Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Component: ConfigurableProductGraphQl Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Sep 27, 2019
@magento-engcom-team
Copy link
Contributor

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

Issue Available: @rogyar, 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 Sep 27, 2019
@lenaorobei
Copy link
Contributor

Fixed in magento/graphql-ce#968

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ConfigurableProductGraphQl 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 Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

5 participants