Skip to content

Commit b9ec49b

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-93980
2 parents a80e735 + fcdb6bb commit b9ec49b

File tree

32 files changed

+628
-124
lines changed

32 files changed

+628
-124
lines changed

app/code/Magento/Authorizenet/view/adminhtml/templates/order/view/info/fraud_details.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ $fraudDetails = $payment->getAdditionalInformation('fraud_details');
4444
<?php endif; ?>
4545

4646
<?php if(!empty($fraudDetails['fraud_filters'])): ?>
47-
<b><?= $block->escapeHtml(__('Fraud Filters')) ?>:
48-
</b></br>
47+
<strong><?= $block->escapeHtml(__('Fraud Filters')) ?>:
48+
</strong></br>
4949
<?php foreach($fraudDetails['fraud_filters'] as $filter): ?>
5050
<?= $block->escapeHtml($filter['name']) ?>:
5151
<?= $block->escapeHtml($filter['action']) ?>

app/code/Magento/Catalog/Model/ResourceModel/Category.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,20 @@ public function getProductsPosition($category)
484484
$this->getCategoryProductTable(),
485485
['product_id', 'position']
486486
)->where(
487-
'category_id = :category_id'
487+
"{$this->getTable('catalog_category_product')}.category_id = ?",
488+
$category->getId()
488489
);
490+
$websiteId = $category->getStore()->getWebsiteId();
491+
if ($websiteId) {
492+
$select->join(
493+
['product_website' => $this->getTable('catalog_product_website')],
494+
"product_website.product_id = {$this->getTable('catalog_category_product')}.product_id",
495+
[]
496+
)->where(
497+
'product_website.website_id = ?',
498+
$websiteId
499+
);
500+
}
489501
$bind = ['category_id' => (int)$category->getId()];
490502

491503
return $this->getConnection()->fetchPairs($select, $bind);

app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,20 @@ public function getProductsPosition($category)
699699
$this->getTable('catalog_category_product'),
700700
['product_id', 'position']
701701
)->where(
702-
'category_id = :category_id'
702+
"{$this->getTable('catalog_category_product')}.category_id = ?",
703+
$category->getId()
703704
);
705+
$websiteId = $category->getStore()->getWebsiteId();
706+
if ($websiteId) {
707+
$select->join(
708+
['product_website' => $this->getTable('catalog_product_website')],
709+
"product_website.product_id = {$this->getTable('catalog_category_product')}.product_id",
710+
[]
711+
)->where(
712+
'product_website.website_id = ?',
713+
$websiteId
714+
);
715+
}
704716
$bind = ['category_id' => (int)$category->getId()];
705717

706718
return $this->getConnection()->fetchPairs($select, $bind);

app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ define([
8282
return function (config, element) {
8383
config = config || {};
8484
jQuery(element).on('click', function () {
85-
categorySubmit(config.url, config.ajax);
85+
categorySubmit();
8686
});
8787
};
8888
});

app/code/Magento/Checkout/view/adminhtml/email/failed_payment.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,43 +23,43 @@ <h1>{{trans "Payment Transaction Failed"}}</h1>
2323

2424
<ul>
2525
<li>
26-
<b>{{trans "Reason"}}</b><br />
26+
<strong>{{trans "Reason"}}</strong><br />
2727
{{var reason}}
2828
</li>
2929
<li>
30-
<b>{{trans "Checkout Type"}}</b><br />
30+
<strong>{{trans "Checkout Type"}}</strong><br />
3131
{{var checkoutType}}
3232
</li>
3333
<li>
34-
<b>{{trans "Customer:"}}</b><br />
34+
<strong>{{trans "Customer:"}}</strong><br />
3535
<a href="mailto:{{var customerEmail}}">{{var customer}}</a> &lt;{{var customerEmail}}&gt;
3636
</li>
3737
<li>
38-
<b>{{trans "Items"}}</b><br />
38+
<strong>{{trans "Items"}}</strong><br />
3939
{{var items|raw}}
4040
</li>
4141
<li>
42-
<b>{{trans "Total:"}}</b><br />
42+
<strong>{{trans "Total:"}}</strong><br />
4343
{{var total}}
4444
</li>
4545
<li>
46-
<b>{{trans "Billing Address:"}}</b><br />
46+
<strong>{{trans "Billing Address:"}}</strong><br />
4747
{{var billingAddress.format('html')|raw}}
4848
</li>
4949
<li>
50-
<b>{{trans "Shipping Address:"}}</b><br />
50+
<strong>{{trans "Shipping Address:"}}</strong><br />
5151
{{var shippingAddress.format('html')|raw}}
5252
</li>
5353
<li>
54-
<b>{{trans "Shipping Method:"}}</b><br />
54+
<strong>{{trans "Shipping Method:"}}</strong><br />
5555
{{var shippingMethod}}
5656
</li>
5757
<li>
58-
<b>{{trans "Payment Method:"}}</b><br />
58+
<strong>{{trans "Payment Method:"}}</strong><br />
5959
{{var paymentMethod}}
6060
</li>
6161
<li>
62-
<b>{{trans "Date & Time:"}}</b><br />
62+
<strong>{{trans "Date & Time:"}}</strong><br />
6363
{{var dateAndTime}}
6464
</li>
6565
</ul>

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\ConfigurableImportExport\Model\Export;
79

8-
use Magento\CatalogImportExport\Model\Export\RowCustomizerInterface;
910
use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection;
10-
use Magento\ConfigurableProduct\Model\Product\Type\Configurable as ConfigurableProductType;
11+
use Magento\CatalogImportExport\Model\Export\RowCustomizerInterface;
1112
use Magento\CatalogImportExport\Model\Import\Product as ImportProduct;
13+
use Magento\ConfigurableProduct\Model\Product\Type\Configurable as ConfigurableProductType;
1214
use Magento\ImportExport\Model\Import;
15+
use Magento\Store\Model\Store;
16+
use Magento\Store\Model\StoreManagerInterface;
1317

18+
/**
19+
* Customizes output during export
20+
*/
1421
class RowCustomizer implements RowCustomizerInterface
1522
{
1623
/**
@@ -36,6 +43,19 @@ class RowCustomizer implements RowCustomizerInterface
3643
self::CONFIGURABLE_VARIATIONS_LABELS_COLUMN
3744
];
3845

46+
/**
47+
* @var StoreManagerInterface
48+
*/
49+
private $storeManager;
50+
51+
/**
52+
* @param StoreManagerInterface $storeManager
53+
*/
54+
public function __construct(StoreManagerInterface $storeManager)
55+
{
56+
$this->storeManager = $storeManager;
57+
}
58+
3959
/**
4060
* Prepare configurable data for export
4161
*
@@ -49,6 +69,9 @@ public function prepareData($collection, $productIds)
4969
$productCollection->addAttributeToFilter('entity_id', ['in' => $productIds])
5070
->addAttributeToFilter('type_id', ['eq' => ConfigurableProductType::TYPE_CODE]);
5171

72+
// set global scope during export
73+
$this->storeManager->setCurrentStore(Store::DEFAULT_STORE_ID);
74+
5275
while ($product = $productCollection->fetchItem()) {
5376
$productAttributesOptions = $product->getTypeInstance()->getConfigurableOptions($product);
5477
$this->configurableData[$product->getId()] = [];

app/code/Magento/ConfigurableImportExport/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"magento/module-eav": "101.0.*",
99
"magento/module-import-export": "100.2.*",
1010
"magento/module-configurable-product": "100.2.*",
11-
"magento/framework": "101.0.*"
11+
"magento/framework": "101.0.*",
12+
"magento/module-store": "100.2.*"
1213
},
1314
"type": "magento2-module",
1415
"version": "100.2.4",

app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\Query\BaseFinalPrice;
1313
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructureFactory;
1414
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructure;
15+
use Magento\Framework\App\Config\ScopeConfigInterface;
16+
use Magento\Store\Model\ScopeInterface;
17+
use Magento\Framework\App\ObjectManager;
18+
use Magento\CatalogInventory\Model\Stock;
19+
use Magento\CatalogInventory\Model\Configuration;
1520

1621
/**
1722
* Configurable Products Price Indexer Resource model
@@ -65,6 +70,11 @@ class Configurable implements DimensionalIndexerInterface
6570
*/
6671
private $basePriceModifier;
6772

73+
/**
74+
* @var ScopeConfigInterface
75+
*/
76+
private $scopeConfig;
77+
6878
/**
6979
* @param BaseFinalPrice $baseFinalPrice
7080
* @param IndexTableStructureFactory $indexTableStructureFactory
@@ -74,6 +84,7 @@ class Configurable implements DimensionalIndexerInterface
7484
* @param BasePriceModifier $basePriceModifier
7585
* @param bool $fullReindexAction
7686
* @param string $connectionName
87+
* @param ScopeConfigInterface $scopeConfig
7788
*/
7889
public function __construct(
7990
BaseFinalPrice $baseFinalPrice,
@@ -83,7 +94,8 @@ public function __construct(
8394
\Magento\Framework\App\ResourceConnection $resource,
8495
BasePriceModifier $basePriceModifier,
8596
$fullReindexAction = false,
86-
$connectionName = 'indexer'
97+
$connectionName = 'indexer',
98+
ScopeConfigInterface $scopeConfig = null
8799
) {
88100
$this->baseFinalPrice = $baseFinalPrice;
89101
$this->indexTableStructureFactory = $indexTableStructureFactory;
@@ -93,10 +105,11 @@ public function __construct(
93105
$this->resource = $resource;
94106
$this->fullReindexAction = $fullReindexAction;
95107
$this->basePriceModifier = $basePriceModifier;
108+
$this->scopeConfig = $scopeConfig ?: ObjectManager::getInstance()->get(ScopeConfigInterface::class);
96109
}
97110

98111
/**
99-
* {@inheritdoc}
112+
* @inheritdoc
100113
*
101114
* @throws \Exception
102115
*/
@@ -184,7 +197,19 @@ private function fillTemporaryOptionsTable(string $temporaryOptionsTableName, ar
184197
['le' => $this->getTable('catalog_product_entity')],
185198
'le.' . $linkField . ' = l.parent_id',
186199
[]
187-
)->columns(
200+
);
201+
202+
// Does not make sense to extend query if out of stock products won't appear in tables for indexing
203+
if ($this->isConfigShowOutOfStock()) {
204+
$select->join(
205+
['si' => $this->getTable('cataloginventory_stock_item')],
206+
'si.product_id = l.product_id',
207+
[]
208+
);
209+
$select->where('si.is_in_stock = ?', Stock::STOCK_IN_STOCK);
210+
}
211+
212+
$select->columns(
188213
[
189214
'le.entity_id',
190215
'customer_group_id',
@@ -250,7 +275,7 @@ private function getMainTable($dimensions)
250275
/**
251276
* Get connection
252277
*
253-
* return \Magento\Framework\DB\Adapter\AdapterInterface
278+
* @return \Magento\Framework\DB\Adapter\AdapterInterface
254279
* @throws \DomainException
255280
*/
256281
private function getConnection(): \Magento\Framework\DB\Adapter\AdapterInterface
@@ -272,4 +297,17 @@ private function getTable($tableName)
272297
{
273298
return $this->resource->getTableName($tableName, $this->connectionName);
274299
}
300+
301+
/**
302+
* Is flag Show Out Of Stock setted
303+
*
304+
* @return bool
305+
*/
306+
private function isConfigShowOutOfStock(): bool
307+
{
308+
return $this->scopeConfig->isSetFlag(
309+
Configuration::XML_PATH_SHOW_OUT_OF_STOCK,
310+
ScopeInterface::SCOPE_STORE
311+
);
312+
}
275313
}

app/code/Magento/Contact/view/frontend/email/submitted_form.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616

1717
<table class="message-details">
1818
<tr>
19-
<td><b>{{trans "Name"}}</b></td>
19+
<td><strong>{{trans "Name"}}</strong></td>
2020
<td>{{var data.name}}</td>
2121
</tr>
2222
<tr>
23-
<td><b>{{trans "Email"}}</b></td>
23+
<td><strong>{{trans "Email"}}</strong></td>
2424
<td>{{var data.email}}</td>
2525
</tr>
2626
<tr>
27-
<td><b>{{trans "Phone"}}</b></td>
27+
<td><strong>{{trans "Phone"}}</strong></td>
2828
<td>{{var data.telephone}}</td>
2929
</tr>
3030
</table>
31-
<p><b>{{trans "Message"}}</b></p>
31+
<p><strong>{{trans "Message"}}</strong></p>
3232
<p>{{var data.comment}}</p>
3333

3434
{{template config_path="design/email/footer_template"}}

app/code/Magento/CurrencySymbol/view/adminhtml/templates/system/currency/rate/matrix.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ $_rates = ($_newRates) ? $_newRates : $_oldRates;
4545
class="admin__control-text"
4646
<?= ($_currencyCode == $_rate) ? ' disabled' : '' ?> />
4747
<?php if (isset($_newRates) && $_currencyCode != $_rate && isset($_oldRates[$_currencyCode][$_rate])): ?>
48-
<div class="admin__field-note"><?= /* @escapeNotVerified */ __('Old rate:') ?> <b><?= /* @escapeNotVerified */ $_oldRates[$_currencyCode][$_rate] ?></b></div>
48+
<div class="admin__field-note"><?= /* @escapeNotVerified */ __('Old rate:') ?> <strong><?= /* @escapeNotVerified */ $_oldRates[$_currencyCode][$_rate] ?></strong></div>
4949
<?php endif; ?>
5050
</td>
5151
<?php else: ?>
@@ -56,7 +56,7 @@ $_rates = ($_newRates) ? $_newRates : $_oldRates;
5656
class="admin__control-text"
5757
<?= ($_currencyCode == $_rate) ? ' disabled' : '' ?> />
5858
<?php if (isset($_newRates) && $_currencyCode != $_rate && isset($_oldRates[$_currencyCode][$_rate])): ?>
59-
<div class="admin__field-note"><?= /* @escapeNotVerified */ __('Old rate:') ?> <b><?= /* @escapeNotVerified */ $_oldRates[$_currencyCode][$_rate] ?></b></div>
59+
<div class="admin__field-note"><?= /* @escapeNotVerified */ __('Old rate:') ?> <strong><?= /* @escapeNotVerified */ $_oldRates[$_currencyCode][$_rate] ?></strong></div>
6060
<?php endif; ?>
6161
</td>
6262
<?php endif; ?>

0 commit comments

Comments
 (0)