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

Add configurable product to Cart #224

Merged
merged 5 commits into from
Feb 12, 2019

Conversation

eugene-shab
Copy link
Contributor

Issue #142
[Mutations] Cart Operations > Add configurable product to Cart

@eugene-shab eugene-shab requested a review from naydav October 26, 2018 11:24
@eugene-shab eugene-shab changed the title [WIP] Add configurable product to Cart Add configurable product to Cart Oct 26, 2018
@eugene-shab eugene-shab force-pushed the 142_Add_configurable_product_to_Cart branch 2 times, most recently from 7928f4e to a2a94ca Compare October 26, 2018 11:28
@eugene-shab eugene-shab force-pushed the 142_Add_configurable_product_to_Cart branch from a2a94ca to 5e7e1da Compare October 26, 2018 11:59
@magento-engcom-team magento-engcom-team deleted the 142_Add_configurable_product_to_Cart branch November 9, 2018 11:29
@VladimirZaets VladimirZaets restored the 142_Add_configurable_product_to_Cart branch November 9, 2018 12:58
@VladimirZaets VladimirZaets reopened this Nov 9, 2018
@TomashKhamlai
Copy link
Contributor

TomashKhamlai commented Jan 17, 2019

@eugene-shab, could you please try to execute

mutation {
  addConfigurableProductsToCart(
    input: {
      cart_id: "LPK1LObaONNeWDjdUyLk6ZGQd2X8XVg3"
      cartItems: [
        { data: { qty: 1, sku: "conf-black" } }
        { data: { qty: 1, sku: "conf-black" } }
      ]
    }
  ) {
    cart {
      items {
        id
        qty
        product {
          name
          sku
        }
        ... on ConfigurableCartItem {
          configurable_options {
            option_label
          }
          customizable_options {
            label
          }
        }
      }
    }
  }
}

and explain why this request executes without error and without data from ConfigurableCartItem?

I also found that when I try to add more products than it is available I got internal server error. Could you try verify it and create an issue for this?

{
	"errors": [{
		"debugMessage": "Request content type must be application\/json",
		"message": "Internal server error",
		"category": "internal",
		"trace": [{
			"file": "\/shared\/httpd\/m2-test\/graphql-ce\/app\/code\/Magento\/GraphQl\/Controller\/HttpRequestProcessor.php",
			"line": 39,
			"call": "Magento\\GraphQl\\Controller\\HttpHeaderProcessor\\ContentTypeProcessor::processHeaderValue((empty string))"
		}, {
			"file": "\/shared\/httpd\/m2-test\/graphql-ce\/app\/code\/Magento\/GraphQl\/Controller\/GraphQl.php",
			"line": 110,
			"call": "Magento\\GraphQl\\Controller\\HttpRequestProcessor::processHeaders(instance of Magento\\Framework\\App\\Request\\Http)"
		}, {
			"file": "\/shared\/httpd\/m2-test\/graphql-ce\/lib\/internal\/Magento\/Framework\/Interception\/Interceptor.php",
			"line": 58,
			"call": "Magento\\GraphQl\\Controller\\GraphQl::dispatch(instance of Magento\\Framework\\App\\Request\\Http)"
		}, {
			"file": "\/shared\/httpd\/m2-test\/graphql-ce\/lib\/internal\/Magento\/Framework\/Interception\/Interceptor.php",
			"line": 138,
			"call": "Magento\\GraphQl\\Controller\\GraphQl\\Interceptor::___callParent('dispatch', array(1))"
		}, {
			"file": "\/shared\/httpd\/m2-test\/graphql-ce\/lib\/internal\/Magento\/Framework\/Interception\/Interceptor.php",
			"line": 153,
			"call": "Magento\\GraphQl\\Controller\\GraphQl\\Interceptor::Magento\\Framework\\Interception\\{closure}(instance of Magento\\Framework\\App\\Request\\Http)"
		}, {
			"file": "\/shared\/httpd\/m2-test\/graphql-ce\/generated\/code\/Magento\/GraphQl\/Controller\/GraphQl\/Interceptor.php",
			"line": 26,
			"call": "Magento\\GraphQl\\Controller\\GraphQl\\Interceptor::___callPlugins('dispatch', array(1), array(1))"
		}, {
			"file": "\/shared\/httpd\/m2-test\/graphql-ce\/lib\/internal\/Magento\/Framework\/App\/Http.php",
			"line": 135,
			"call": "Magento\\GraphQl\\Controller\\GraphQl\\Interceptor::dispatch(instance of Magento\\Framework\\App\\Request\\Http)"
		}, {
			"file": "\/shared\/httpd\/m2-test\/graphql-ce\/generated\/code\/Magento\/Framework\/App\/Http\/Interceptor.php",
			"line": 24,
			"call": "Magento\\Framework\\App\\Http::launch()"
		}, {
			"file": "\/shared\/httpd\/m2-test\/graphql-ce\/lib\/internal\/Magento\/Framework\/App\/Bootstrap.php",
			"line": 257,
			"call": "Magento\\Framework\\App\\Http\\Interceptor::launch()"
		}, {
			"file": "\/shared\/httpd\/m2-test\/graphql-ce\/index.php",
			"line": 39,
			"call": "Magento\\Framework\\App\\Bootstrap::run(instance of Magento\\Framework\\App\\Http\\Interceptor)"
		}]
	}]
}

@ghost
Copy link

ghost commented Feb 12, 2019

Hi @eugene-shab, 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.

@naydav naydav deleted the 142_Add_configurable_product_to_Cart branch April 12, 2019 19:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants