Skip to content

Commit c01cd6b

Browse files
[Magento Community Engineering] Community Contributions - 2.3-develop-fast-lane-prs
- merged with '2.3-develop-prs' branch
2 parents 6266bf2 + 4f8d0c6 commit c01cd6b

File tree

16 files changed

+98
-46
lines changed

16 files changed

+98
-46
lines changed

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@
4444
<!-- ko if: Array.isArray(option.value) -->
4545
<span data-bind="html: option.value.join('<br>')"></span>
4646
<!-- /ko -->
47-
<!-- ko ifnot: Array.isArray(option.value) -->
47+
<!-- ko if: (!Array.isArray(option.value) && option.option_type == 'file') -->
48+
<span data-bind="html: option.value"></span>
49+
<!-- /ko -->
50+
<!-- ko if: (!Array.isArray(option.value) && option.option_type != 'file') -->
4851
<span data-bind="text: option.value"></span>
4952
<!-- /ko -->
5053
</dd>

app/code/Magento/Eav/Model/AttributeProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Eav\Model;
89

@@ -52,7 +53,7 @@ public function __construct(
5253
* Returns array of fields
5354
*
5455
* @param string $entityType
55-
* @return array
56+
* @return string[]
5657
* @throws \Exception
5758
*/
5859
public function getAttributes($entityType)
@@ -66,6 +67,7 @@ public function getAttributes($entityType)
6667
foreach ($searchResult->getItems() as $attribute) {
6768
$attributes[] = $attribute->getAttributeCode();
6869
}
70+
6971
return $attributes;
7072
}
7173
}

app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\Quote\Model\Quote\Address\Total;
710

811
use Magento\Framework\Pricing\PriceCurrencyInterface;
@@ -112,17 +115,21 @@ public function collect(
112115
*/
113116
public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total)
114117
{
115-
$amount = $total->getShippingAmount();
116-
$shippingDescription = $total->getShippingDescription();
117-
$title = ($shippingDescription)
118-
? __('Shipping & Handling (%1)', $shippingDescription)
119-
: __('Shipping & Handling');
118+
if (!$quote->getIsVirtual()) {
119+
$amount = $total->getShippingAmount();
120+
$shippingDescription = $total->getShippingDescription();
121+
$title = ($shippingDescription)
122+
? __('Shipping & Handling (%1)', $shippingDescription)
123+
: __('Shipping & Handling');
120124

121-
return [
122-
'code' => $this->getCode(),
123-
'title' => $title,
124-
'value' => $amount
125-
];
125+
return [
126+
'code' => $this->getCode(),
127+
'title' => $title,
128+
'value' => $amount
129+
];
130+
} else {
131+
return [];
132+
}
126133
}
127134

128135
/**

app/code/Magento/Sales/Model/Order/Email/Sender.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212

1313
/**
1414
* Class Sender
15-
* @api
1615
*
16+
* phpcs:disable Magento2.Classes.AbstractApi
17+
* @api
1718
* @since 100.0.2
1819
*/
1920
abstract class Sender
@@ -87,10 +88,12 @@ protected function checkAndSend(Order $order)
8788
$this->logger->error($e->getMessage());
8889
return false;
8990
}
90-
try {
91-
$sender->sendCopyTo();
92-
} catch (\Exception $e) {
93-
$this->logger->error($e->getMessage());
91+
if ($this->identityContainer->getCopyMethod() == 'copy') {
92+
try {
93+
$sender->sendCopyTo();
94+
} catch (\Exception $e) {
95+
$this->logger->error($e->getMessage());
96+
}
9497
}
9598
return true;
9699
}

