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

Commit 868d1f4

Browse files
authored
Merge branch 'master' into patch-1
2 parents 1f704d5 + 9267181 commit 868d1f4

File tree

7 files changed

+154
-124
lines changed

7 files changed

+154
-124
lines changed

src/guides/v2.3/config-guide/prod/config-reference-var-name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ To get these values from the database:
140140
1. Use the following SQL queries to find the relevant values:
141141

142142
```shell
143-
SELECT * FROM STORES;
143+
SELECT * FROM STORE;
144144
SELECT * FROM STORE_WEBSITE;
145145
```
146146

src/guides/v2.3/graphql/queries/cart.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,3 +790,11 @@ Attribute | Data Type | Description
790790
* [setShippingMethodsOnCart mutation]({{page.baseurl}}/graphql/mutations/set-shipping-method.html)
791791
* [setBillingAddressOnCart mutation]({{page.baseurl}}/graphql/mutations/set-billing-address.html)
792792
* [setPaymentMethodOnCart mutation]({{page.baseurl}}/graphql/mutations/set-payment-method.html)
793+
794+
## Errors
795+
796+
Error | Description
797+
--- | ---
798+
`Could not find a cart with ID \"xxxxx\"` | The ID provided in the `cart_id` field is invalid or the cart does not exist for the customer.
799+
`The cart isn't active` | The cart with the specified cart ID is unavailable, because the items have been purchased and the cart ID becomes inactive.
800+
`Field cart.cart_id of required type String! was not provided` | The value specified in the `cart.cart_id` argument is empty.

src/guides/v2.3/graphql/queries/get-hosted-pro-url.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,11 @@ The query returns the PayPal URL that enables the customer to sign in to PayPal
5050
Attribute | Data type | Description
5151
--- | --- | ---
5252
`secure_form_url` | String | Secure URL generated by PayPal
53+
54+
## Errors
55+
56+
Error | Description
57+
--- | ---
58+
`Could not find a cart with ID \"xxxxx\"` | The ID provided in the `cart_id` field is invalid or the cart does not exist for the customer.
59+
`The cart isn't active` | The cart with the specified cart ID is unavailable, because the items have been purchased and the cart ID becomes inactive.
60+
`Field HostedProUrlInput.cart_id of required type String! was not provided` | The value specified in the `HostedProUrlInput.cart_id` argument is empty.

src/guides/v2.3/graphql/queries/is-email-available.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,10 @@ Attribute | Data Type | Description
5050
## Related topics
5151

5252
[customer query]({{page.baseurl}}/graphql/queries/customer.html)
53+
54+
## Errors
55+
56+
Error | Description
57+
--- | ---
58+
`Email is invalid` | The given email-id is not in a proper format.
59+
`Field isEmailAvailable.email of required type String! was not provided` | The value specified in the `isEmailAvailable.email` argument is empty.

src/guides/v2.3/howdoi/checkout/checkout_new_step.md

Lines changed: 112 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -29,99 +29,89 @@ To create the view part of the new checkout step:
2929

