-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
src/guides/v2.3/graphql/tutorials/checkout/checkout-add-product-to-cart.md
Outdated
Show resolved
Hide resolved
src/guides/v2.3/graphql/tutorials/checkout/checkout-add-product-to-cart.md
Outdated
Show resolved
Hide resolved
|
||
The **10-step tutorial** generally takes **30 minutes**. | ||
The 10-step tutorial generally takes 30 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert. The highlighting is part of the tutorial template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
The sample data defines a functional store, called Luma, that sells fitness clothing and accessories. The store does not provide any sandbox accounts for testing credit card payments, so transactions will be simulated using an offline [payment method](https://glossary.magento.com/payment-method). | ||
|
||
* Install a GraphQl client. You can use any GraphQl client to send calls to Magento. [GraphiQL](https://electronjs.org/apps/graphiql) is recommended. | ||
- In the Magento admin, create a coupon that will be used in [Step 7. Apply a coupon]({{page.baseurl}}/graphql/tutorials/checkout/checkout-coupon.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link to merchdocs. Also, this isn't the most important bullet item. Delete the "Find the merchant documentation" item and replace it with this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/guides/v2.3/graphql/tutorials/checkout/checkout-customer.md
Outdated
Show resolved
Hide resolved
@@ -220,17 +205,18 @@ mutation { | |||
] | |||
} | |||
} | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add these back. They're the closing marks for the data
and top-level` objects. Also I think the lack of blank line afterward is causing the display problems in GH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/guides/v2.3/graphql/tutorials/checkout/checkout-billing-address.md
Outdated
Show resolved
Hide resolved
src/guides/v2.4/graphql/tutorials/checkout/checkout-shipping-method.md
Outdated
Show resolved
Hide resolved
src/guides/v2.4/graphql/tutorials/checkout/checkout-shipping-method.md
Outdated
Show resolved
Hide resolved
…t-to-cart.md Co-authored-by: Kevin Harper <[email protected]>
Co-authored-by: Kevin Harper <[email protected]>
|
||
## Verify this step {#verify-step} | ||
|
||
Sign in as a customer to the website using the email `[email protected]` and password `b1b2b3l@w+`. You should be successfully logged in. | ||
|
||
[Authorization tokens]({{page.baseurl}}/graphql/authorization-tokens.html) describes the mutation further. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this line to be above "Verify this step"
@@ -22,57 +22,42 @@ Use the [setShippingAddressesOnCart]({{ page.baseurl }}/graphql/mutations/set-sh | |||
|
|||
## Create a new shipping address | |||
|
|||
The following mutation adds a shipping address to the quote. | |||
In this step, we use the `createCustomerAddress` mutation to add a shipping address to the customer record. Then we can use it in the cart. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the bulleted list at the beginning of the topic, change "Add" to "Create". Also, delete the second bullet. Maybe wordsmith the intro a bit to say the tutorial shows two ways to set a shipping address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've broken the tutorial. We don't describe how to set the shipping address for a guest.
|
||
For **Rule Information**: | ||
|
||
- Rule Name: Watch Coupon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make all the field names bold.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
```text | ||
```graphql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the last line of the topic, the right parenthesis is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
mutation { | ||
setShippingAddressesOnCart( | ||
input: { | ||
cart_id: "{ CART_ID }" | ||
cart_id: "{{ CART_ID }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove a set of braces. With a double set, Jekyll thinks CART_ID is a varaible, which renders as a blank.
Also, insert a region_id
and set save_in_address_book
to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's from trying to get variables working in Altair.
@@ -25,53 +25,42 @@ Use the [setBillingAddressOnCart]({{ page.baseurl }}/graphql/mutations/set-billi | |||
|
|||
## Add a new billing address | |||
|
|||
The following mutation adds a new billing address. `{ CART_ID }` is the unique shopping cart ID from [Step 2. Create empty cart]({{ page.baseurl }}/graphql/tutorials/checkout/checkout-add-product-to-cart.html). | |||
Similar to the previous step, we will add a billing address to the customer. `{ CART_ID }` is the unique shopping cart ID from [Step 2. Create empty cart]({{ page.baseurl }}/graphql/tutorials/checkout/checkout-add-product-to-cart.html). In this example, the `default_billing` parameter is set to `true`. The street address is also different, so we can see that different addresses are being created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of everything but adding a billing address to the cart, so the procedure is the same for guests and customers.
The shipping and billing addresses are now different. That's OK, but be sure to mention that.
Hi @dobooth, thank you for your contribution! |
Hi @dobooth, thank you for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of nits, but the setShippingAddressOnCart response needs to be expanded.
@@ -88,6 +88,11 @@ mutation { | |||
} | |||
``` | |||
|
|||
## Add Authorization header |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Add Authorization header | |
## Specify an Authorization header |
|
||
`{ CART_ID }` is the unique shopping cart ID from [Step 2. Create empty cart]({{ page.baseurl }}/graphql/tutorials/checkout/checkout-add-product-to-cart.html). | ||
If using a logged in customer, send the customer's authorization token in the `Authorization` parameter of the header. See [Authorization tokens]({{page.baseurl}}/graphql/authorization-tokens.html) for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response needs to include the available_shipping_methods object. Add it after the country object
available_shipping_methods{
carrier_code
carrier_title
method_code
method_title
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -22,21 +22,22 @@ The `setShippingMethodsOnCart` mutation defines the delivery methods for your or | |||
|
|||
`{ CART_ID }` is the unique shopping cart ID from [Step 2. Create empty cart]({{ page.baseurl }}/graphql/tutorials/checkout/checkout-add-product-to-cart.html). | |||
|
|||
{:.bs-callout .bs-callout-info} | |||
The `carrier_code` and `method_code` values come from the results of the mutation on the previous step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's currently missing from the tutorial. This should link to the shipping address step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
carrier_code: "ups" | ||
method_code: "GND" | ||
carrier_code: "tablerate" | ||
method_code: "bestway" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alignment is off here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
running tests |
Hi @dobooth, thank you for your contribution! |
Purpose of this pull request
This pull request (PR) enhances and fixes the GraphQL tutorial.
It clarifies steps, adds instructions for creating a coupon and other markup fixes.
Affected DevDocs pages
whatsnew
Simplified and updated the GraphQL tutorial.