From 7585f3961c083164d8c6d10bf5df939a1b674959 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 13 Jul 2020 10:28:01 +0200 Subject: [PATCH] first commit --- .../StockStatusBaseSelectProcessor.php | 13 +++++++++ .../Product/CompositeBaseSelectProcessor.php | 27 +++++++++++++++++++ Pricing/Render/FinalPriceBox.php | 27 +++++++++++++++++++ README.md | 2 ++ composer.json | 20 ++++++++++++++ etc/frontend/di.xml | 9 +++++++ etc/module.xml | 5 ++++ registration.php | 6 +++++ 8 files changed, 109 insertions(+) create mode 100644 Model/ConfigurableProduct/ResourceModel/Product/StockStatusBaseSelectProcessor.php create mode 100644 Model/ResourceModel/Product/CompositeBaseSelectProcessor.php create mode 100644 Pricing/Render/FinalPriceBox.php create mode 100644 README.md create mode 100644 composer.json create mode 100644 etc/frontend/di.xml create mode 100644 etc/module.xml create mode 100644 registration.php diff --git a/Model/ConfigurableProduct/ResourceModel/Product/StockStatusBaseSelectProcessor.php b/Model/ConfigurableProduct/ResourceModel/Product/StockStatusBaseSelectProcessor.php new file mode 100644 index 0000000..5a44113 --- /dev/null +++ b/Model/ConfigurableProduct/ResourceModel/Product/StockStatusBaseSelectProcessor.php @@ -0,0 +1,13 @@ + diff --git a/Model/ResourceModel/Product/CompositeBaseSelectProcessor.php b/Model/ResourceModel/Product/CompositeBaseSelectProcessor.php new file mode 100644 index 0000000..45e70e6 --- /dev/null +++ b/Model/ResourceModel/Product/CompositeBaseSelectProcessor.php @@ -0,0 +1,27 @@ + diff --git a/Pricing/Render/FinalPriceBox.php b/Pricing/Render/FinalPriceBox.php new file mode 100644 index 0000000..331fda5 --- /dev/null +++ b/Pricing/Render/FinalPriceBox.php @@ -0,0 +1,27 @@ +isMsrpPriceApplicable()) { + /** @var BasePriceBox $msrpBlock */ + $msrpBlock = $this->rendererPool->createPriceRender( + MsrpPrice::PRICE_CODE, + $this->getSaleableItem(), + [ + 'real_price_html' => $result, + 'zone' => $this->getZone(), + ] + ); + $result = $msrpBlock->toHtml(); + } + + return $this->wrapResult($result); + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..94f74dc --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# nordcomputer-showoutofstockprice +Show prices of out-of-stock products diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..ba468c0 --- /dev/null +++ b/composer.json @@ -0,0 +1,20 @@ +{ + "name": "nordcomputer/showoutofstockprice", + "description": "Adds price to out-of-stock products", + "require": { + "php": "^7.1" + }, + "type": "magento2-module", + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Nordcomputer\\Showoutofstockprice\\": "" + } + } +} diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml new file mode 100644 index 0000000..5e4de5d --- /dev/null +++ b/etc/frontend/di.xml @@ -0,0 +1,9 @@ + + + + + + Nordcomputer\Showoutofstockprice\Model\ConfigurableProduct\ResourceModel\Product\StockStatusBaseSelectProcessor + + + diff --git a/etc/module.xml b/etc/module.xml new file mode 100644 index 0000000..7a26a5a --- /dev/null +++ b/etc/module.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/registration.php b/registration.php new file mode 100644 index 0000000..78d8846 --- /dev/null +++ b/registration.php @@ -0,0 +1,6 @@ +