3030
1. Add a module directory (not covered in this topic). See [Build your module]({{ page.baseurl }}/extension-dev-guide/build/build.html) for details). All custom files must be stored there. For your checkout customization to be applied correctly, your custom module should depend on the `Magento_Checkout` module. Do not use `Ui` for your custom module name, because `%Vendor%_Ui` notation, required when specifying paths, might cause issues.
3131
1. [Create the `.js` file implementing the view model](#component).
32-
1. [Create an `.html` template for the component](#html-template).
32+
1. [Create a `.html` template for the component](#html-template).
3333

3434
### Add the JavaScript file implementing the new step {#component}
3535

3636
A new checkout step must be implemented as UI component. That is, its [JavaScript](https://glossary.magento.com/javascript) implementation must be a JavaScript module.
3737

3838
The file must be stored under the `<your_module_dir>/view/frontend/web/js/view` directory.
3939

40-
{:.bs-callout-info}
40+
{:.bs-callout-info}
4141
`<your_module_dir>` notation stands for the path to your module directory from the root directory. Usually it will be one of the following: `app/code/<YourVendor>/<YourModule>` or `vendor/<yourvendor>/module-<module>-<name>`. For more details see [Conventional notations for paths to modules and themes]({{ page.baseurl }}/frontend-dev-guide/conventions.html)
4242

4343
A sample `my-step-view.js` with comments follows:
4444

4545
```js
46-
define(
47-
[
48-
'ko',
49-
'uiComponent',
50-
'underscore',
51-
'Magento_Checkout/js/model/step-navigator'
52-
],
53-
function (
54-
ko,
55-
Component,
56-
_,
57-
stepNavigator
58-
) {
59-
'use strict';
46+
define([
47+
'ko',
48+
'uiComponent',
49+
'underscore',
50+
'Magento_Checkout/js/model/step-navigator'
51+
], function (ko, Component, _, stepNavigator) {
52+
'use strict';
53+
54+
/**
55+
* mystep - is the name of the component's .html template,
56+
* <Vendor>_<Module> - is the name of your module directory.
57+
*/
58+
return Component.extend({
59+
defaults: {
60+
template: '<Vendor>_<Module>/mystep'
61+
},
62+
63+
// add here your logic to display step,
64+
isVisible: ko.observable(true),
65+
66+
/**
67+
* @returns {*}
68+
*/
69+
initialize: function () {
70+
this._super();
71+
72+
// register your step
73+
stepNavigator.registerStep(
74+
// step code will be used as step content id in the component template
75+
'step_code',
76+
// step alias
77+
null,
78+
// step title value
79+
'Step Title',
80+
// observable property with logic when display step or hide step
81+
this.isVisible,
82+
83+
_.bind(this.navigate, this),
84+
85+
/**
86+
* sort order value
87+
* 'sort order value' < 10: step displays before shipping step;
88+
* 10 < 'sort order value' < 20 : step displays between shipping and payment step
89+
* 'sort order value' > 20 : step displays after payment step
90+
*/
91+
15
92+
);
93+
94+
return this;
95+
},
96+
97+
/**
98+
* The navigate() method is responsible for navigation between checkout steps
99+
* during checkout. You can add custom logic, for example some conditions
100+
* for switching to your custom step
101+
* When the user navigates to the custom step via url anchor or back button we_must show step manually here
102+
*/
103+
navigate: function () {
104+
this.isVisible(true);
105+
},
106+
60107
/**
61-
*
62-
* mystep - is the name of the component's .html template,
63-
* <Vendor>_<Module> - is the name of the your module directory.
64-
*
65-
*/
66-
return Component.extend({
67-
defaults: {
68-
template: '<Vendor>_<Module>/mystep'
69-
},
70-
71-
//add here your logic to display step,
72-
isVisible: ko.observable(true),
73-
74-
/**
75-
*
76-
* @returns {*}
77-
*/
78-
initialize: function () {
79-
this._super();
80-
// register your step
81-
stepNavigator.registerStep(
82-
//step code will be used as step content id in the component template
83-
'step_code',
84-
//step alias
85-
null,
86-
//step title value
87-
'Step Title',
88-
//observable property with logic when display step or hide step
89-
this.isVisible,
90-
91-
_.bind(this.navigate, this),
92-
93-
/**
94-
* sort order value
95-
* 'sort order value' < 10: step displays before shipping step;
96-
* 10 < 'sort order value' < 20 : step displays between shipping and payment step
97-
* 'sort order value' > 20 : step displays after payment step
98-
*/
99-
15
100-
);
101-
102-
return this;
103-
},
104-
105-
/**
106-
* The navigate() method is responsible for navigation between checkout step
107-
* during checkout. You can add custom logic, for example some conditions
108-
* for switching to your custom step
109-
* When the user navigates to the custom step via url anchor or back button we_must show step manually here
110-
*/
111-
navigate: function () {
112-
113-
this.isVisible(true);
114-
},
115-
116-
/**
117-
* @returns void
118-
*/
119-
navigateToNextStep: function () {
120-
stepNavigator.next();
121-
}
122-
});
123-
}
124-
);
108+
* @returns void
109+
*/
110+
navigateToNextStep: function () {
111+
stepNavigator.next();
112+
}
113+
});
114+
});
125115
```
126116

127117
### Add the .html template {#html-template}
@@ -133,7 +123,7 @@ A sample `mystep.html` follows:
133123
```html
134124
<!--The 'step_code' value from the .js file should be used-->
135125
<li id="step_code" data-bind="fadeVisible: isVisible">
136-
<div class="step-title" data-bind="i18n: 'Step Title'" data-role="title"></div>
126+
<div class="step-title" data-bind="i18n: 'Step Title'" data-role="title"></div>
137127
<div id="checkout-step-title"
138128
class="step-content"
139129
data-role="content">
@@ -163,39 +153,39 @@ A sample `checkout_index_index.xml` follows:
163153
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
164154
<body>
165155
<referenceBlock name="checkout.root">
166-
<arguments>
167-
<argument name="jsLayout" xsi:type="array">
168-
<item name="components" xsi:type="array">
169-
<item name="checkout" xsi:type="array">
170-
<item name="children" xsi:type="array">
171-
<item name="steps" xsi:type="array">
172-
<item name="children" xsi:type="array">
173-
<!-- The new step you add -->
174-
<item name="my-new-step" xsi:type="array">
175-
<item name="component" xsi:type="string">%Vendor%_%Module%/js/view/my-step-view</item>
176-
<!--To display step content before shipping step "sortOrder" value should be < 1-->
177-
<!--To display step content between shipping step and payment step 1 < "sortOrder" < 2 -->
178-
<!--To display step content after payment step "sortOrder" > 2 -->
179-
<item name="sortOrder" xsi:type="string">2</item>
180-
<item name="children" xsi:type="array">
181-
<!--add here child component declaration for your step-->
182-
</item>
156+
<arguments>
157+
<argument name="jsLayout" xsi:type="array">
158+
<item name="components" xsi:type="array">
159+
<item name="checkout" xsi:type="array">
160+
<item name="children" xsi:type="array">
161+
<item name="steps" xsi:type="array">
162+
<item name="children" xsi:type="array">
163+
<!-- The new step you add -->
164+
<item name="my-new-step" xsi:type="array">
165+
<item name="component" xsi:type="string">%Vendor%_%Module%/js/view/my-step-view</item>
166+
<!--To display step content before shipping step "sortOrder" value should be < 1-->
167+
<!--To display step content between shipping step and payment step 1 < "sortOrder" < 2 -->
168+
<!--To display step content after payment step "sortOrder" > 2 -->
169+
<item name="sortOrder" xsi:type="string">2</item>
170+
<item name="children" xsi:type="array">
171+
<!--add here child component declaration for your step-->
183172
</item>
184173
</item>
185174
</item>
186175
</item>
187176
</item>
188177
</item>
189-
</argument>
190-
</arguments>
178+
</item>
179+
</argument>
180+
</arguments>
191181
</referenceBlock>
192182
</body>
193183
</page>
194184
```
195185

196186
## Step 3: Create mixins for payment and shipping steps (optional) {#create-mixin}
197187

198-
If your new step is the first step, you have to create mixins for the payment and shipping steps. Otherwise two steps will be activated on loading of the checkout.
188+
If your new step is the first step, you have to create mixins for the payment and shipping steps. Otherwise, two steps will be activated on the loading of the checkout.
199189

200190
Create a mixin as follows:
201191

@@ -219,28 +209,27 @@ Create a mixin as follows:
219209
1. Create the mixin. We'll use the same mixin for both payment and shipping:
220210

221211
```js
222-
define(
223-
[
224-
'ko'
225-
], function (ko) {
226-
'use strict';
227-
228-
var mixin = {
229-
230-
initialize: function () {
231-
this.isVisible = ko.observable(false); // set visible to be initially false to have your step show first
232-
this._super();
233-
234-
return this;
235-
}
236-
};
237-
238-
return function (target) {
239-
return target.extend(mixin);
240-
};
241-
}
242-
);
212+
define([
213+
'ko'
214+
], function (ko) {
215+
'use strict';
216+
217+
var mixin = {
218+
219+
initialize: function () {
220+
// set visible to be initially false to have your step show first
221+
this.isVisible = ko.observable(false);
222+
this._super();
223+
224+
return this;
225+
}
226+
};
227+
228+
return function (target) {
229+
return target.extend(mixin);
230+
};
231+
});
243232
```
244233

245-
{:.bs-callout-info}
234+
{:.bs-callout-info}
246235
For your changes to be applied, you might need to [clean layout cache]({{ page.baseurl }}/config-guide/cli/config-cli-subcommands-cache.html ) and [static view file cache]({{ page.baseurl }}/frontend-dev-guide/cache_for_frontdevs.html#clean_static_cache). For more info on mixins, see [JS Mixins]({{ page.baseurl }}/javascript-dev-guide/javascript/js_mixins.html).

src/guides/v2.4/graphql/mutations/create-product-review.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,13 @@ Attribute | Data Type | Description
118118
### ProductReview attributes {#ProductReview}
119119

120120
{% include graphql/product-review.md %}
121+
122+
## Errors
123+
124+
Error | Description
125+
--- | ---
126+
`Field nickname of required type String! was not provided.` | The required attribute `nickname` is missing.
127+
`Field sku of required type String! was not provided.` | The required attribute `sku` is missing.
128+
`Field summary of required type String! was not provided.` | The required attribute `summary` is missing.
129+
`Field text of required type String! was not provided.` | The required attribute `text` is missing.
130+
`Field ratings of required type ProductReviewRatingInput! was not provided.` | The required attribute `ratings` is missing.

src/guides/v2.4/graphql/queries/cart.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,3 +829,11 @@ Attribute | Data Type | Description
829829
* [setShippingMethodsOnCart mutation]({{page.baseurl}}/graphql/mutations/set-shipping-method.html)
830830
* [setBillingAddressOnCart mutation]({{page.baseurl}}/graphql/mutations/set-billing-address.html)
831831
* [setPaymentMethodOnCart mutation]({{page.baseurl}}/graphql/mutations/set-payment-method.html)
832+
833+
## Errors
834+
835+
Error | Description
836+
--- | ---
837+
`Could not find a cart with ID \"xxxxx\"` | The ID provided in the `cart_id` field is invalid or the cart does not exist for the customer.
838+
`The cart isn't active` | The cart with the specified cart ID is unavailable, because the items have been purchased and the cart ID becomes inactive.
839+
`Field cart.cart_id of required type String! was not provided` | The value specified in the `cart.cart_id` argument is empty.

0 commit comments

Comments
 (0)