Skip to content

Commit 2b85a2c

Browse files
author
Vitaliy Boyko
committed
graphQl-786: fixed the quantity field in the bundle product
1 parent 7ffabd0 commit 2b85a2c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private function fetch() : array
117117
'price' => $link->getSelectionPriceValue(),
118118
'position' => $link->getPosition(),
119119
'id' => $link->getSelectionId(),
120-
'qty' => (int)$link->getSelectionQty(),
120+
'quantity' => (int)$link->getSelectionQty(),
121121
'is_default' => (bool)$link->getIsDefault(),
122122
'price_type' => $this->enumLookup->getEnumValueFromField(
123123
'PriceTypeEnum',

app/code/Magento/BundleGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type BundleItem @doc(description: "BundleItem defines an individual item in a bu
1414
type BundleItemOption @doc(description: "BundleItemOption defines characteristics and options for a specific bundle item.") {
1515
id: Int @doc(description: "The ID assigned to the bundled item option.")
1616
label: String @doc(description: "The text that identifies the bundled item option.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\Label")
17-
qty: Float @doc(description: "Indicates the quantity of this specific bundle item.")
17+
quantity: Float @doc(description: "Indicates the quantity of this specific bundle item.")
1818
position: Int @doc(description: "When a bundle item contains multiple options, the relative position of this option compared to the other options.")
1919
is_default: Boolean @doc(description: "Indicates whether this option is the default option.")
2020
price: Float @doc(description: "The price of the selected option.")

dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testAllFieldsBundleProducts()
5858
sku
5959
options {
6060
id
61-
qty
61+
quantity
6262
position
6363
is_default
6464
price
@@ -143,7 +143,7 @@ public function testBundleProductWithNotVisibleChildren()
143143
sku
144144
options {
145145
id
146-
qty
146+
quantity
147147
position
148148
is_default
149149
price
@@ -269,7 +269,7 @@ private function assertBundleProductOptions($product, $actualResponse)
269269
$actualResponse['items'][0]['options'][0],
270270
[
271271
'id' => $bundleProductLink->getId(),
272-
'qty' => (int)$bundleProductLink->getQty(),
272+
'quantity' => (int)$bundleProductLink->getQty(),
273273
'position' => $bundleProductLink->getPosition(),
274274
'is_default' => (bool)$bundleProductLink->getIsDefault(),
275275
'price_type' => self::KEY_PRICE_TYPE_FIXED,

0 commit comments

Comments
 (0)