-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 #367 from magento-folks/2.1.3_bugs_pr
Fixed issues: - MAGETWO-56397: Unable to Upgrade with Split Databases - MAGETWO-57387: Unable to print Invoices and Credit memo from Sales>Orders - MAGETWO-58064: Unable to upgrade with split databases. Part 2 - MAGETWO-58036: Reloading page on checkout causes shipping method to go "undefined"
- Loading branch information
Showing
28 changed files
with
537 additions
and
150 deletions.
There are no files selected for viewing
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
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
39 changes: 39 additions & 0 deletions
39
app/code/Magento/Quote/Model/Product/Plugin/RemoveQuoteItems.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,39 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Quote\Model\Product\Plugin; | ||
|
||
class RemoveQuoteItems | ||
{ | ||
/** | ||
* @var \Magento\Quote\Model\Product\QuoteItemsCleanerInterface | ||
*/ | ||
private $quoteItemsCleaner; | ||
|
||
/** | ||
* @param \Magento\Quote\Model\Product\QuoteItemsCleanerInterface $quoteItemsCleaner | ||
*/ | ||
public function __construct(\Magento\Quote\Model\Product\QuoteItemsCleanerInterface $quoteItemsCleaner) | ||
{ | ||
$this->quoteItemsCleaner = $quoteItemsCleaner; | ||
} | ||
|
||
/** | ||
* @param \Magento\Catalog\Model\ResourceModel\Product $subject | ||
* @param \Closure $proceed | ||
* @param \Magento\Catalog\Api\Data\ProductInterface $product | ||
* @return \Magento\Catalog\Model\ResourceModel\Product | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function aroundDelete( | ||
\Magento\Catalog\Model\ResourceModel\Product $subject, | ||
\Closure $proceed, | ||
\Magento\Catalog\Api\Data\ProductInterface $product | ||
) { | ||
$result = $proceed($product); | ||
$this->quoteItemsCleaner->execute($product); | ||
return $result; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
app/code/Magento/Quote/Model/Product/QuoteItemsCleaner.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,33 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Quote\Model\Product; | ||
|
||
class QuoteItemsCleaner implements \Magento\Quote\Model\Product\QuoteItemsCleanerInterface | ||
{ | ||
/** | ||
* @var \Magento\Quote\Model\ResourceModel\Quote\Item | ||
*/ | ||
private $itemResource; | ||
|
||
/** | ||
* @param \Magento\Quote\Model\ResourceModel\Quote\Item $itemResource | ||
*/ | ||
public function __construct(\Magento\Quote\Model\ResourceModel\Quote\Item $itemResource) | ||
{ | ||
$this->itemResource = $itemResource; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function execute(\Magento\Catalog\Api\Data\ProductInterface $product) | ||
{ | ||
$this->itemResource->getConnection()->delete( | ||
$this->itemResource->getMainTable(), | ||
'product_id = ' . $product->getId() | ||
); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
app/code/Magento/Quote/Model/Product/QuoteItemsCleanerInterface.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,17 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Quote\Model\Product; | ||
|
||
use Magento\Catalog\Api\Data\ProductInterface; | ||
|
||
interface QuoteItemsCleanerInterface | ||
{ | ||
/** | ||
* @param ProductInterface $product | ||
* @return void | ||
*/ | ||
public function execute(ProductInterface $product); | ||
} |
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
This file was deleted.
Oops, something went wrong.
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.