Skip to content

Commit 6252325

Browse files
Merge branch 2.3-develop into ENGCOM-4214-magento-magento2-21129
2 parents 2a42823 + 49a25f2 commit 6252325

File tree

164 files changed

+4819
-564
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+4819
-564
lines changed

app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ public function getChildren($item)
100100
}
101101

102102
/**
103+
* Check if item can be shipped separately
104+
*
103105
* @param mixed $item
104106
* @return bool
105107
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
@@ -136,6 +138,8 @@ public function isShipmentSeparately($item = null)
136138
}
137139

138140
/**
141+
* Check if child items calculated
142+
*
139143
* @param mixed $item
140144
* @return bool
141145
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
@@ -174,6 +178,8 @@ public function isChildCalculated($item = null)
174178
}
175179

176180
/**
181+
* Retrieve selection attributes values
182+
*
177183
* @param mixed $item
178184
* @return mixed|null
179185
*/
@@ -191,6 +197,8 @@ public function getSelectionAttributes($item)
191197
}
192198

193199
/**
200+
* Retrieve order item options array
201+
*
194202
* @return array
195203
*/
196204
public function getOrderOptions()
@@ -212,6 +220,8 @@ public function getOrderOptions()
212220
}
213221

214222
/**
223+
* Retrieve order item
224+
*
215225
* @return mixed
216226
*/
217227
public function getOrderItem()
@@ -223,6 +233,8 @@ public function getOrderItem()
223233
}
224234

225235
/**
236+
* Get html info for item
237+
*
226238
* @param mixed $item
227239
* @return string
228240
*/
@@ -245,6 +257,8 @@ public function getValueHtml($item)
245257
}
246258

247259
/**
260+
* Check if we can show price info for this item
261+
*
248262
* @param object $item
249263
* @return bool
250264
*/

app/code/Magento/Bundle/view/adminhtml/templates/sales/invoice/create/items/renderer.phtml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@
2828
<?php endif; ?>
2929

3030
<?php foreach ($items as $_item): ?>
31+
<?php
32+
$shipTogether = ($_item->getOrderItem()->getProductType() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) ?
33+
!$_item->getOrderItem()->isShipSeparately() : !$_item->getOrderItem()->getParentItem()->isShipSeparately()
34+
?>
3135
<?php $block->setPriceDataObject($_item) ?>
3236
<?php if ($_item->getOrderItem()->getParentItem()): ?>
37+
<?php
38+
if ($shipTogether) {
39+
continue;
40+
}
41+
?>
3342
<?php $attributes = $block->getSelectionAttributes($_item) ?>
3443
<?php if ($_prevOptionId != $attributes['option_id']): ?>
3544
<tr>
@@ -60,14 +69,14 @@
6069
</td>
6170
<?php endif; ?>
6271
<td class="col-price">
63-
<?php if ($block->canShowPriceInfo($_item)): ?>
72+
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
6473
<?= $block->getColumnHtml($_item, 'price') ?>
6574
<?php else: ?>
6675
&nbsp;
6776
<?php endif; ?>
6877
</td>
6978
<td class="col-qty">
70-
<?php if ($block->canShowPriceInfo($_item)): ?>
79+
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
7180
<table class="qty-table">
7281
<tr>
7382
<th><?= /* @escapeNotVerified */ __('Ordered') ?></th>
@@ -116,7 +125,7 @@
116125
<?php endif; ?>
117126
</td>
118127
<td class="col-qty-invoice">
119-
<?php if ($block->canShowPriceInfo($_item)): ?>
128+
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
120129
<?php if ($block->canEditQty()) : ?>
121130
<input type="text"
122131
class="input-text admin__control-text qty-input"

app/code/Magento/BundleGraphQl/Model/BundleProductTypeResolver.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@
88
namespace Magento\BundleGraphQl\Model;
99

1010
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface;
11+
use Magento\Bundle\Model\Product\Type as Type;
1112

