Skip to content

Commit 1284430

Browse files
authored
1.1.62 Release (#193)
1 parent 73ae870 commit 1284430

10 files changed

+1461
-2
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/quality-patches",
33
"description": "Provides quality patches for AdobeCommerce & Magento OpenSource",
44
"type": "magento2-component",
5-
"version": "1.1.61",
5+
"version": "1.1.62",
66
"license": "proprietary",
77
"repositories": {
88
"repo": {

patches-info.json

+1-1
Large diffs are not rendered by default.
+249
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
diff --git a/vendor/magento/module-gift-card/Model/GetGiftCardEmailUrl.php b/vendor/magento/module-gift-card/Model/GetGiftCardEmailUrl.php
2+
new file mode 100644
3+
index 000000000000..094c5a61d08d
4+
--- /dev/null
5+
+++ b/vendor/magento/module-gift-card/Model/GetGiftCardEmailUrl.php
6+
@@ -0,0 +1,52 @@
7+
+<?php
8+
+/************************************************************************
9+
+ *
10+
+ * ADOBE CONFIDENTIAL
11+
+ * ___________________
12+
+ *
13+
+ * Copyright 2025 Adobe
14+
+ * All Rights Reserved.
15+
+ *
16+
+ * NOTICE: All information contained herein is, and remains
17+
+ * the property of Adobe and its suppliers, if any. The intellectual
18+
+ * and technical concepts contained herein are proprietary to Adobe
19+
+ * and its suppliers and are protected by all applicable intellectual
20+
+ * property laws, including trade secret and copyright laws.
21+
+ * Dissemination of this information or reproduction of this material
22+
+ * is strictly forbidden unless prior written permission is obtained
23+
+ * from Adobe.
24+
+ * ************************************************************************
25+
+ */
26+
+declare(strict_types=1);
27+
+
28+
+namespace Magento\GiftCard\Model;
29+
+
30+
+use Magento\Framework\Url;
31+
+
32+
+/**
33+
+ * Get Gift card email url from the code and store ID
34+
+ */
35+
+class GetGiftCardEmailUrl
36+
+{
37+
+ /**
38+
+ * @param Url $urlBuilder
39+
+ */
40+
+ public function __construct(private readonly Url $urlBuilder)
41+
+ {
42+
+ }
43+
+
44+
+ /**
45+
+ * Get gift card URL from given code
46+
+ *
47+
+ * @param string $code
48+
+ * @param string $storeId
49+
+ * @return string
50+
+ */
51+
+ public function execute(string $code, string $storeId): string
52+
+ {
53+
+ return $this->urlBuilder->getUrl(
54+
+ 'magento_giftcardaccount/customer',
55+
+ ['giftcard' => $code, '_scope' => $storeId, '_nosid' => true]
56+
+ );
57+
+ }
58+
+}
59+
diff --git a/vendor/magento/module-gift-card/Model/GiftCardItemEmail.php b/vendor/magento/module-gift-card/Model/GiftCardItemEmail.php
60+
index c3364677db6a..7111ce574b16 100644
61+
--- a/vendor/magento/module-gift-card/Model/GiftCardItemEmail.php
62+
+++ b/vendor/magento/module-gift-card/Model/GiftCardItemEmail.php
63+
@@ -1,7 +1,21 @@
64+
<?php
65+
-/**
66+
- * Copyright © Magento, Inc. All rights reserved.
67+
- * See COPYING.txt for license details.
68+
+/************************************************************************
69+
+ *
70+
+ * ADOBE CONFIDENTIAL
71+
+ * ___________________
72+
+ *
73+
+ * Copyright 2018 Adobe
74+
+ * All Rights Reserved.
75+
+ *
76+
+ * NOTICE: All information contained herein is, and remains
77+
+ * the property of Adobe and its suppliers, if any. The intellectual
78+
+ * and technical concepts contained herein are proprietary to Adobe
79+
+ * and its suppliers and are protected by all applicable intellectual
80+
+ * property laws, including trade secret and copyright laws.
81+
+ * Dissemination of this information or reproduction of this material
82+
+ * is strictly forbidden unless prior written permission is obtained
83+
+ * from Adobe.
84+
+ * ************************************************************************
85+
*/
86+
declare(strict_types=1);
87+
88+
@@ -9,26 +23,29 @@
89+
90+
use Magento\Framework\App\Area;
91+
use Magento\Framework\App\Config\ScopeConfigInterface;
92+
+use Magento\Framework\App\ObjectManager;
93+
+use Magento\Framework\Currency\Exception\CurrencyException;
94+
+use Magento\Framework\Exception\LocalizedException;
95+
+use Magento\Framework\Exception\MailException;
96+
use Magento\Framework\Locale\CurrencyInterface;
97+
use Magento\Framework\Mail\Template\TransportBuilder;
98+
-use Magento\Store\Model\ScopeInterface;
99+
+use Magento\GiftCard\Helper\Data;
100+
use Magento\Sales\Model\Order\Item as OrderItem;
101+
+use Magento\Store\Model\ScopeInterface;
102+
103+
/**
104+
* Sends email with info about created gift cards.
105+
+ *
106+
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
107+
*/
108+
class GiftCardItemEmail
109+
{
110+
/**
111+
- * Gift card data
112+
- *
113+
- * @var \Magento\GiftCard\Helper\Data
114+
+ * @var Data
115+
*/
116+
private $giftCardData;
117+
118+
/**
119+
- * Scope config
120+
- *
121+
* @var ScopeConfigInterface
122+
*/
123+
private $scopeConfig;
124+
@@ -43,22 +60,31 @@ class GiftCardItemEmail
125+
*/
126+
private $localeCurrency;
127+
128+
+ /**
129+
+ * @var GetGiftCardEmailUrl
130+
+ */
131+
+ private $getGiftCardEmailUrl;
132+
+
133+
/**
134+
* @param CurrencyInterface $localeCurrency
135+
* @param TransportBuilder $transportBuilder
136+
- * @param \Magento\GiftCard\Helper\Data $giftCardData
137+
+ * @param Data $giftCardData
138+
* @param ScopeConfigInterface $scopeConfig
139+
+ * @param GetGiftCardEmailUrl|null $getGiftCardEmailUrl
140+
*/
141+
public function __construct(
142+
- CurrencyInterface $localeCurrency,
143+
- TransportBuilder $transportBuilder,
144+
- \Magento\GiftCard\Helper\Data $giftCardData,
145+
- ScopeConfigInterface $scopeConfig
146+
+ CurrencyInterface $localeCurrency,
147+
+ TransportBuilder $transportBuilder,
148+
+ Data $giftCardData,
149+
+ ScopeConfigInterface $scopeConfig,
150+
+ ?GetGiftCardEmailUrl $getGiftCardEmailUrl = null
151+
) {
152+
$this->localeCurrency = $localeCurrency;
153+
$this->transportBuilder = $transportBuilder;
154+
$this->giftCardData = $giftCardData;
155+
$this->scopeConfig = $scopeConfig;
156+
+ $this->getGiftCardEmailUrl = $getGiftCardEmailUrl ?: ObjectManager::getInstance()
157+
+ ->get(GetGiftCardEmailUrl::class);
158+
}
159+
160+
/**
161+
@@ -66,10 +92,13 @@ public function __construct(
162+
*
163+
* @param OrderItem $giftCardOrderItem
164+
* @param array $codes
165+
+ * @param int $generatedCodesCount
166+
* @param int $isRedeemable
167+
* @param float|null $amount
168+
- * @param int $generatedCodesCount
169+
* @return void
170+
+ * @throws CurrencyException
171+
+ * @throws LocalizedException
172+
+ * @throws MailException
173+
*/
174+
public function send(
175+
OrderItem $giftCardOrderItem,
176+
@@ -91,7 +120,8 @@ public function send(
177+
->setCodes($codes)
178+
->setArea(Area::AREA_FRONTEND)
179+
->setIsRedeemable($isRedeemable)
180+
- ->setStore($giftCardOrderItem->getStore());
181+
+ ->setStore($giftCardOrderItem->getStore())
182+
+ ->setHelper($this->getGiftCardEmailUrl);
183+
184+
$baseCurrencyCode = $giftCardOrderItem->getStore()
185+
->getBaseCurrencyCode();
186+
diff --git a/vendor/magento/module-gift-card/view/frontend/templates/email/generated.phtml b/vendor/magento/module-gift-card/view/frontend/templates/email/generated.phtml
187+
index b1b0e7afc2f5..5d19807fecfa 100644
188+
--- a/vendor/magento/module-gift-card/view/frontend/templates/email/generated.phtml
189+
+++ b/vendor/magento/module-gift-card/view/frontend/templates/email/generated.phtml
190+
@@ -1,22 +1,44 @@
191+
<?php
192+
-/**
193+
- * Copyright © Magento, Inc. All rights reserved.
194+
- * See COPYING.txt for license details.
195+
+/************************************************************************
196+
+ *
197+
+ * ADOBE CONFIDENTIAL
198+
+ * ___________________
199+
+ *
200+
+ * Copyright 2014 Adobe
201+
+ * All Rights Reserved.
202+
+ *
203+
+ * NOTICE: All information contained herein is, and remains
204+
+ * the property of Adobe and its suppliers, if any. The intellectual
205+
+ * and technical concepts contained herein are proprietary to Adobe
206+
+ * and its suppliers and are protected by all applicable intellectual
207+
+ * property laws, including trade secret and copyright laws.
208+
+ * Dissemination of this information or reproduction of this material
209+
+ * is strictly forbidden unless prior written permission is obtained
210+
+ * from Adobe.
211+
+ * ************************************************************************
212+
*/
213+
214+
-/** @var \Magento\GiftCard\Block\Generated $block */
215+
-?>
216+
-<?php $_codes = $block->getCodes(); ?>
217+
-<?php $_isRedeemable = $block->getIsRedeemable(); ?>
218+
+/** @var Generated $block */
219+
+/** @var Escaper $escaper */
220+
+/** @var GetGiftCardEmailUrl $giftCardEmailUrlHelper */
221+
+
222+
+use Magento\Framework\Escaper;
223+
+use Magento\GiftCard\Block\Generated;
224+
+use Magento\GiftCard\Model\GetGiftCardEmailUrl;
225+
226+
-<?php foreach ($_codes as $_code) : ?>
227+
- <?php if ($_code) : ?>
228+
- <?php if ($_isRedeemable) : ?>
229+
- <a href="<?= $block->escapeUrl($block->getUrl('magento_giftcardaccount/customer', ['giftcard' => $_code, '_nosid' => true])) ?>">
230+
- <?= $block->escapeHtml($_code)?>
231+
+$getGiftCardEmailUrl = $block->getData('helper');
232+
+$storeId = $block->getStoreId() ?? $block->getStore()->getStoreId();
233+
+?>
234+
+<?php $_codes = $block->getCodes();?>
235+
+<?php $_isRedeemable = $block->getIsRedeemable();?>
236+
+<?php foreach ($_codes as $_code):?>
237+
+ <?php if ($_code):?>
238+
+ <?php if ($_isRedeemable):?>
239+
+ <a href="<?= $escaper->escapeUrl($getGiftCardEmailUrl->execute($_code, $storeId)); ?>">
240+
+ <?= $escaper->escapeHtml($_code)?>
241+
</a>
242+
- <?php else : ?>
243+
- <?= $block->escapeHtml($_code) ?>
244+
+ <?php else: ?>
245+
+ <?= $escaper->escapeHtml($_code) ?>
246+
<?php endif; ?>
247+
<br />
248+
<?php endif; ?>
249+
+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
diff --git a/vendor/magento/module-customer-segment/Plugin/Framework/App/ActionInterfacePlugin.php b/vendor/magento/module-customer-segment/Plugin/Framework/App/ActionInterfacePlugin.php
2+
new file mode 100644
3+
index 000000000000..bc308097d3ce
4+
--- /dev/null
5+
+++ b/vendor/magento/module-customer-segment/Plugin/Framework/App/ActionInterfacePlugin.php
6+
@@ -0,0 +1,68 @@
7+
+<?php
8+
+/**
9+
+ *
10+
+ * ADOBE CONFIDENTIAL
11+
+ * ___________________
12+
+ *
13+
+ * Copyright 2025 Adobe
14+
+ * All Rights Reserved.
15+
+ *
16+
+ * NOTICE: All information contained herein is, and remains
17+
+ * the property of Adobe and its suppliers, if any. The intellectual
18+
+ * and technical concepts contained herein are proprietary to Adobe
19+
+ * and its suppliers and are protected by all applicable intellectual
20+
+ * property laws, including trade secret and copyright laws.
21+
+ * Dissemination of this information or reproduction of this material
22+
+ * is strictly forbidden unless prior written permission is obtained
23+
+ * from Adobe.
24+
+ */
25+
+declare(strict_types=1);
26+
+
27+
+namespace Magento\CustomerSegment\Plugin\Framework\App;
28+
+
29+
+use Magento\Framework\App\Http\Context;
30+
+use Magento\Framework\App\ActionInterface;
31+
+use Magento\Framework\Exception\LocalizedException;
32+
+use Magento\Customer\Model\Session;
33+
+use Magento\CustomerSegment\Model\Customer;
34+
+use Magento\CustomerSegment\Helper\Data;
35+
+use Magento\Store\Model\StoreManagerInterface;
36+
+
37+
+class ActionInterfacePlugin
38+
+{
39+
+ /**
40+
+ * @param Session $customerSession
41+
+ * @param Context $httpContext
42+
+ * @param Customer $customerSegment
43+
+ * @param StoreManagerInterface $storeManager
44+
+ */
45+
+ public function __construct(
46+
+ private readonly Session $customerSession,
47+
+ private readonly Context $httpContext,
48+
+ private readonly Customer $customerSegment,
49+
+ private readonly StoreManagerInterface $storeManager
50+
+ ) {
51+
+ }
52+
+
53+
+ /**
54+
+ * Set customer segment ids into HTTP context
55+
+ *
56+
+ * @param ActionInterface $subject
57+
+ * @throws LocalizedException
58+
+ * @return void
59+
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
60+
+ */
61+
+ public function beforeExecute(
62+
+ ActionInterface $subject
63+
+ ): void {
64+
+ if ($this->customerSession->getCustomerId()) {
65+
+ $customerSegmentIds = $this->customerSegment->getCustomerSegmentIdsForWebsite(
66+
+ $this->customerSession->getCustomerId(),
67+
+ $this->storeManager->getWebsite()->getId()
68+
+ );
69+
+ $this->httpContext->setValue(Data::CONTEXT_SEGMENT, $customerSegmentIds, []);
70+
+ } else {
71+
+ $this->httpContext->setValue(Data::CONTEXT_SEGMENT, [], []);
72+
+ }
73+
+ }
74+
+}
75+
diff --git a/vendor/magento/module-customer-segment/etc/frontend/di.xml b/vendor/magento/module-customer-segment/etc/frontend/di.xml
76+
index 5b4794e6a1ec..8ae129288314 100644
77+
--- a/vendor/magento/module-customer-segment/etc/frontend/di.xml
78+
+++ b/vendor/magento/module-customer-segment/etc/frontend/di.xml
79+
@@ -1,8 +1,21 @@
80+
<?xml version="1.0"?>
81+
<!--
82+
/**
83+
- * Copyright © Magento, Inc. All rights reserved.
84+
- * See COPYING.txt for license details.
85+
+ *
86+
+ * ADOBE CONFIDENTIAL
87+
+ * ___________________
88+
+ *
89+
+ * Copyright 2014 Adobe
90+
+ * All Rights Reserved.
91+
+ *
92+
+ * NOTICE: All information contained herein is, and remains
93+
+ * the property of Adobe and its suppliers, if any. The intellectual
94+
+ * and technical concepts contained herein are proprietary to Adobe
95+
+ * and its suppliers and are protected by all applicable intellectual
96+
+ * property laws, including trade secret and copyright laws.
97+
+ * Dissemination of this information or reproduction of this material
98+
+ * is strictly forbidden unless prior written permission is obtained
99+
+ * from Adobe.
100+
*/
101+
-->
102+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
103+
@@ -14,6 +27,10 @@
104+
<plugin name="customer-segment-app-action-dispatchController-context-plugin"
105+
type="Magento\CustomerSegment\Model\App\Action\ContextPlugin" sortOrder="10"/>
106+
</type>
107+
+ <type name="Magento\Framework\App\ActionInterface">
108+
+ <plugin name="customer-segment-app-action-execute-context-plugin"
109+
+ type="Magento\CustomerSegment\Plugin\Framework\App\ActionInterfacePlugin" sortOrder="10"/>
110+
+ </type>
111+
<type name="Magento\Checkout\Model\Cart\CollectQuote">
112+
<plugin name="checkout_cart_collect_totals" type="Magento\CustomerSegment\Model\Checkout\Block\Cart\Shipping\Plugin"/>
113+
</type>

0 commit comments

Comments
 (0)