Skip to content

Commit 147c0f7

Browse files
Merge branch '2.4-develop' into MC-25187
2 parents 68770d1 + ad6c093 commit 147c0f7

File tree

78 files changed

+2426
-396
lines changed

Some content is hidden

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

78 files changed

+2426
-396
lines changed

app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<field id="search_suggestion_enabled">1</field>
6161
</depends>
6262
</field>
63-
<field id="search_suggestion_count_results_enabled" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1">
63+
<field id="search_suggestion_count_results_enabled" translate="label comment" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1">
6464
<label>Show Results Count for Each Suggestion</label>
6565
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
6666
<comment>When you enable this option your site may slow down.</comment>

app/code/Magento/Analytics/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<frontend_model>Magento\Analytics\Block\Adminhtml\System\Config\CollectionTimeLabel</frontend_model>
3030
<backend_model>Magento\Analytics\Model\Config\Backend\CollectionTime</backend_model>
3131
</field>
32-
<field id="vertical" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
32+
<field id="vertical" translate="hint label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
3333
<hint>Industry Data</hint>
3434
<label>Industry</label>
3535
<comment>In order to personalize your Advanced Reporting experience, please select your industry.</comment>

app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<actionsColumn name="actions" class="\Magento\AsynchronousOperations\Ui\Component\Listing\Column\Actions">
9393
<settings>
9494
<indexField>id</indexField>
95-
<label>Action</label>
95+
<label translate="true">Action</label>
9696
</settings>
9797
</actionsColumn>
9898
</columns>

app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

7-
/**
8-
* Adminhtml catalog product action attribute update helper
9-
*/
108
namespace Magento\Catalog\Helper\Product\Edit\Action;
119