1213
/**
13-
* {@inheritdoc}
14+
* @inheritdoc
1415
*/
1516
class BundleProductTypeResolver implements TypeResolverInterface
1617
{
18+
const BUNDLE_PRODUCT = 'BundleProduct';
19+
1720
/**
18-
* {@inheritdoc}
21+
* @inheritdoc
1922
*/
2023
public function resolveType(array $data) : string
2124
{
22-
if (isset($data['type_id']) && $data['type_id'] == 'bundle') {
23-
return 'BundleProduct';
25+
if (isset($data['type_id']) && $data['type_id'] == Type::TYPE_CODE) {
26+
return self::BUNDLE_PRODUCT;
2427
}
2528
return '';
2629
}

app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public function getCategory()
6767
}
6868

6969
/**
70+
* Get category id
71+
*
7072
* @return int|string|null
7173
*/
7274
public function getCategoryId()
@@ -78,6 +80,8 @@ public function getCategoryId()
7880
}
7981

8082
/**
83+
* Get category name
84+
*
8185
* @return string
8286
*/
8387
public function getCategoryName()
@@ -86,6 +90,8 @@ public function getCategoryName()
8690
}
8791

8892
/**
93+
* Get category path
94+
*
8995
* @return mixed
9096
*/
9197
public function getCategoryPath()
@@ -97,6 +103,8 @@ public function getCategoryPath()
97103
}
98104

99105
/**
106+
* Check store root category
107+
*
100108
* @return bool
101109
*/
102110
public function hasStoreRootCategory()
@@ -109,6 +117,8 @@ public function hasStoreRootCategory()
109117
}
110118

111119
/**
120+
* Get store from request
121+
*
112122
* @return Store
113123
*/
114124
public function getStore()
@@ -118,6 +128,8 @@ public function getStore()
118128
}
119129

120130
/**
131+
* Get root category for tree
132+
*
121133
* @param mixed|null $parentNodeCategory
122134
* @param int $recursionLevel
123135
* @return Node|array|null
@@ -149,10 +161,11 @@ public function getRoot($parentNodeCategory = null, $recursionLevel = 3)
149161

150162
$root = $tree->getNodeById($rootId);
151163

152-
if ($root && $rootId != \Magento\Catalog\Model\Category::TREE_ROOT_ID) {
164+
if ($root) {
153165
$root->setIsVisible(true);
154-
} elseif ($root && $root->getId() == \Magento\Catalog\Model\Category::TREE_ROOT_ID) {
155-
$root->setName(__('Root'));
166+
if ($root->getId() == \Magento\Catalog\Model\Category::TREE_ROOT_ID) {
167+
$root->setName(__('Root'));
168+
}
156169
}
157170

158171
$this->_coreRegistry->register('root', $root);
@@ -162,6 +175,8 @@ public function getRoot($parentNodeCategory = null, $recursionLevel = 3)
162175
}
163176

164177
/**
178+
* Get Default Store Id
179+
*
165180
* @return int
166181
*/
167182
protected function _getDefaultStoreId()
@@ -170,6 +185,8 @@ protected function _getDefaultStoreId()
170185
}
171186

172187
/**
188+
* Get category collection
189+
*
173190
* @return \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
174191
*/
175192
public function getCategoryCollection()
@@ -227,6 +244,8 @@ public function getRootByIds($ids)
227244
}
228245

229246
/**
247+
* Get category node for tree
248+
*
230249
* @param mixed $parentNodeCategory
231250
* @param int $recursionLevel
232251
* @return Node
@@ -249,6 +268,8 @@ public function getNode($parentNodeCategory, $recursionLevel = 2)
249268
}
250269

251270
/**
271+
* Get category save url
272+
*
252273
* @param array $args
253274
* @return string
254275
*/
@@ -260,6 +281,8 @@ public function getSaveUrl(array $args = [])
260281
}
261282

262283
/**
284+
* Get category edit url
285+
*
263286
* @return string
264287
*/
265288
public function getEditUrl()

app/code/Magento/Catalog/Model/CategoryList.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use Magento\Framework\Api\SearchCriteriaInterface;
1616
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface;
1717

18+
/**
19+
* Class for getting category list.
20+
*/
1821
class CategoryList implements CategoryListInterface
1922
{
2023
/**
@@ -64,7 +67,7 @@ public function __construct(
6467
}
6568

6669
/**
67-
* {@inheritdoc}
70+
* @inheritdoc
6871
*/
6972
public function getList(SearchCriteriaInterface $searchCriteria)
7073
{
@@ -73,10 +76,11 @@ public function getList(SearchCriteriaInterface $searchCriteria)
7376
$this->extensionAttributesJoinProcessor->process($collection);
7477

7578
$this->collectionProcessor->process($searchCriteria, $collection);
79+
$collection->load();
7680

7781
$items = [];
78-
foreach ($collection->getAllIds() as $id) {
79-
$items[] = $this->categoryRepository->get($id);
82+
foreach ($collection->getItems() as $category) {
83+
$items[] = $this->categoryRepository->get($category->getId());
8084
}
8185

8286
/** @var CategorySearchResultsInterface $searchResult */

app/code/Magento/Catalog/Model/Product/Option/Repository.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use Magento\Framework\App\ObjectManager;
1515

1616
/**
17+
* Product custom options repository
18+
*
1719
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1820
*/
1921
class Repository implements \Magento\Catalog\Api\ProductCustomOptionRepositoryInterface
@@ -83,7 +85,7 @@ public function __construct(
8385
}
8486

8587
/**
86-
* {@inheritdoc}
88+
* @inheritdoc
8789
*/
8890
public function getList($sku)
8991
{
@@ -92,7 +94,7 @@ public function getList($sku)
9294
}
9395

9496
/**
95-
* {@inheritdoc}
97+
* @inheritdoc
9698
*/
9799
public function getProductOptions(ProductInterface $product, $requiredOnly = false)
98100
{
@@ -104,7 +106,7 @@ public function getProductOptions(ProductInterface $product, $requiredOnly = fal
104106
}
105107

106108
/**
107-
* {@inheritdoc}
109+
* @inheritdoc
108110
*/
109111
public function get($sku, $optionId)
110112
{
@@ -117,7 +119,7 @@ public function get($sku, $optionId)
117119
}
118120

119121
/**
120-
* {@inheritdoc}
122+
* @inheritdoc
121123
*/
122124
public function delete(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $entity)
123125
{
@@ -126,7 +128,7 @@ public function delete(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $e
126128
}
127129

128130
/**
129-
* {@inheritdoc}
131+
* @inheritdoc
130132
*/
131133
public function duplicate(
132134
\Magento\Catalog\Api\Data\ProductInterface $product,
@@ -142,7 +144,7 @@ public function duplicate(
142144
}
143145

144146
/**
145-
* {@inheritdoc}
147+
* @inheritdoc
146148
*/
147149
public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $option)
148150
{
@@ -184,7 +186,7 @@ public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $opt
184186
}
185187

186188
/**
187-
* {@inheritdoc}
189+
* @inheritdoc
188190
*/
189191
public function deleteByIdentifier($sku, $optionId)
190192
{
@@ -209,8 +211,8 @@ public function deleteByIdentifier($sku, $optionId)
209211
/**
210212
* Mark original values for removal if they are absent among new values
211213
*
212-
* @param $newValues array
213-
* @param $originalValues \Magento\Catalog\Model\Product\Option\Value[]
214+
* @param array $newValues
215+
* @param \Magento\Catalog\Model\Product\Option\Value[] $originalValues
214216
* @return array
215217
*/
216218
protected function markRemovedValues($newValues, $originalValues)
@@ -234,6 +236,8 @@ protected function markRemovedValues($newValues, $originalValues)
234236
}
235237

236238
/**
239+
* Get hydrator pool
240+
*
237241
* @return \Magento\Framework\EntityManager\HydratorPool
238242
* @deprecated 101.0.0
239243
*/

app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,19 @@ public function __construct(
2828
}
2929

3030
/**
31+
* Perform action on relation/extension attribute
32+
*
3133
* @param object $entity
3234
* @param array $arguments
3335
* @return \Magento\Catalog\Api\Data\ProductInterface|object
3436
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3537
*/
3638
public function execute($entity, $arguments = [])
3739
{
40+
if ($entity->getOptionsSaved()) {
41+
return $entity;
42+
}
43+
3844
$options = $entity->getOptions();
3945
$optionIds = [];
4046

0 commit comments

Comments
 (0)