forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request magento#3363 from magento-tsg-csl3/2.3-develop-pr10
[TSG-CSL3] 2.3-develop (pr10)
- Loading branch information
Showing
12 changed files
with
433 additions
and
51 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
app/code/Magento/Catalog/Test/Mftf/Section/StorefrontMiniCartSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> | ||
<section name="StorefrontMiniCartSection"> | ||
<element name="quantity" type="button" selector="span.counter-number"/> | ||
<element name="show" type="button" selector="a.showcart"/> | ||
<element name="goToCheckout" type="button" selector="#top-cart-btn-checkout" timeout="30"/> | ||
</section> | ||
</sections> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
app/code/Magento/Quote/Model/Product/Plugin/MarkQuotesRecollectMassDisabled.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Quote\Model\Product\Plugin; | ||
|
||
use Magento\Catalog\Model\Product\Attribute\Source\Status; | ||
use Magento\Catalog\Model\Product\Action as ProductAction; | ||
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; | ||
|
||
/** | ||
* Remove quote items after mass disabling products | ||
*/ | ||
class MarkQuotesRecollectMassDisabled | ||
{ | ||
/** @var QuoteResource$quoteResource */ | ||
private $quoteResource; | ||
|
||
/** | ||
* @param QuoteResource $quoteResource | ||
*/ | ||
public function __construct( | ||
QuoteResource $quoteResource | ||
) { | ||
$this->quoteResource = $quoteResource; | ||
} | ||
|
||
/** | ||
* Clean quote items after mass disabling product | ||
* | ||
* @param \Magento\Catalog\Model\Product\Action $subject | ||
* @param \Magento\Catalog\Model\Product\Action $result | ||
* @param int[] $productIds | ||
* @param int[] $attrData | ||
* @param int $storeId | ||
* @return \Magento\Catalog\Model\Product\Action | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function afterUpdateAttributes( | ||
ProductAction $subject, | ||
ProductAction $result, | ||
$productIds, | ||
$attrData, | ||
$storeId | ||
): ProductAction { | ||
if (isset($attrData['status']) && $attrData['status'] === Status::STATUS_DISABLED) { | ||
$this->quoteResource->markQuotesRecollect($productIds); | ||
} | ||
|
||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.