app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function sendCopyTo()
8484
{
8585
$copyTo = $this->identityContainer->getEmailCopyTo();
8686

87-
if (!empty($copyTo) && $this->identityContainer->getCopyMethod() == 'copy') {
87+
if (!empty($copyTo)) {
8888
$this->configureEmailTemplate();
8989
foreach ($copyTo as $email) {
9090
$this->transportBuilder->addTo($email);

app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
283283
->willReturn($emailSendingResult);
284284

285285
if ($emailSendingResult) {
286+
$this->identityContainerMock->expects($this->once())
287+
->method('getCopyMethod')
288+
->willReturn('copy');
289+
286290
$this->senderBuilderFactoryMock->expects($this->once())
287291
->method('create')
288292
->willReturn($this->senderMock);

app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/CreditmemoSenderTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function setUp()
5757

5858
$this->identityContainerMock = $this->createPartialMock(
5959
\Magento\Sales\Model\Order\Email\Container\CreditmemoIdentity::class,
60-
['getStore', 'isEnabled', 'getConfigValue', 'getTemplateId', 'getGuestTemplateId']
60+
['getStore', 'isEnabled', 'getConfigValue', 'getTemplateId', 'getGuestTemplateId', 'getCopyMethod']
6161
);
6262
$this->identityContainerMock->expects($this->any())
6363
->method('getStore')
@@ -138,6 +138,10 @@ public function testSend($configValue, $forceSyncMode, $customerNoteNotify, $ema
138138
->willReturn($emailSendingResult);
139139

140140
if ($emailSendingResult) {
141+
$this->identityContainerMock->expects($this->once())
142+
->method('getCopyMethod')
143+
->willReturn('copy');
144+
141145
$this->senderBuilderFactoryMock->expects($this->once())
142146
->method('create')
143147
->willReturn($this->senderMock);

app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceSenderTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function setUp()
5757

5858
$this->identityContainerMock = $this->createPartialMock(
5959
\Magento\Sales\Model\Order\Email\Container\InvoiceIdentity::class,
60-
['getStore', 'isEnabled', 'getConfigValue', 'getTemplateId', 'getGuestTemplateId']
60+
['getStore', 'isEnabled', 'getConfigValue', 'getTemplateId', 'getGuestTemplateId', 'getCopyMethod']
6161
);
6262
$this->identityContainerMock->expects($this->any())
6363
->method('getStore')
@@ -144,6 +144,10 @@ public function testSend($configValue, $forceSyncMode, $customerNoteNotify, $ema
144144
->willReturn($emailSendingResult);
145145

146146
if ($emailSendingResult) {
147+
$this->identityContainerMock->expects($this->once())
148+
->method('getCopyMethod')
149+
->willReturn('copy');
150+
147151
$this->senderBuilderFactoryMock->expects($this->once())
148152
->method('create')
149153
->willReturn($this->senderMock);

app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/OrderSenderTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function setUp()
3030

3131
$this->identityContainerMock = $this->createPartialMock(
3232
\Magento\Sales\Model\Order\Email\Container\OrderIdentity::class,
33-
['getStore', 'isEnabled', 'getConfigValue', 'getTemplateId', 'getGuestTemplateId']
33+
['getStore', 'isEnabled', 'getConfigValue', 'getTemplateId', 'getGuestTemplateId', 'getCopyMethod']
3434
);
3535
$this->identityContainerMock->expects($this->any())
3636
->method('getStore')
@@ -77,6 +77,10 @@ public function testSend($configValue, $forceSyncMode, $emailSendingResult, $sen
7777
->willReturn($emailSendingResult);
7878

7979
if ($emailSendingResult) {
80+
$this->identityContainerMock->expects($senderSendException ? $this->never() : $this->once())
81+
->method('getCopyMethod')
82+
->willReturn('copy');
83+
8084
$addressMock = $this->createMock(\Magento\Sales\Model\Order\Address::class);
8185

8286
$this->addressRenderer->expects($this->any())
@@ -214,6 +218,10 @@ public function testSendVirtualOrder($isVirtualOrder, $formatCallCount, $expecte
214218
->method('isEnabled')
215219
->willReturn(true);
216220

221+
$this->identityContainerMock->expects($this->once())
222+
->method('getCopyMethod')
223+
->willReturn('copy');
224+
217225
$addressMock = $this->createMock(\Magento\Sales\Model\Order\Address::class);
218226

219227
$this->addressRenderer->expects($this->exactly($formatCallCount))

app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/ShipmentSenderTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function setUp()
5757

5858
$this->identityContainerMock = $this->createPartialMock(
5959
\Magento\Sales\Model\Order\Email\Container\ShipmentIdentity::class,
60-
['getStore', 'isEnabled', 'getConfigValue', 'getTemplateId', 'getGuestTemplateId']
60+
['getStore', 'isEnabled', 'getConfigValue', 'getTemplateId', 'getGuestTemplateId', 'getCopyMethod']
6161
);
6262
$this->identityContainerMock->expects($this->any())
6363
->method('getStore')
@@ -144,6 +144,10 @@ public function testSend($configValue, $forceSyncMode, $customerNoteNotify, $ema
144144
->willReturn($emailSendingResult);
145145

146146
if ($emailSendingResult) {
147+
$this->identityContainerMock->expects($this->once())
148+
->method('getCopyMethod')
149+
->willReturn('copy');
150+
147151
$this->senderBuilderFactoryMock->expects($this->once())
148152
->method('create')
149153
->willReturn($this->senderMock);

0 commit comments

Comments
 (0)