-
Notifications
You must be signed in to change notification settings - Fork 41
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 #90 from magmodules/1.4.17
1.4.17
- Loading branch information
Showing
7 changed files
with
108 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
/** | ||
* Copyright © Magmodules.eu. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magmodules\Channable\Plugin; | ||
|
||
use Magento\InventorySalesApi\Api\Data\ProductSalableResultInterface; | ||
use Magento\Checkout\Model\Session as CheckoutSession; | ||
|
||
/** | ||
* Class AfterGetBackorders | ||
* | ||
*/ | ||
class AfterGetBackorders | ||
{ | ||
|
||
/** | ||
* @var CheckoutSession | ||
*/ | ||
private $checkoutSession; | ||
|
||
/** | ||
* AfterGetBackorders constructor. | ||
* @param CheckoutSession $checkoutSession | ||
*/ | ||
public function __construct( | ||
CheckoutSession $checkoutSession | ||
) { | ||
$this->checkoutSession = $checkoutSession; | ||
} | ||
|
||
/** | ||
* Force backorder enabling for order import | ||
* | ||
* @param $subject | ||
* @param int $result | ||
* @return int $result | ||
*/ | ||
public function afterGetBackorders( | ||
$subject, | ||
$result | ||
) { | ||
if ($this->checkoutSession->getForceBackorder() | ||
&& interface_exists(ProductSalableResultInterface::class) | ||
) { | ||
return 1; | ||
} | ||
|
||
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
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