Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Why both cartItems[N].variant_sku and cartItems[N].data.sku are required? #349

Closed
TomashKhamlai opened this issue Feb 6, 2019 · 2 comments
Assignees
Labels
bug Something isn't working Component: QuoteGraphQl Contribution Day Tickets is good for start on Contribution Day good first issue Good for newcomers

Comments

@TomashKhamlai
Copy link
Contributor

TomashKhamlai commented Feb 6, 2019

Steps to reproduce (*)

  1. Create Configurable Product with
    Name & SKU: conf
    Weight: 1
    Price: 1
    Variations:
  • sku: conf-white, qty: 12, price: 10
  • sku: conf-black, qty: 12, price: 10
  1. Perform GraphQL query:
mutation {
  addConfigurableProductsToCart(
    input: {
      cart_id: "gbK3g1pcEiyd39h2clKomLU6qsyFLAVT"
      cartItems: [
        {
          data: {
            qty: 1
            sku: "conf-black"
          }
        }
        {
          data: {
            qty: 1
            sku: "conf-white"
          }
        }
      ]
    }
  ) {
    cart {
      items {
        id
        qty
        product {
          name
          sku
        }
    }
  }
  }
}

Expected result (*)

  1. Isn't SKU unique value?

Actual result (*)

  1. No error and only one value is required
@naydav naydav added the Contribution Day Tickets is good for start on Contribution Day label Feb 8, 2019
@naydav naydav added bug Something isn't working good first issue Good for newcomers labels Mar 2, 2019
@naydav naydav added this to the Release: 2.3.2 milestone Mar 2, 2019
@rogyar rogyar self-assigned this Mar 4, 2019
@rogyar
Copy link
Contributor

rogyar commented Mar 4, 2019

Hi
The problem is the mentioned query adds simple products to the shopping cart using endpoint for configurable products. Please note, that there's no configurable product SKU in the query.
As result, we have two simple products in the shopping cart instead of two configurable products.
Technically, it's correct except one fact. Simple products in the shopping cart have no information about the parent (configurable) product and that's the problem. The current implementation does not allow us to provide information about configurable products in the shopping cart in the same manner as it's done within a scope of the storefront.
We will discuss how to fix the current implementation.

@naydav
Copy link
Contributor

naydav commented Apr 24, 2019

Based on this ticket was created #438 with more details

@naydav naydav closed this as completed Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Component: QuoteGraphQl Contribution Day Tickets is good for start on Contribution Day good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants