|
| 1 | +diff --git a/vendor/magento/module-product-alert/Model/UpdateThemeParams.php b/vendor/magento/module-product-alert/Model/UpdateThemeParams.php |
| 2 | +new file mode 100644 |
| 3 | +index 0000000000000..df4c0b7981dbe |
| 4 | +--- /dev/null |
| 5 | ++++ b/vendor/magento/module-product-alert/Model/UpdateThemeParams.php |
| 6 | +@@ -0,0 +1,59 @@ |
| 7 | ++<?php |
| 8 | ++/** |
| 9 | ++ * Copyright 2025 Adobe |
| 10 | ++ * All Rights Reserved. |
| 11 | ++ */ |
| 12 | ++declare(strict_types=1); |
| 13 | ++ |
| 14 | ++namespace Magento\ProductAlert\Model; |
| 15 | ++ |
| 16 | ++use Magento\Framework\App\Area; |
| 17 | ++use Magento\Framework\Exception\NoSuchEntityException; |
| 18 | ++use Magento\Framework\View\DesignInterface; |
| 19 | ++use Magento\Framework\View\Element\Template\File\Resolver; |
| 20 | ++use Magento\ProductAlert\Block\Email\Stock; |
| 21 | ++use Magento\Store\Model\StoreManagerInterface; |
| 22 | ++ |
| 23 | ++/** |
| 24 | ++ * Check before get template file name consists of themeId, if not add the themeId to get proper theme |
| 25 | ++ */ |
| 26 | ++class UpdateThemeParams |
| 27 | ++{ |
| 28 | ++ /** |
| 29 | ++ * UpdateThemeParams constructor |
| 30 | ++ * |
| 31 | ++ * @param DesignInterface $design |
| 32 | ++ * @param StoreManagerInterface $storeManager |
| 33 | ++ * @param Stock $stock |
| 34 | ++ */ |
| 35 | ++ public function __construct( |
| 36 | ++ private readonly DesignInterface $design, |
| 37 | ++ private readonly StoreManagerInterface $storeManager, |
| 38 | ++ private readonly Stock $stock |
| 39 | ++ ) { |
| 40 | ++ } |
| 41 | ++ |
| 42 | ++ /** |
| 43 | ++ * Update theme params for multi store email templates |
| 44 | ++ * |
| 45 | ++ * @param Resolver $subject |
| 46 | ++ * @param string $template |
| 47 | ++ * @param array $params |
| 48 | ++ * @return array |
| 49 | ++ * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
| 50 | ++ * @throws NoSuchEntityException |
| 51 | ++ */ |
| 52 | ++ public function beforeGetTemplateFileName( |
| 53 | ++ Resolver $subject, |
| 54 | ++ string $template, |
| 55 | ++ array $params = [] |
| 56 | ++ ): array { |
| 57 | ++ if ($template === $this->stock->getTemplate() && !isset($params['themeId'])) { |
| 58 | ++ $params['themeId'] = $this->design->getConfigurationDesignTheme( |
| 59 | ++ Area::AREA_FRONTEND, |
| 60 | ++ ['store' => $this->storeManager->getStore()->getId()] |
| 61 | ++ ); |
| 62 | ++ } |
| 63 | ++ return [$template, $params]; |
| 64 | ++ } |
| 65 | ++} |
| 66 | +diff --git a/vendor/magento/module-product-alert/etc/di.xml b/vendor/magento/module-product-alert/etc/di.xml |
| 67 | +index cb9200ea4c52a..305e9f2825e83 100644 |
| 68 | +--- a/vendor/magento/module-product-alert/etc/di.xml |
| 69 | ++++ b/vendor/magento/module-product-alert/etc/di.xml |
| 70 | +@@ -1,9 +1,9 @@ |
| 71 | + <?xml version="1.0"?> |
| 72 | + <!-- |
| 73 | +-/** |
| 74 | +- * Copyright © Magento, Inc. All rights reserved. |
| 75 | +- * See COPYING.txt for license details. |
| 76 | +- */ |
| 77 | ++ /** |
| 78 | ++ * Copyright 2011 Adobe |
| 79 | ++ * All Rights Reserved. |
| 80 | ++ */ |
| 81 | + --> |
| 82 | + <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> |
| 83 | + <type name="Magento\Framework\Module\Setup\Migration"> |
| 84 | +@@ -20,4 +20,7 @@ |
| 85 | + </argument> |
| 86 | + </arguments> |
| 87 | + </type> |
| 88 | ++ <type name="Magento\Framework\View\Element\Template\File\Resolver"> |
| 89 | ++ <plugin name="updateThemeParams" type="Magento\ProductAlert\Model\UpdateThemeParams"/> |
| 90 | ++ </type> |
| 91 | + </config> |
0 commit comments