Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

magento/devdocs#7367: Added the article "addProductsToCart mutation" #7774

Merged
merged 6 commits into from
Aug 31, 2020

Conversation

andrewbess
Copy link
Contributor

@andrewbess andrewbess commented Aug 24, 2020

Purpose of this pull request

This pull request (PR) provides a new article for AddProductsToCart single mutation.
Also, this PR adds deprecation notices to the single-product type mutations

Affected DevDocs pages

Related Issues (if relevant)

  1. GraphQL: Document addProductsToCart mutation #7367: GraphQL: Document addProductsToCart mutation

whatsnew
Added information about the addProductsToCart mutation to add any type of product to the active cart. We recommend using this mutation instead of single-purpose mutations such as addSimpleProductsToCart.

@devops-devdocs
Copy link
Collaborator

An admin must run tests on this PR before it can be merged.

@keharper keharper self-assigned this Aug 24, 2020
@keharper keharper added 2.4.1 Community Docs impacted by community code contribution New Topic A major update published as an entirely new document and removed Progress: review labels Aug 24, 2020
@dmytro-ch dmytro-ch self-assigned this Aug 24, 2020
Copy link
Contributor

@dmytro-ch dmytro-ch left a comment

Choose a reason for hiding this comment

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

@andrewbess, thank you for your contribution!
Could you please apply the following minor CR recommendations from my side?

Thank you!

@dmytro-ch dmytro-ch requested a review from rogyar August 24, 2020 16:37
@andrewbess
Copy link
Contributor Author

Hello @dmytro-ch.
Thank you for your review.
I fixed all the proposed changes.
The commit has been squashed.
Please recheck.

Thank you in advance.

Copy link
Contributor

@dmytro-ch dmytro-ch left a comment

Choose a reason for hiding this comment

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

From a technical perspective, the changes look good to me. ✔️
Thank you!

}
```

We can consider `selected_option` and `entered_option` as a unique identifier. They meet the criteria:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would say UID of selected_option and entered_option. The option itself is not an identifier

@rogyar
Copy link
Contributor

rogyar commented Aug 25, 2020

Hi @andrewbess. Thanks for the great work. Please, check my notices above.

I reorganized the content so that selected and entered options are discussed toward the beginning.

I would like to know more about the selected option example. Is this way more efficient than the traditional way of adding a configurable product by specifying a parent SKU like `WSH12` and a child SKU like `WSH12-29-Green`?

Do we need to specify how to find `uid` values?
This file was created in another PR that was merged after you submitted this PR. Changing the contents so that they'll match exactly, avoiding a merge conflict.
@keharper
Copy link
Contributor

@andrewbess

I reorganized the content of add-products-to-cart.md so that selected and entered options are discussed toward the beginning.

I would like to know more about the selected option example. Is this way more efficient than the traditional way of adding a configurable product by specifying a parent SKU like WSH12 and a child SKU like WSH12-29-Green?

Do we need to specify how to find uid values?

The entered-option-input.md file was created in another PR that was merged after you submitted this PR. I changed the contents so that they'll match exactly, avoiding a merge conflict.

@andrewbess
Copy link
Contributor Author

Hello @rogyar.
I have a question about your remark here
I am not sure, but I think my proposition is correct.
The "Syntax" is different for all already created topics about mutations.
Please take a look at:

I think my proposed syntax will be more understandable for all developers (juniors, middles, etc.)
How do you think about it?

Also, I want to fix it for all mutation topics, if you'll approve my proposition.

Thank you in advance.

cc @keharper @dmytro-ch

@rogyar
Copy link
Contributor

rogyar commented Aug 29, 2020

Hi @andrewbess that makes sense, thank you for the clarification.

@andrewbess
Copy link
Contributor Author

Hello @keharper
I think it has no advantage to using UIDs when adding a configurable product to a cart. It just extends the add to cart functionality provides another one way for it.

@keharper
Copy link
Contributor

running tests

@keharper keharper merged commit 2ecd75b into magento:2.4.1-develop Aug 31, 2020
@ghost
Copy link

ghost commented Aug 31, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2.4.1 Community Docs impacted by community code contribution New Topic A major update published as an entirely new document Partner: Atwix partners-contribution PR created by Magento partner Progress: done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants