Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
ad18a33
MC-111: Admin should be able to add default video for simple products
jilu1 May 22, 2018
349fa76
MC-109: Admin should be able to add default video for virtual products
jilu1 May 22, 2018
caa3915
MC-206: Admin should be able to remove default video from simple prod…
jilu1 May 22, 2018
a125c32
MC-204: Admin should be able to remove default video from virtual pro…
jilu1 May 22, 2018
0a4ce59
MC-114: Admin should be able to add default video for downloadable pr…
jilu1 May 22, 2018
bcd9e8d
MC-207: Admin should be able to remove default video from downloadabl…
jilu1 May 22, 2018
dc89813
MC-110: Admin should be able to add default video for bundle products
jilu1 May 23, 2018
d58077e
MC-205: Admin should be able to remove default video from bundle prod…
jilu1 May 23, 2018
ce4cc6f
MC-108: Admin should be able to add default video for grouped products
jilu1 May 23, 2018
24c76b1
MC-203: Admin should be able to remove default video for grouped prod…
jilu1 May 23, 2018
6140322
MC-111: Admin should be able to add default video for simple product
jilu1 May 24, 2018
a32ec55
MC-206: Admin should be able to remove default video from simple product
jilu1 May 24, 2018
5ef3c3e
MC-209: Admin should be able to add default video for virtual product
jilu1 May 24, 2018
4cf830f
MC-204: Admin should be able to remove default video from virtual pro…
jilu1 May 24, 2018
4106bef
MC-114: Admin should be able to add default video for downloadable pr…
jilu1 May 24, 2018
1cf4113
Merge remote-tracking branch 'upstream/2.3-develop' into MC-111-2.3.0
jilu1 May 25, 2018
89b4f53
Merge branch 'RE-develop' into MC-111-2.3.0
jilu1 May 29, 2018
c6134b0
MC-138: Guest customer should be able to advance search configurable …
jilu1 May 30, 2018
b7252a2
MC-142: Guest customer should be able to advance search downloadable …
jilu1 May 30, 2018
9a68fbd
MAGETWO-90739: Out of stock options for configurable products still s…
StasKozar May 31, 2018
7e70ce7
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-90739
StasKozar May 31, 2018
ffda0cc
MAGETWO-90739: Out of stock options for configurable products still s…
StasKozar May 31, 2018
44f9541
MC-142: Guest customer should be able to advance search downloadable …
jilu1 May 31, 2018
b6cd741
MC-139: Guest customer should be able to advance search bundle produc…
jilu1 May 31, 2018
632926d
MAGETWO-90739: Out of stock options for configurable products still s…
StasKozar Jun 1, 2018
a0ab4e4
MAGETWO-90739: Out of stock options for configurable products still s…
StasKozar Jun 1, 2018
cb24bdf
MC-234: Admin should be able to create category from the product page
leviv Jun 1, 2018
bc58afb
MC-235: Customer should only see cart price rule discount if conditio…
tomreece May 29, 2018
97561e2
MC-236: Customer should only see cart price rule discount if conditio…
tomreece May 30, 2018
e7705ff
MC-235: Customer should only see cart price rule discount if conditio…
tomreece Jun 1, 2018
b8773b5
MC-238: Customer should only see cart price rule discount if conditio…
tomreece Jun 1, 2018
b108cc8
MC-239: Customer should only see cart price rule discount if conditio…
tomreece Jun 1, 2018
d1ed33c
MAGETWO-90739: Out of stock options for configurable products still s…
StasKozar Jun 4, 2018
64c975a
MC-239: Customer should only see cart price rule discount if conditio…
tomreece Jun 4, 2018
3c9066c
MC-241: Customer should only see cart price rule discount if conditio…
tomreece Jun 4, 2018
7094961
MC-141: Guest customer should be able to advance search grouped produ…
jilu1 Jun 5, 2018
ef2c079
MC-181: Configurable Product goes "Out of Stock" if all associated Si…
leviv Jun 5, 2018
51f72c4
MC-181: Configurable Product goes "Out of Stock" if all associated Si…
leviv Jun 5, 2018
c257b80
MC-235: Customer should only see cart price rule discount if conditio…
tomreece Jun 5, 2018
b5a2e0e
MAGETWO-92137: Refreshing page deletes shipping address on guest chec…
OlgaVasyltsun Jun 6, 2018
08e6de1
ENGCOM-1882: [Forwardport] [Resolved : limiter float too generic] #15879
magento-engcom-team Jun 6, 2018
c44f1f8
[Forwardport 2.3] Trim username on customer account login page
dankhrapiyush Jun 6, 2018
a851540
Solve overlapping Issue on every Home page & category page of Hot Sel…
chirag-wagento Jun 6, 2018
793d9a6
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-92137
OlgaVasyltsun Jun 6, 2018
f6a18e0
MAGETWO-91102: [2.3.0] Admin orders being sent to Signifyd for review…
StasKozar Jun 6, 2018
1ccc299
MAGETWO-92130: An error happens when you have a new Critical Admin No…
zakdma Jun 6, 2018
400960c
MAGETWO-91102: [2.3.0] Admin orders being sent to Signifyd for review…
StasKozar Jun 6, 2018
25bc40e
MAGETWO-65458: Cart Rules are not excluding Bundle Products
DianaRusin Jun 6, 2018
d22ca2f
Merge branch 'reece-cart-rules' into RE-develop
tomreece Jun 6, 2018
cb87510
MC-234: Admin should be able to create category from the product page
leviv Jun 1, 2018
c45b9f2
MC-234: Admin should be able to create category from the product page
leviv Jun 1, 2018
e0e4003
MC-234: Admin should be able to create category from the product page
leviv Jun 1, 2018
08b118d
MC-234: Admin should be able to create category from the product page
leviv Jun 1, 2018
0c2ff2b
MC-234: Admin should be able to create category from the product page
leviv Jun 4, 2018
7da6a5a
MC-234: Admin should be able to create category from the product page
leviv Jun 4, 2018
fa3637c
MC-234: Admin should be able to create category from the product page
leviv Jun 4, 2018
4efae74
Merge branch 'MC-234' into RE-develop
leviv Jun 6, 2018
622fa8d
MC-179: Admin should be able to update existing attributes of a confi…
leviv Jun 6, 2018
13b9bfa
MC-141: Guest customer should be able to advance search grouped produ…
jilu1 Jun 6, 2018
776988b
MC-179: Admin should be able to update existing attributes of a confi…
leviv Jun 6, 2018
09f5b04
Merge branch 'MC-179' into RE-develop
leviv Jun 6, 2018
9163538
ENGCOM-1893: [Forwardport] Solve overlapping Issue on every Home page…
magento-engcom-team Jun 6, 2018
7f93520
ENGCOM-1900: [Forwardport 2.3] Trim username on customer account logi…
magento-engcom-team Jun 6, 2018
0157463
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-92137
OlgaVasyltsun Jun 7, 2018
6655382
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-91102
StasKozar Jun 7, 2018
a0186de
MAGETWO-92137: Refreshing page deletes shipping address on guest chec…
OlgaVasyltsun Jun 7, 2018
16933f8
ENGCOM-1904: [Forwardport] [Resolved : Changing @tab-content__border …
magento-engcom-team Jun 7, 2018
09b3aac
Merge branch '2.3-develop' into MAGETWO-92130
zakdma Jun 7, 2018
b1e02d8
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-65458
DianaRusin Jun 7, 2018
f3234e1
MAGETWO-90761: [2.3.0] PayPal orders status display always as Processing
StasKozar Jun 7, 2018
b02161b
MAGETWO-92137: Refreshing page deletes shipping address on guest chec…
OlgaVasyltsun Jun 7, 2018
252e075
MAGETWO-90761: [2.3.0] PayPal orders status display always as Processing
StasKozar Jun 7, 2018
4c5410a
MC-181: Configurable Product goes "Out of Stock" if all associated Si…
leviv Jun 7, 2018
e38ac26
MC-181: Configurable Product goes "Out of Stock" if all associated Si…
leviv Jun 7, 2018
f5068ec
Merge branch 'MC-181' into RE-develop
leviv Jun 7, 2018
b65ba22
Merge remote-tracking branch 'upstream/2.3-develop' into RE-develop
jilu1 Jun 7, 2018
2722448
MC-248: Admin should be able to create simple product with two custom…
leviv Jun 1, 2018
40e12d9
MC-248: Admin should be able to create simple product with two custom…
leviv Jun 4, 2018
7ee5a8b
MC-248: Admin should be able to create simple product with two custom…
leviv Jun 5, 2018
784c1e1
MC-248: Admin should be able to create simple product with two custom…
leviv Jun 7, 2018
8ef08d0
Merge branch 'MC-248' into RE-develop
leviv Jun 7, 2018
15c9fa5
Merge branch 'MC-111-2.3.0' into MQE-1048
jilu1 Jun 7, 2018
199200c
MQE-1048: add non-tests codes from branch with blocked tests
jilu1 Jun 7, 2018
9ae9bab
Merge remote-tracking branch 'origin/MAGETWO-90761' into 2.3-develop-…
DianaRusin Jun 8, 2018
f93c916
MAGETWO-92137: Refreshing page deletes shipping address on guest chec…
OlgaVasyltsun Jun 8, 2018
b72f5c3
MAGETWO-65458: Cart Rules are not excluding Bundle Products
DianaRusin Jun 8, 2018
c20d777
Merge remote-tracking branch 'origin/MAGETWO-92130' into 2.3-develop-…
DianaRusin Jun 8, 2018
1d0ef5b
Merge remote-tracking branch 'origin/MAGETWO-92137' into 2.3-develop-…
DianaRusin Jun 8, 2018
b0720bf
MQE-1048: add non-tests codes from branch with blocked tests
jilu1 Jun 8, 2018
445bb79
MC-234: Admin should be able to create category from the product page
leviv Jun 8, 2018
afa280c
Merge remote-tracking branch 'origin/MAGETWO-65458' into 2.3-develop-…
StasKozar Jun 8, 2018
af966c9
Merge branch 'MQE-1048' into RE-develop
jilu1 Jun 8, 2018
6f4bcfa
MC-234: Admin should be able to create category from the product page
leviv Jun 8, 2018
11ce389
MC-234: Admin should be able to create category from the product page
leviv Jun 8, 2018
6f13e93
MC-234: Admin should be able to create category from the product page
leviv Jun 8, 2018
25442f9
Merge remote-tracking branch 'origin/MAGETWO-91102' into 2.3-develop-…
svitja Jun 11, 2018
ad6b38e
Merge branch 'MC-234' into RE-develop
leviv Jun 11, 2018
cc91c03
Merge remote-tracking branch 'origin/2.3-develop' into RE-develop
tomreece Jun 11, 2018
2e7c579
Remove unnecessary parameter from invoking toHtml() method
rogyar Jun 11, 2018
f4b014d
fix for dropdown toggle icon
Karlasa Jun 11, 2018
f28471e
extend default config instead overwrite
likemusic Jun 11, 2018
7782bdc
Simplify echo statement
orlangur Jun 12, 2018
81e4833
ENGCOM-1954: [Forwardport] Extend default config instead overwrite #1…
magento-engcom-team Jun 12, 2018
4c676c9
ENGCOM-1956: [Forwardport] fix for dropdown toggle icon in cart #16042
magento-engcom-team Jun 12, 2018
6b0f6ef
ENGCOM-1946: Wishlist: Remove unnecessary parameter from invoking toH…
magento-engcom-team Jun 12, 2018
a8a431e
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-90739
zakdma Jun 12, 2018
f2843b7
Merge branch 'MAGETWO-90739' into 2.3-develop-pr23
zakdma Jun 12, 2018
cea78f9
ENGCOM-1956: [Forwardport] fix for dropdown toggle icon in cart #16042
Jun 12, 2018
5c39bfa
ENGCOM-1954: [Forwardport] Extend default config instead overwrite #1…
Jun 12, 2018
762886e
ENGCOM-1946: Wishlist: Remove unnecessary parameter from invoking toH…
Jun 12, 2018
e533306
ENGCOM-1904: [Forwardport] [Resolved : Changing @tab-content__border …
Jun 12, 2018
88274d5
ENGCOM-1900: [Forwardport 2.3] Trim username on customer account logi…
Jun 12, 2018
4496e99
ENGCOM-1893: [Forwardport] Solve overlapping Issue on every Home page…
Jun 12, 2018
f238b8d
ENGCOM-1882: [Forwardport] [Resolved : limiter float too generic] #15879
Jun 12, 2018
32486c5
ENGCOM-1904: [Forwardport] [Resolved : Changing @tab-content__border …
Jun 12, 2018
85953af
Merge remote-tracking branch 'origin/2.3-develop' into RE-develop
tomreece Jun 12, 2018
f57a4ef
[EngCom] Public Pull Requests - 2.3-develop
magento-engcom-team Jun 12, 2018
1a1e5bf
merge magento/2.3-develop into magento-pangolin/RE-develop
Jun 12, 2018
8132ea4
Fixed static test failures
Jun 13, 2018
5d5bd7a
Fixed static test failures
Jun 13, 2018
5bb066c
Merge remote-tracking branch 'origin/2.3-develop' into 2.3-develop-pr23
zakdma Jun 13, 2018
285a39c
:arrows_clockwise: [EngCom] Public Pull Requests - 2.3-develop
magento-engcom-team Jun 13, 2018
012d0a3
merge magento/2.3-develop into magento-tsg/2.3-develop-pr23
Jun 13, 2018
c67893b
Merge pull request #2696 from magento-tsg/2.3-develop-pr23
Jun 13, 2018
03011d0
MQE-1061: Stabilize RE-develop branch
tomreece Jun 13, 2018
6216112
merge magento/2.3-develop into magento-pangolin/RE-develop
Jun 13, 2018
919dd8c
Merge pull request #2683 from magento-pangolin/RE-develop
okolesnyk Jun 13, 2018
c6f89a1
fixed word typo
ledian-hymetllari Jun 6, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/code/Magento/Bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
},
"suggest": {
"magento/module-webapi": "*",
"magento/module-bundle-sample-data": "*"
"magento/module-bundle-sample-data": "*",
"magento/module-sales-rule": "*"
},
"type": "magento2-module",
"license": [
Expand Down
7 changes: 7 additions & 0 deletions app/code/Magento/Bundle/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,11 @@
</argument>
</arguments>
</type>
<type name="Magento\SalesRule\Model\Quote\ChildrenValidationLocator">
<arguments>
<argument name="productTypeChildrenValidationMap" xsi:type="array">
<item name="bundle" xsi:type="boolean">false</item>
</argument>
</arguments>
</type>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
*/
interface StockStatusInterface extends ExtensibleDataInterface
{
/**#@+
* Stock Status values.
*/
const STATUS_OUT_OF_STOCK = 0;

const STATUS_IN_STOCK = 1;
/**#@-*/

/**#@+
* Stock status object data keys
*/
Expand Down
8 changes: 0 additions & 8 deletions app/code/Magento/CatalogInventory/Model/Stock/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
*/
class Status extends AbstractExtensibleModel implements StockStatusInterface
{
/**#@+
* Stock Status values
*/
const STATUS_OUT_OF_STOCK = 0;

const STATUS_IN_STOCK = 1;
/**#@-*/

/**#@+
* Field name
*/
Expand Down
10 changes: 10 additions & 0 deletions app/code/Magento/Customer/view/frontend/templates/form/login.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,13 @@
</form>
</div>
</div>

<script type="text/x-magento-init">
{
".field.email": {
"Magento_Customer/js/trim-username": {
"formSelector": "form.form-login"
}
}
}
</script>
65 changes: 65 additions & 0 deletions app/code/Magento/Customer/view/frontend/web/js/trim-username.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

define([
'jquery'
], function ($) {
'use strict';

$.widget('mage.trimUsername', {
options: {
cache: {},
formSelector: 'form',
emailSelector: 'input[type="email"]'
},

/**
* Widget initialization
* @private
*/
_create: function () {
// We need to look outside the module for backward compatibility, since someone can already use the module.
// @todo Narrow this selector in 2.3 so it doesn't accidentally finds the email field from the
// newsletter email field or any other "email" field.
this.options.cache.email = $(this.options.formSelector).find(this.options.emailSelector);
this._bind();
},

/**
* Event binding, will monitor change, keyup and paste events.
* @private
*/
_bind: function () {
if (this.options.cache.email.length) {
this._on(this.options.cache.email, {
'change': this._trimUsername,
'keyup': this._trimUsername,
'paste': this._trimUsername
});
}
},

/**
* Trim username
* @private
*/
_trimUsername: function () {
var username = this._getUsername().trim();

this.options.cache.email.val(username);
},

/**
* Get username value
* @returns {*}
* @private
*/
_getUsername: function () {
return this.options.cache.email.val();
}
});

return $.mage.trimUsername;
});
19 changes: 14 additions & 5 deletions app/code/Magento/Elasticsearch/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
namespace Magento\Elasticsearch\Model;

use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Search\EngineResolverInterface;
use Magento\Search\Model\EngineResolver;
use Magento\Store\Model\ScopeInterface;
use Magento\AdvancedSearch\Model\Client\ClientOptionsInterface;
use Magento\AdvancedSearch\Model\Client\ClientResolver;
Expand Down Expand Up @@ -54,21 +56,28 @@ class Config implements ClientOptionsInterface
*/
private $clientResolver;

/**
* @var EngineResolverInterface
*/
private $engineResolver;

/**
* Constructor
*
* @param ScopeConfigInterface $scopeConfig
* @param ClientResolver $clientResolver
* @param string $prefix
* @param ClientResolver|null $clientResolver
* @param EngineResolverInterface|null $engineResolver
* @param string|null $prefix
*/
public function __construct(
ScopeConfigInterface $scopeConfig,
ClientResolver $clientResolver = null,
EngineResolverInterface $engineResolver = null,
$prefix = null
) {
$this->scopeConfig = $scopeConfig;
$this->clientResolver = $clientResolver ?:
ObjectManager::getInstance()->get(ClientResolver::class);
$this->clientResolver = $clientResolver ?: ObjectManager::getInstance()->get(ClientResolver::class);
$this->engineResolver = $engineResolver ?: ObjectManager::getInstance()->get(EngineResolverInterface::class);
$this->prefix = $prefix ?: $this->clientResolver->getCurrentEngine();
}

Expand Down Expand Up @@ -126,7 +135,7 @@ public function getSearchConfigData($field, $storeId = null)
*/
public function isElasticsearchEnabled()
{
return $this->getSearchConfigData('engine') == self::ENGINE_NAME;
return $this->engineResolver->getCurrentSearchEngine() === self::ENGINE_NAME;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Elasticsearch\Model\Indexer\Plugin;

use Magento\Elasticsearch\Model\Config;
use Magento\Framework\Indexer\Config\DependencyInfoProvider as Provider;
use Magento\CatalogSearch\Model\Indexer\Fulltext as CatalogSearchFulltextIndexer;
use Magento\CatalogInventory\Model\Indexer\Stock\Processor as CatalogInventoryStockIndexer;

/**
* Plugin for maintenance catalog search index dependency on stock index.
* If elasticsearch is used as search engine catalog search index becomes dependent on stock index. Elasticsearch
* module declares this dependence. But in case when elasticsearch module is enabled and elasticsearch engine isn`t
* used as search engine other search engines don`t need this dependency.
* This plugin remove catalog search index dependency on stock index when elasticsearch isn`t used as search engine
* except full reindexing. During full reindexing this dependency doesn`t make overhead.
*/
class DependencyUpdaterPlugin
{
/**
* @var Config
*/
private $config;

/**
* @param Config $config
*/
public function __construct(Config $config)
{
$this->config = $config;
}

/**
* Remove index dependency, if it needed, on run reindexing by specifics indexes.
*
* @param Provider $provider
* @param array $dependencies
* @param string $indexerId
* @return array
* @see \Magento\Indexer\Console\Command\IndexerReindexCommand::getIndexers()
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function afterGetIndexerIdsToRunBefore(Provider $provider, array $dependencies, string $indexerId): array
{
if ($this->isFilteringNeeded($indexerId, CatalogSearchFulltextIndexer::INDEXER_ID)) {
$dependencies = array_diff($dependencies, [CatalogInventoryStockIndexer::INDEXER_ID]);
}

return $dependencies;
}

/**
* Remove index dependency, if it needed, on reindex triggers.
*
* @param Provider $provider
* @param array $dependencies
* @param string $indexerId
* @return array
* @see \Magento\Indexer\Model\Indexer\DependencyDecorator
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function afterGetIndexerIdsToRunAfter(Provider $provider, array $dependencies, string $indexerId): array
{
if ($this->isFilteringNeeded($indexerId, CatalogInventoryStockIndexer::INDEXER_ID)) {
$dependencies = array_diff($dependencies, [CatalogSearchFulltextIndexer::INDEXER_ID]);
}

return $dependencies;
}

/**
* @param string $currentIndexerId
* @param string $targetIndexerId
* @return bool
*/
private function isFilteringNeeded(string $currentIndexerId, string $targetIndexerId): bool
{
return (!$this->config->isElasticsearchEnabled() && $targetIndexerId === $currentIndexerId);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Elasticsearch\Model\Indexer\Plugin;

use Magento\Elasticsearch\Model\Config;
use Magento\CatalogInventory\Api\StockConfigurationInterface;
use Magento\CatalogInventory\Api\StockStatusRepositoryInterface;
use Magento\CatalogInventory\Api\StockStatusCriteriaInterfaceFactory;
use Magento\CatalogInventory\Api\Data\StockStatusInterface;
use Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider;

/**
* Plugin for filtering child products that are out of stock for preventing their saving to catalog search index.
*/
class StockedProductsFilterPlugin
{
/**
* @var Config
*/
private $config;

/**
* @var StockConfigurationInterface
*/
private $stockConfiguration;

/**
* @var StockStatusRepositoryInterface
*/
private $stockStatusRepository;

/**
* @var StockStatusCriteriaInterfaceFactory
*/
private $stockStatusCriteriaFactory;

/**
* @param Config $config
* @param StockConfigurationInterface $stockConfiguration
* @param StockStatusRepositoryInterface $stockStatusRepository
* @param StockStatusCriteriaInterfaceFactory $stockStatusCriteriaFactory
*/
public function __construct(
Config $config,
StockConfigurationInterface $stockConfiguration,
StockStatusRepositoryInterface $stockStatusRepository,
StockStatusCriteriaInterfaceFactory $stockStatusCriteriaFactory
) {
$this->config = $config;
$this->stockConfiguration = $stockConfiguration;
$this->stockStatusRepository = $stockStatusRepository;
$this->stockStatusCriteriaFactory = $stockStatusCriteriaFactory;
}

/**
* Filter out of stock options for configurable product.
*
* @param DataProvider $dataProvider
* @param array $indexData
* @param array $productData
* @param int $storeId
* @return array
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function beforePrepareProductIndex(
DataProvider $dataProvider,
array $indexData,
array $productData,
int $storeId
): array {
if ($this->config->isElasticsearchEnabled() && !$this->stockConfiguration->isShowOutOfStock($storeId)) {
$productIds = array_keys($indexData);
$stockStatusCriteria = $this->stockStatusCriteriaFactory->create();
$stockStatusCriteria->setProductsFilter($productIds);
$stockStatusCollection = $this->stockStatusRepository->getList($stockStatusCriteria);
$stockStatuses = $stockStatusCollection->getItems();
$stockStatuses = array_filter($stockStatuses, function (StockStatusInterface $stockStatus) {
return StockStatusInterface::STATUS_IN_STOCK == $stockStatus->getStockStatus();
});
$indexData = array_intersect_key($indexData, $stockStatuses);
}

return [
$indexData,
$productData,
$storeId,
];
}
}
Loading