Skip to content

Commit 73dcab5

Browse files
committed
Merge branch '2.4-develop' into MC-29999
2 parents fab00b6 + ba8fae3 commit 73dcab5

File tree

231 files changed

+8883
-1967
lines changed

Some content is hidden

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

231 files changed

+8883
-1967
lines changed

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
<seeInCurrentUrl url="{{AdminLoginPage.url}}" stepKey="seeAdminLoginUrl"/>
2525
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
2626
</test>
27-
</tests>
27+
</tests>

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ define([
269269
*/
270270
onError: function () {
271271
self.showError($t('Payment ' + self.getTitle() + ' can\'t be initialized'));
272+
self.reInitPayPal();
272273
}
273274
}, self.paypalButtonSelector);
274275
},

app/code/Magento/CardinalCommerce/Test/Mftf/Test/AdminCardinalCommerceSettingsHiddenTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="AdminCardinalCommerceSettingsHiddenTest">
1111
<annotations>
12+
<stories value="Cardinal Commerce Settings"/>
1213
<features value="CardinalCommerce"/>
1314
<title value="CardinalCommerce settings hidden" />
1415
<description value="CardinalCommerce config shouldn't be visible if the 3D secure is disabled for Authorize.Net."/>

app/code/Magento/Catalog/Block/Rss/Category.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
use Magento\Framework\Exception\NoSuchEntityException;
1111

1212
/**
13-
* Class Category
14-
*
15-
* @package Magento\Catalog\Block\Rss
13+
* Category feed block
1614
*
1715
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1816
*/

app/code/Magento/Catalog/Block/Rss/Product/NewProducts.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
use Magento\Framework\App\Rss\DataProviderInterface;
99

1010
/**
11-
* Class NewProducts
12-
* @package Magento\Catalog\Block\Rss\Product
11+
* New products feed block
1312
*/
1413
class NewProducts extends \Magento\Framework\View\Element\AbstractBlock implements DataProviderInterface
1514
{
@@ -55,6 +54,8 @@ public function __construct(
5554
}
5655

5756
/**
57+
* Init
58+
*
5859
* @return void
5960
*/
6061
protected function _construct()
@@ -64,15 +65,15 @@ protected function _construct()
6465
}
6566

6667
/**
67-
* {@inheritdoc}
68+
* @inheritdoc
6869
*/
6970
public function isAllowed()
7071
{
7172
return $this->_scopeConfig->isSetFlag('rss/catalog/new', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
7273
}
7374

7475
/**
75-
* {@inheritdoc}
76+
* @inheritdoc
7677
*/
7778
public function getRssData()
7879
{
@@ -97,10 +98,13 @@ public function getRssData()
9798
$item->setAllowedInRss(true);
9899
$item->setAllowedPriceInRss(true);
99100

100-
$this->_eventManager->dispatch('rss_catalog_new_xml_callback', [
101-
'row' => $item->getData(),
102-
'product' => $item
103-
]);
101+
$this->_eventManager->dispatch(
102+
'rss_catalog_new_xml_callback',
103+
[
104+
'row' => $item->getData(),
105+
'product' => $item
106+
]
107+
);
104108

105109
if (!$item->getAllowedInRss()) {
106110
continue;
@@ -132,6 +136,8 @@ public function getRssData()
132136
}
133137

134138
/**
139+
* Get store id
140+
*
135141
* @return int
136142
*/
137143
protected function getStoreId()
@@ -177,14 +183,16 @@ protected function renderPriceHtml(\Magento\Catalog\Model\Product $product)
177183
}
178184

179185
/**
180-
* {@inheritdoc}
186+
* @inheritdoc
181187
*/
182188
public function getCacheLifetime()
183189
{
184190
return 600;
185191
}
186192

187193
/**
194+
* Get feeds
195+
*
188196
* @return array
189197
*/
190198
public function getFeeds()
@@ -199,7 +207,7 @@ public function getFeeds()
199207
}
200208

201209
/**
202-
* {@inheritdoc}
210+
* @inheritdoc
203211
*/
204212
public function isAuthRequired()
205213
{

app/code/Magento/Catalog/Block/Rss/Product/Special.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
use Magento\Framework\App\Rss\DataProviderInterface;
1010

1111
/**
12-
* Class Special
13-
* @package Magento\Catalog\Block\Rss\Product
12+
* Special products feed block
1413
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1514
*/
1615
class Special extends \Magento\Framework\View\Element\AbstractBlock implements DataProviderInterface
@@ -98,6 +97,8 @@ public function __construct(
9897
}
9998

10099
/**
100+
* Init
101+
*
101102
* @return void
102103
*/
103104
protected function _construct()
@@ -107,6 +108,8 @@ protected function _construct()
107108
}
108109

109110
/**
111+
* Get RSS data
112+
*
110113
* @return array
111114
*/
112115
public function getRssData()
@@ -156,6 +159,8 @@ public function getRssData()
156159
}
157160

158161
/**
162+
* Get entry data
163+
*
159164
* @param \Magento\Catalog\Model\Product $item
160165
* @return array
161166
*/
@@ -245,14 +250,16 @@ public function isAllowed()
245250
}
246251

247252
/**
248-
* {@inheritdoc}
253+
* @inheritdoc
249254
*/
250255
public function getCacheLifetime()
251256
{
252257
return 600;
253258
}
254259

255260
/**
261+
* Get feeds
262+
*
256263
* @return array
257264
*/
258265
public function getFeeds()
@@ -266,7 +273,7 @@ public function getFeeds()
266273
}
267274

268275
/**
269-
* {@inheritdoc}
276+
* @inheritdoc
270277
*/
271278
public function isAuthRequired()
272279
{

app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
namespace Magento\Catalog\Block\Ui;
77

88
use Magento\Catalog\Api\Data\ProductInterface;
9+
use Magento\Catalog\Model\ProductRenderFactory;
10+
use Magento\Catalog\Model\ProductRepository;
911
use Magento\Catalog\Ui\DataProvider\Product\ProductRenderCollectorComposite;
12+
use Magento\Framework\App\Config\ScopeConfigInterface;
13+
use Magento\Framework\App\ObjectManager;
14+
use Magento\Framework\EntityManager\Hydrator;
1015
use Magento\Framework\Registry;
1116
use Magento\Framework\Serialize\SerializerInterface;
1217
use Magento\Framework\Url;
1318
use Magento\Framework\View\Element\Template;
1419
use Magento\Store\Model\Store;
15-
use Magento\Catalog\Model\ProductRenderFactory;
16-
use Magento\Catalog\Model\ProductRepository;
17-
use Magento\Framework\EntityManager\Hydrator;
1820
use Magento\Store\Model\StoreManager;
1921

2022
/**
@@ -25,6 +27,7 @@
2527
*
2628
* @api
2729
* @since 101.1.0
30+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2831
*/
2932
class ProductViewCounter extends Template
3033
{
@@ -68,6 +71,13 @@ class ProductViewCounter extends Template
6871
*/
6972
private $registry;
7073

74+
/**
75+
* Core store config
76+
*
77+
* @var ScopeConfigInterface
78+
*/
79+
private $scopeConfig;
80+
7181
/**
7282
* @param Template\Context $context
7383
* @param ProductRepository $productRepository
@@ -78,6 +88,8 @@ class ProductViewCounter extends Template
7888
* @param SerializerInterface $serialize
7989
* @param Url $url
8090
* @param Registry $registry
91+
* @param ScopeConfigInterface|null $scopeConfig
92+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8193
*/
8294
public function __construct(
8395
Template\Context $context,
@@ -88,7 +100,8 @@ public function __construct(
88100
Hydrator $hydrator,
89101
SerializerInterface $serialize,
90102
Url $url,
91-
Registry $registry
103+
Registry $registry,
104+
?ScopeConfigInterface $scopeConfig = null
92105
) {
93106
parent::__construct($context);
94107
$this->productRepository = $productRepository;
@@ -99,6 +112,7 @@ public function __construct(
99112
$this->serialize = $serialize;
100113
$this->url = $url;
101114
$this->registry = $registry;
115+
$this->scopeConfig = $scopeConfig ?? ObjectManager::getInstance()->get(ScopeConfigInterface::class);
102116
}
103117

104118
/**
@@ -116,14 +130,19 @@ public function getCurrentProductData()
116130
{
117131
/** @var ProductInterface $product */
118132
$product = $this->registry->registry('product');
133+
$productsScope = $this->scopeConfig->getValue(
134+
'catalog/recently_products/scope',
135+
\Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE
136+
);
119137
/** @var Store $store */
120138
$store = $this->storeManager->getStore();
121139

122140
if (!$product || !$product->getId()) {
123141
return $this->serialize->serialize([
124142
'items' => [],
125143
'store' => $store->getId(),
126-
'currency' => $store->getCurrentCurrency()->getCode()
144+
'currency' => $store->getCurrentCurrency()->getCode(),
145+
'productCurrentScope' => $productsScope
127146
]);
128147
}
129148

@@ -140,7 +159,8 @@ public function getCurrentProductData()
140159
$product->getId() => $data
141160
],
142161
'store' => $store->getId(),
143-
'currency' => $store->getCurrentCurrency()->getCode()
162+
'currency' => $store->getCurrentCurrency()->getCode(),
163+
'productCurrentScope' => $productsScope
144164
];
145165

146166
return $this->serialize->serialize($currentProductData);

app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery/Upload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\Exception\LocalizedException;
1212

1313
/**
14-
* Class Upload
14+
* Upload product image action controller
1515
*/
1616
class Upload extends \Magento\Backend\App\Action implements HttpPostActionInterface
1717
{

app/code/Magento/Catalog/CustomerData/CompareProducts.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
namespace Magento\Catalog\CustomerData;
77

88
use Magento\Customer\CustomerData\SectionSourceInterface;
9+
use Magento\Framework\App\Config\ScopeConfigInterface;
10+
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\Exception\LocalizedException;
912

13+
/**
14+
* Catalog Product Compare Widget
15+
*/
1016
class CompareProducts implements SectionSourceInterface
1117
{
1218
/**
@@ -24,23 +30,33 @@ class CompareProducts implements SectionSourceInterface
2430
*/
2531
private $outputHelper;
2632

33+
/**
34+
* Core store config
35+
*
36+
* @var ScopeConfigInterface
37+
*/
38+
private $scopeConfig;
39+
2740
/**
2841
* @param \Magento\Catalog\Helper\Product\Compare $helper
2942
* @param \Magento\Catalog\Model\Product\Url $productUrl
3043
* @param \Magento\Catalog\Helper\Output $outputHelper
44+
* @param ScopeConfigInterface|null $scopeConfig
3145
*/
3246
public function __construct(
3347
\Magento\Catalog\Helper\Product\Compare $helper,
3448
\Magento\Catalog\Model\Product\Url $productUrl,
35-
\Magento\Catalog\Helper\Output $outputHelper
49+
\Magento\Catalog\Helper\Output $outputHelper,
50+
?ScopeConfigInterface $scopeConfig = null
3651
) {
3752
$this->helper = $helper;
3853
$this->productUrl = $productUrl;
3954
$this->outputHelper = $outputHelper;
55+
$this->scopeConfig = $scopeConfig ?? ObjectManager::getInstance()->get(ScopeConfigInterface::class);
4056
}
4157

4258
/**
43-
* {@inheritdoc}
59+
* @inheritdoc
4460
*/
4561
public function getSectionData()
4662
{
@@ -54,18 +70,26 @@ public function getSectionData()
5470
}
5571

5672
/**
73+
* Get the list of compared product items
74+
*
5775
* @return array
76+
* @throws LocalizedException
5877
*/
5978
protected function getItems()
6079
{
6180
$items = [];
81+
$productsScope = $this->scopeConfig->getValue(
82+
'catalog/recently_products/scope',
83+
\Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE
84+
);
6285
/** @var \Magento\Catalog\Model\Product $item */
6386
foreach ($this->helper->getItemCollection() as $item) {
6487
$items[] = [
6588
'id' => $item->getId(),
6689
'product_url' => $this->productUrl->getUrl($item),
6790
'name' => $this->outputHelper->productAttribute($item, $item->getName(), 'name'),
6891
'remove_url' => $this->helper->getPostDataRemove($item),
92+
'productScope' => $productsScope
6993
];
7094
}
7195
return $items;

0 commit comments

Comments
 (0)