From 0ff88f42291c19985666421aef66f005ea7a2d09 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Tue, 20 Mar 2018 13:50:33 +0200 Subject: [PATCH 1/4] MSI-683: Bundled products work with Single Stock --- .../DisableBundleTypePlugin.php | 32 +++++++++++++++++++ app/code/Magento/InventoryBundle/etc/di.xml | 13 ++++++++ .../Magento/InventoryBundle/etc/module.xml | 9 ++++-- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php create mode 100644 app/code/Magento/InventoryBundle/etc/di.xml diff --git a/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php b/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php new file mode 100644 index 0000000000000..9e68cebf027c2 --- /dev/null +++ b/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php @@ -0,0 +1,32 @@ + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/InventoryBundle/etc/module.xml b/app/code/Magento/InventoryBundle/etc/module.xml index e23c6c418bfbb..e8b7b20f11da9 100644 --- a/app/code/Magento/InventoryBundle/etc/module.xml +++ b/app/code/Magento/InventoryBundle/etc/module.xml @@ -5,6 +5,11 @@ * See COPYING.txt for license details. */ --> - - + + + + + + From edba9bcbc47e1d451d79bd6fc3765851159deddc Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Tue, 20 Mar 2018 18:10:35 +0200 Subject: [PATCH 2/4] MSI-683: Bundled products work with Single Stock --- app/code/Magento/InventoryBundle/etc/module.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/code/Magento/InventoryBundle/etc/module.xml b/app/code/Magento/InventoryBundle/etc/module.xml index e8b7b20f11da9..92ae920b4f5c8 100644 --- a/app/code/Magento/InventoryBundle/etc/module.xml +++ b/app/code/Magento/InventoryBundle/etc/module.xml @@ -7,9 +7,5 @@ --> - - - - - + From 0113c3aac8b7329f3ea882a73ebd5f434acc9183 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Wed, 21 Mar 2018 07:58:11 +0200 Subject: [PATCH 3/4] MSI-683: Bundled products work with Single Stock --- .../DisableBundleTypePlugin.php | 8 ++++++-- app/code/Magento/InventoryBundle/composer.json | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php b/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php index 9e68cebf027c2..08b1c11f14673 100644 --- a/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php +++ b/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\InventoryBundle\Plugin\InventoryConfiguration\IsSourceItemsAllowedForProductType; @@ -21,8 +22,11 @@ class DisableBundleTypePlugin * @return bool * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function aroundExecute(IsSourceItemsAllowedForProductType $subject, callable $proceed, string $productType) - { + public function aroundExecute( + IsSourceItemsAllowedForProductType $subject, + callable $proceed, + string $productType + ): bool { if ($productType === BundleType::TYPE_CODE) { return false; } diff --git a/app/code/Magento/InventoryBundle/composer.json b/app/code/Magento/InventoryBundle/composer.json index 631ffbda9ed86..650637a839c00 100644 --- a/app/code/Magento/InventoryBundle/composer.json +++ b/app/code/Magento/InventoryBundle/composer.json @@ -3,7 +3,11 @@ "description": "N/A", "require": { "php": "7.0.2|7.0.4|~7.0.6|~7.1.0", - "magento/framework": "100.3.*" + "magento/framework": "100.3.*", + "magento/module-bundle": "100.3.*" + }, + "suggest": { + "magento/module-inventory-configuration": "100.0.*" }, "type": "magento2-module", "version": "100.0.0-dev", From f8e856a66db380f15b143e6dc6acae51c5fb841a Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Wed, 21 Mar 2018 10:58:12 +0200 Subject: [PATCH 4/4] MSI-683: Bundled products work with Single Stock --- .../DisableBundleTypePlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php b/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php index 08b1c11f14673..d28623062e14a 100644 --- a/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php +++ b/app/code/Magento/InventoryBundle/Plugin/InventoryConfiguration/IsSourceItemsAllowedForProductType/DisableBundleTypePlugin.php @@ -8,7 +8,7 @@ namespace Magento\InventoryBundle\Plugin\InventoryConfiguration\IsSourceItemsAllowedForProductType; use Magento\Bundle\Model\Product\Type as BundleType; -use Magento\InventoryConfiguration\Model\IsSourceItemsAllowedForProductType; +use Magento\InventoryConfiguration\Model\IsSourceItemsAllowedForProductTypeInterface; /** * Disable Source items management for Bundle product type. @@ -23,7 +23,7 @@ class DisableBundleTypePlugin * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundExecute( - IsSourceItemsAllowedForProductType $subject, + IsSourceItemsAllowedForProductTypeInterface $subject, callable $proceed, string $productType ): bool {