1210
/**
13-
* Class Attribute
11+
* Adminhtml catalog product action attribute update helper.
12+
*
1413
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
14+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1515
*/
1616
class Attribute extends \Magento\Backend\Helper\Data
1717
{
@@ -32,7 +32,7 @@ class Attribute extends \Magento\Backend\Helper\Data
3232
/**
3333
* Excluded from batch update attribute codes
3434
*
35-
* @var string[]
35+
* @var array
3636
*/
3737
protected $_excludedAttributes = ['url_key'];
3838

@@ -92,6 +92,7 @@ public function __construct(
9292

9393
/**
9494
* Return product collection with selected product filter
95+
*
9596
* Product collection didn't load
9697
*
9798
* @return \Magento\Catalog\Model\ResourceModel\Product\Collection
@@ -171,8 +172,8 @@ public function getAttributes()
171172
$this->getProductsSetIds()
172173
);
173174

174-
if ($this->_excludedAttributes) {
175-
$this->_attributes->addFieldToFilter('attribute_code', ['nin' => $this->_excludedAttributes]);
175+
if ($excludedAttributes = $this->getExcludedAttributes()) {
176+
$this->_attributes->addFieldToFilter('attribute_code', ['nin' => $excludedAttributes]);
176177
}
177178

178179
// check product type apply to limitation and remove attributes that impossible to change in mass-update
@@ -193,11 +194,24 @@ public function getAttributes()
193194
}
194195

195196
/**
197+
* Gets website id.
198+
*
196199
* @param int $storeId
197200
* @return int
201+
* @throws \Magento\Framework\Exception\NoSuchEntityException
198202
*/
199203
public function getStoreWebsiteId($storeId)
200204
{
201205
return $this->_storeManager->getStore($storeId)->getWebsiteId();
202206
}
207+
208+
/**
209+
* Retrieve excluded attributes.
210+
*
211+
* @return array
212+
*/
213+
public function getExcludedAttributes(): array
214+
{
215+
return $this->_excludedAttributes;
216+
}
203217
}

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
<argument name="category" value="$$createPreReqCategory$$"/>
3232
<argument name="simpleProduct" value="ProductWithUnicode"/>
3333
</actionGroup>
34+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
35+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
3436
<actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="assertProductInStorefront1">
3537
<argument name="category" value="$$createPreReqCategory$$"/>
3638
<argument name="product" value="ProductWithUnicode"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
userInput="$$createProduct1.name$$" stepKey="seeProductName4"/>
132132
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
133133
userInput="$$createProduct12.name$$" stepKey="seeProductName5"/>
134-
<waitForText userInput="$$createCategory.name$$ (ID: 6) (2)" stepKey="seeCorrectProductCount"/>
135134
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
136135
userInput="$$createProduct0.name$$" stepKey="dontSeeProductName"/>
137136
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
@@ -151,7 +150,6 @@
151150
userInput="$$createProduct2.name$$" stepKey="seeProductName6"/>
152151
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
153152
userInput="$$createProduct12.name$$" stepKey="seeProductName7"/>
154-
<waitForText userInput="$$createCategory.name$$ (ID: 6) (2)" stepKey="seeCorrectProductCount2"/>
155153
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
156154
userInput="$$createProduct0.name$$" stepKey="dontSeeProductName2"/>
157155
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"

app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
88
// phpcs:disable Generic.WhiteSpace.ScopeIndent.Incorrect
9+
// phpcs:disable Generic.Files.LineLength
10+
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundHelper
911

1012
/* @var $block \Magento\Catalog\Block\Product\AbstractProduct */
1113
?>
@@ -23,6 +25,7 @@ switch ($type = $block->getType()) {
2325
$items = $block->getAllItems();
2426
$limit = $block->getPositionLimit();
2527
$shuffle = (int) $block->isShuffled();
28+
$isWeightedRandom = (int) $block->getRotation()->isWeightedRandom($block->getProductListType());
2629
$canItemsAddToCart = $block->canItemsAddToCart();
2730

2831
$showAddTo = true;
@@ -43,6 +46,7 @@ switch ($type = $block->getType()) {
4346
$items = $block->getItems();
4447
$limit = 0;
4548
$shuffle = 0;
49+
$isWeightedRandom = 0;
4650
$canItemsAddToCart = $block->canItemsAddToCart();
4751

4852
$showAddTo = true;
@@ -62,6 +66,7 @@ switch ($type = $block->getType()) {
6266
$items = $block->getAllItems();
6367
$limit = $block->getPositionLimit();
6468
$shuffle = (int) $block->isShuffled();
69+
$isWeightedRandom = (int) $block->getRotation()->isWeightedRandom($block->getProductListType());
6570

6671
$showAddTo = false;
6772
$showCart = false;
@@ -82,6 +87,7 @@ switch ($type = $block->getType()) {
8287
$items = $block->getItemCollection()->getItems();
8388
$limit = $block->getItemLimit('upsell');
8489
$shuffle = 0;
90+
$isWeightedRandom = 0;
8591

8692
$showAddTo = false;
8793
$showCart = false;
@@ -152,39 +158,39 @@ switch ($type = $block->getType()) {
152158
}
153159
?>
154160

155-
<?php if ($exist) :?>
161+
<?php if ($exist):?>
156162

157-
<?php if ($type == 'related' || $type == 'upsell') :?>
158-
<?php if ($type == 'related') :?>
159-
<div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>">
160-
<?php else :?>
161-
<div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"upsellProducts":{}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>">
163+
<?php if ($type == 'related' || $type == 'upsell'):?>
164+
<?php if ($type == 'related'):?>
165+
<div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>" data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>">
166+
<?php else:?>
167+
<div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"upsellProducts":{}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>" data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>">
162168
<?php endif; ?>
163-
<?php else :?>
169+
<?php else:?>
164170
<div class="block <?= $block->escapeHtmlAttr($class) ?>">
165171
<?php endif; ?>
166172
<div class="block-title title">
167173
<strong id="block-<?= $block->escapeHtmlAttr($class) ?>-heading" role="heading" aria-level="2"><?= $block->escapeHtml($title) ?></strong>
168174
</div>
169175
<div class="block-content content" aria-labelledby="block-<?= $block->escapeHtmlAttr($class) ?>-heading">
170-
<?php if ($type == 'related' && $canItemsAddToCart) :?>
176+
<?php if ($type == 'related' && $canItemsAddToCart):?>
171177
<div class="block-actions">
172178
<?= $block->escapeHtml(__('Check items to add to the cart or')) ?>
173179
<button type="button" class="action select" data-role="select-all"><span><?= $block->escapeHtml(__('select all')) ?></span></button>
174180
</div>
175181
<?php endif; ?>
176182
<div class="products wrapper grid products-grid products-<?= $block->escapeHtmlAttr($type) ?>">
177183
<ol class="products list items product-items">
178-
<?php foreach ($items as $_item) :?>
184+
<?php foreach ($items as $_item):?>
179185
<?php $available = ''; ?>
180-
<?php if (!$_item->isComposite() && $_item->isSaleable() && $type == 'related') :?>
181-
<?php if (!$_item->getRequiredOptions()) :?>
186+
<?php if (!$_item->isComposite() && $_item->isSaleable() && $type == 'related'):?>
187+
<?php if (!$_item->getRequiredOptions()):?>
182188
<?php $available = 'related-available'; ?>
183189
<?php endif; ?>
184190
<?php endif; ?>
185-
<?php if ($type == 'related' || $type == 'upsell') :?>
186-
<li class="item product product-item" style="display: none;">
187-
<?php else :?>
191+
<?php if ($type == 'related' || $type == 'upsell'):?>
192+
<li class="item product product-item" style="display: none;" data-shuffle-group="<?= $block->escapeHtmlAttr($_item->getPriority()) ?>" >
193+
<?php else:?>
188194
<li class="item product product-item">
189195
<?php endif; ?>
190196
<div class="product-item-info <?= /* @noEscape */ $available ?>">
@@ -199,29 +205,29 @@ switch ($type = $block->getType()) {
199205

200206
<?= /* @noEscape */ $block->getProductPrice($_item) ?>
201207

202-
<?php if ($templateType) :?>
208+
<?php if ($templateType):?>
203209
<?= $block->getReviewsSummaryHtml($_item, $templateType) ?>
204210
<?php endif; ?>
205211

206-
<?php if ($canItemsAddToCart && !$_item->isComposite() && $_item->isSaleable() && $type == 'related') :?>
207-
<?php if (!$_item->getRequiredOptions()) :?>
212+
<?php if ($canItemsAddToCart && !$_item->isComposite() && $_item->isSaleable() && $type == 'related'):?>
213+
<?php if (!$_item->getRequiredOptions()):?>
208214
<div class="field choice related">
209215
<input type="checkbox" class="checkbox related" id="related-checkbox<?= $block->escapeHtmlAttr($_item->getId()) ?>" name="related_products[]" value="<?= $block->escapeHtmlAttr($_item->getId()) ?>" />
210216
<label class="label" for="related-checkbox<?= $block->escapeHtmlAttr($_item->getId()) ?>"><span><?= $block->escapeHtml(__('Add to Cart')) ?></span></label>
211217
</div>
212218
<?php endif; ?>
213219
<?php endif; ?>
214220

215-
<?php if ($showAddTo || $showCart) :?>
221+
<?php if ($showAddTo || $showCart):?>
216222
<div class="product actions product-item-actions">
217-
<?php if ($showCart) :?>
223+
<?php if ($showCart):?>
218224
<div class="actions-primary">
219-
<?php if ($_item->isSaleable()) :?>
220-
<?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)) :?>
225+
<?php if ($_item->isSaleable()):?>
226+
<?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)):?>
221227
<button class="action tocart primary" data-mage-init='{"redirectUrl": {"url": "<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
222228
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
223229
</button>
224-
<?php else :?>
230+
<?php else:?>
225231
<?php $postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class);
226232
$postData = $postDataHelper->getPostData($block->escapeUrl($block->getAddToCartUrl($_item)), ['product' => $_item->getEntityId()])
227233
?>
@@ -231,19 +237,19 @@ switch ($type = $block->getType()) {
231237
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
232238
</button>
233239
<?php endif; ?>
234-
<?php else :?>
235-
<?php if ($_item->getIsSalable()) :?>
240+
<?php else:?>
241+
<?php if ($_item->getIsSalable()):?>
236242
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
237-
<?php else :?>
243+
<?php else:?>
238244
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
239245
<?php endif; ?>
240246
<?php endif; ?>
241247
</div>
242248
<?php endif; ?>
243249

244-
<?php if ($showAddTo) :?>
250+
<?php if ($showAddTo):?>
245251
<div class="secondary-addto-links actions-secondary" data-role="add-to-links">
246-
<?php if ($addToBlock = $block->getChildBlock('addto')) :?>
252+
<?php if ($addToBlock = $block->getChildBlock('addto')):?>
247253
<?= $addToBlock->setProduct($_item)->getChildHtml() ?>
248254
<?php endif; ?>
249255
</div>

0 commit comments

Comments
 (0)