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

Commit 3d8345b

Browse files
authored
Merge branch 'develop' into dobooth-patch-1
2 parents 731b1ae + 63b66d5 commit 3d8345b

File tree

12 files changed

+458
-214
lines changed

12 files changed

+458
-214
lines changed

_data/toc/graphql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ pages:
121121
- label: Using mutations
122122
url: /graphql/mutations/index.html
123123

124+
- label: addBundleProductsToCart mutation
125+
url: /graphql/mutations/add-bundle-products.html
126+
124127
- label: addConfigurableProductsToCart mutation
125128
url: /graphql/mutations/add-configurable-products.html
126129

_includes/graphql/customer-output.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ Attribute | Data Type | Description
1717
`prefix` | String | An honorific, such as Dr., Mr., or Mrs.
1818
`suffix` | String | A value such as Sr., Jr., or III
1919
`taxvat` | String | The customer's Tax/VAT number (for corporate customers)
20+
`wishlist` | Wishlist! | Contains the contents of the customer's wish lists
2021

2122
{% include graphql/customer-address-output.md %}

guides/v2.3/frontend-dev-guide/layouts/xml-manage.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,42 @@ You can remove navigation links from the 'My Account' dashboard on the storefron
552552
<referenceBlock name="customer-account-navigation-return-history-link" remove="true"/>
553553
```
554554

555+
## Create cms-page/product/category-specific layouts
556+
557+
As of Magento 2.3.4, merchants can select layout updates to be applied to specific Category/Product/CMS Page pages on the frontend. These layout
558+
updates are made by creating layout XML files following specific naming conventions.
559+
560+
For Categories:
561+
562+
- `catalog_category_view_selectable_<Category ID>_<Layout Update Name>.xml`
563+
564+
where:
565+
566+
- _Category ID_ is desired category ID
567+
- _Layout Update Name_ is what is shown as the option for __Custom layout update__ field of __Design__ section on _Category Edit_ page.
568+
569+
For Products:
570+
571+
- `catalog_product_view_selectable_<Product SKU>_<Layout Update Name>.xml`
572+
573+
where:
574+
575+
- _Product SKU_ is the desired product's SKU encoded as a URI.
576+
_example_: "My Product SKU" -> "My%20Product%20SKU"
577+
- _Layout Update Name_ is what is shown as the option for __Custom layout update__ field of __Design__ section on _Product Edit_ page
578+
579+
For CMS Pages:
580+
581+
- `cms_page_view_selectable_<CMS Page Identifier>_<Layout Update Name>.xml`
582+
583+
where:
584+
585+
- _CMS Page Identifier_ is the desired page's _URL Key_ with "/" symbols replaced with "_"
586+
- _Layout Update Name_ is what is shown as the option for __Custom layout update__ field of __Design__
587+
section on _CMS Page Edit_ page
588+
589+
These files must be placed in the appropriate folders for layout XML files. They will be available as __Custom Layout Update__ options for Merchants after flushing the cache.
590+
555591
{:.ref-header}
556592
Related topics
557593

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
---
2+
group: graphql
3+
title: addBundleProductsToCart mutation
4+
contributor_name: Atwix
5+
contributor_link: https://www.atwix.com/
6+
---
7+
8+
Use the `addBundleProductsToCart` mutation to add bundle products to a specific cart.
9+
10+
## Syntax
11+
12+
`mutation: {addBundleProductsToCart(input: AddBundleProductsToCartInput): {AddBundleProductsToCartOutput}}`
13+
14+
## Example usage
15+
16+
The following example uses a bundle product "Sprite Yoga Companion Kit" from Magento sample data.
17+
The SKU of this product is: **24-WG080**
18+
19+
This example adds one bundle product with following children to the specified shopping cart:
20+
21+
- Sprite Stasis Ball 65 cm (x1)
22+
- Sprite Foam Yoga Brick (x2)
23+
- Sprite Yoga Strap 10 foot (x1)
24+
- Sprite Foam Roller (x1)
25+
26+
The `cart_id` used in this example was [generated]({{ page.baseurl }}/graphql/mutations/create-empty-cart.html) by creating an empty cart.
27+
28+
**Request**
29+
30+
```graphql
31+
mutation {
32+
addBundleProductsToCart(
33+
input: {
34+
cart_id: "wARFaDnHva0tgzuforUYR4rvXincj5eu"
35+
cart_items: [
36+
{
37+
data: {
38+
sku: "24-WG080"
39+
quantity: 1
40+
}
41+
bundle_options: [
42+
{
43+
id: 1
44+
quantity: 1
45+
value: [
46+
"2"
47+
]
48+
},
49+
{
50+
id: 2
51+
quantity: 2
52+
value: [
53+
"4"
54+
]
55+
},
56+
{
57+
id: 3
58+
quantity: 1
59+
value: [
60+
"7"
61+
]
62+
},
63+
{
64+
id: 4
65+
quantity: 1
66+
value: [
67+
"8"
68+
]
69+
}
70+
]
71+
},
72+
]
73+
}) {
74+
cart {
75+
items {
76+
id
77+
quantity
78+
product {
79+
sku
80+
}
81+
... on BundleCartItem {
82+
bundle_options {
83+
id
84+
label
85+
type
86+
values {
87+
id
88+
label
89+
price
90+
quantity
91+
}
92+
}
93+
}
94+
}
95+
}
96+
}
97+
}
98+
```
99+
100+
**Response**
101+
102+
```json
103+
{
104+
"data": {
105+
"addBundleProductsToCart": {
106+
"cart": {
107+
"items": [
108+
{
109+
"id": "7",
110+
"quantity": 1,
111+
"product": {
112+
"sku": "24-WG080"
113+
},
114+
"bundle_options": [
115+
{
116+
"id": 1,
117+
"label": "Sprite Stasis Ball",
118+
"type": "radio",
119+
"values": [
120+
{
121+
"id": 2,
122+
"label": "Sprite Stasis Ball 65 cm",
123+
"price": 27,
124+
"quantity": 1
125+
}
126+
]
127+
},
128+
{
129+
"id": 2,
130+
"label": "Sprite Foam Yoga Brick",
131+
"type": "radio",
132+
"values": [
133+
{
134+
"id": 4,
135+
"label": "Sprite Foam Yoga Brick",
136+
"price": 5,
137+
"quantity": 2
138+
}
139+
]
140+
},
141+
{
142+
"id": 3,
143+
"label": "Sprite Yoga Strap",
144+
"type": "radio",
145+
"values": [
146+
{
147+
"id": 7,
148+
"label": "Sprite Yoga Strap 10 foot",
149+
"price": 21,
150+
"quantity": 1
151+
}
152+
]
153+
},
154+
{
155+
"id": 4,
156+
"label": "Sprite Foam Roller",
157+
"type": "radio",
158+
"values": [
159+
{
160+
"id": 8,
161+
"label": "Sprite Foam Roller",
162+
"price": 19,
163+
"quantity": 1
164+
}
165+
]
166+
}
167+
]
168+
}
169+
]
170+
}
171+
}
172+
}
173+
}
174+
```
175+
176+
## Input attributes
177+
178+
The top-level `AddBundleProductsToCartInput` object is listed first. All interfaces and child objects are listed in alphabetical order.
179+
180+
### AddBundleProductsToCartInput object
181+
182+
The `AddBundleProductsToCartInput` object contains the following attributes:
183+
184+
Attribute | Type | Description
185+
--- | --- | ---
186+
`cart_id` | String! | The unique ID that identifies the customer's cart
187+
`cart_items` | [[BundleProductCartItemInput!]](#bundleProductCartItemInput) | An array of bundle items to add to the cart
188+
189+
### BundleProductCartItemInput object {#bundleProductCartItemInput}
190+
191+
The `BundleProductCartItemInput` object contains the following attributes:
192+
193+
Attribute | Type | Description
194+
--- | --- | ---
195+
`bundle_options` | [[BundleOptionInput!]](#bundleOptionInput) | An object that contains an array of options of the bundle product with the chosen value and quantity of each option
196+
`customizable_options` | [[CustomizableOptionInput]](#customOptionInput) | An object that contains the ID and value of the product
197+
`data` | [CartItemInput!](#cartItemInput) | An object that contains the quantity and SKU of the bundle product
198+
199+
### BundleOptionInput object {#bundleOptionInput}
200+
201+
The `BundleOptionInput` object contains the following attributes:
202+
203+
Attribute | Type | Description
204+
--- | --- | ---
205+
`id` | Int! | ID of the option
206+
`quantity` | Float! | The number of a specific child item to add to the cart
207+
`value` | [String!]! | An array with the chosen value of the option
208+
209+
### CartItemInput object {#cartItemInput}
210+
211+
The `CartItemInput` object contains the following attributes:
212+
213+
Attribute | Type | Description
214+
--- | --- | ---
215+
`quantity` | Float! | The number of items to add to the cart
216+
`sku` | String! | The SKU of the product
217+
218+
### CustomizableOptionInput object {#customOptionInput}
219+
220+
The `CustomizableOptionInput` object must contain the following attributes:
221+
222+
{% include graphql/customizable-option-input.md %}
223+
224+
## Output attributes
225+
226+
The `AddBundleProductsToCartOutput` object contains the `Cart` object.
227+
228+
Attribute | Data Type | Description
229+
--- | --- | ---
230+
`cart` |[Cart!](#CartObject) | Describes the contents of the specified shopping cart
231+
232+
### Cart object {#CartObject}
233+
234+
{% include graphql/cart-object.md %}
235+
236+
[Cart query output]({{page.baseurl}}/graphql/queries/cart.html#cart-output) provides more information about the `Cart` object.
237+
238+
## Related topics
239+
240+
- [Bundle product data types]({{page.baseurl}}/graphql/product/bundle-product.html)

guides/v2.3/graphql/mutations/set-billing-address.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ redirect from:
55
- /guides/v2.3/graphql/reference/quote-set-billing-address.html
66
---
77

8-
The `setBillingAddressOnCart` mutation sets the billing address for a specific cart. If you set the `use_for_shipping` attribute to `true`, Magento assigns the same address as the shipping address.
8+
The `setBillingAddressOnCart` mutation sets the billing address for a specific cart. If you set the `same_as_shipping` attribute to `true`, Magento assigns the same address as the shipping address.
99

1010
## Syntax
1111

@@ -35,7 +35,7 @@ mutation {
3535
telephone: "8675309"
3636
save_in_address_book: true
3737
}
38-
use_for_shipping: false
38+
same_as_shipping: false
3939
}
4040
}
4141
) {
@@ -96,7 +96,8 @@ Attribute | Data Type | Description
9696
--- | --- | ---
9797
`address` | [CartAddressInput](#CartAddressInput) | The billing address for the cart
9898
`customer_address_id` | Int | The unique ID that identifies the customer's address
99-
`use_for_shipping` | Boolean | Specifies whether to use the billing address for the shipping address (`True`/`False`)
99+
`same_as_shipping` | Boolean | Specifies whether to use the billing address for the shipping address (`True`/`False`)
100+
`use_for_shipping` | Boolean | Deprecated. Use `same_as_shipping` instead
100101

101102
### CartAddressInput object {#CartAddressInput}
102103

guides/v2.3/graphql/mutations/set-shipping-address.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ redirect from:
88
The `setShippingAddressesOnCart` mutation sets one or more shipping addresses on a specific cart. The shipping address does not need to be specified in the following circumstances:
99

1010
* The cart contains only virtual items
11-
* When you defined the billing address, you set the `use_for_shipping` attribute to `true`. Magento assigns the same address as the shipping address.
11+
* When you defined the billing address, you set the `same_for_shipping` attribute to `true`. Magento assigns the same address as the shipping address.
1212

1313
## Syntax
1414

@@ -92,7 +92,7 @@ The top-level `SetShippingAddressesOnCartInput` object is listed first. All chil
9292
Attribute | Data Type | Description
9393
--- | --- | ---
9494
`cart_id` | String! | The unique ID that identifies the customer's cart
95-
`billing_address` | [ShippingAddressInput!](#ShippingAddressInput) | The billing address for a specific cart
95+
`shipping_addresses` | [ShippingAddressInput!](#ShippingAddressInput) | The shipping address for a specific cart
9696

9797
### CartAddressInput object {#CartAddressInputShip}
9898

0 commit comments

Comments
 (0)