Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit ac97d6a

Browse files
committed
magento/magento2#9342: Add BundleImportExport selection_can_change_qty support
1 parent f0a5305 commit ac97d6a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/code/Magento/BundleImportExport/Model/Export/RowCustomizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ protected function getFormattedBundleSelections($optionValues, SelectionCollecti
242242
'price' => $selection->getSelectionPriceValue(),
243243
'default' => $selection->getIsDefault(),
244244
'default_qty' => $selection->getSelectionQty(),
245-
'price_type' => $this->getPriceTypeValue($selection->getSelectionPriceType())
245+
'price_type' => $this->getPriceTypeValue($selection->getSelectionPriceType()),
246+
'can_change_qty' => $selection->getSelectionCanChangeQty(),
246247
];
247248
$bundleData .= $optionValues
248249
. ImportModel::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR

app/code/Magento/BundleImportExport/Test/Unit/Model/Export/Product/RowCustomizerTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,13 @@ protected function setUp()
105105
);
106106
$this->selection = $this->createPartialMock(
107107
\Magento\Catalog\Model\Product::class,
108-
['getSku', 'getSelectionPriceValue', 'getIsDefault', 'getSelectionQty', 'getSelectionPriceType']
108+
['getSku', 'getSelectionPriceValue', 'getIsDefault', 'getSelectionQty', 'getSelectionPriceType', 'getSelectionCanChangeQty']
109109
);
110110
$this->selection->expects($this->any())->method('getSku')->willReturn(1);
111111
$this->selection->expects($this->any())->method('getSelectionPriceValue')->willReturn(1);
112112
$this->selection->expects($this->any())->method('getSelectionQty')->willReturn(1);
113113
$this->selection->expects($this->any())->method('getSelectionPriceType')->willReturn(1);
114+
$this->selection->expects($this->any())->method('getSelectionCanChangeQty')->willReturn(1);
114115
$this->selectionsCollection = $this->createPartialMock(
115116
\Magento\Bundle\Model\ResourceModel\Selection\Collection::class,
116117
['getIterator', 'addAttributeToSort']
@@ -176,7 +177,7 @@ public function testAddData()
176177
'bundle_sku_type' => 'fixed',
177178
'bundle_price_view' => 'As low as',
178179
'bundle_weight_type' => 'fixed',
179-
'bundle_values' => 'name=title,type=1,required=1,sku=1,price=1,default=,default_qty=1,price_type=percent'
180+
'bundle_values' => 'name=title,type=1,required=1,sku=1,price=1,default=,default_qty=1,price_type=percent,can_change_qty=1'
180181
];
181182
$this->assertEquals($expected, $preparedRow);
182183
}

0 commit comments

Comments
 (0)