Skip to content

Commit 8cea142

Browse files
committed
Merge remote-tracking branch 'origin/MC-33230' into 2.4-develop-pr23
2 parents d05bc81 + 28757b0 commit 8cea142

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

app/code/Magento/Checkout/CustomerData/DefaultItem.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface;
1111

1212
/**
13-
* Default item
13+
* Default cart item
1414
*/
1515
class DefaultItem extends AbstractItem
1616
{
@@ -78,7 +78,7 @@ public function __construct(
7878
}
7979

8080
/**
81-
* {@inheritdoc}
81+
* @inheritdoc
8282
*/
8383
protected function doGetItemData()
8484
{
@@ -106,6 +106,7 @@ protected function doGetItemData()
106106
],
107107
'canApplyMsrp' => $this->msrpHelper->isShowBeforeOrderConfirm($this->item->getProduct())
108108
&& $this->msrpHelper->isMinimalPriceLessMsrp($this->item->getProduct()),
109+
'message' => $this->item->getMessage(),
109110
];
110111
}
111112

@@ -121,6 +122,8 @@ protected function getOptionList()
121122
}
122123

123124
/**
125+
* Returns product for thumbnail.
126+
*
124127
* @return \Magento\Catalog\Model\Product
125128
* @codeCoverageIgnore
126129
*/
@@ -130,6 +133,8 @@ protected function getProductForThumbnail()
130133
}
131134

132135
/**
136+
* Returns product.
137+
*
133138
* @return \Magento\Catalog\Model\Product
134139
* @codeCoverageIgnore
135140
*/

app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Checkout\Test\Unit\CustomerData;
77

88
use Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface;
9+
use PHPUnit\Framework\MockObject\MockObject;
910

1011
class DefaultItemTest extends \PHPUnit\Framework\TestCase
1112
{
@@ -25,7 +26,7 @@ class DefaultItemTest extends \PHPUnit\Framework\TestCase
2526
private $configurationPool;
2627

2728
/**
28-
* @var ItemResolverInterface|\PHPUnit_Framework_MockObject_MockObject
29+
* @var ItemResolverInterface|MockObject
2930
*/
3031
private $itemResolver;
3132

@@ -102,5 +103,6 @@ public function testGetItemData()
102103
$this->assertArrayHasKey('product_price_value', $itemData);
103104
$this->assertArrayHasKey('product_image', $itemData);
104105
$this->assertArrayHasKey('canApplyMsrp', $itemData);
106+
$this->assertArrayHasKey('message', $itemData);
105107
}
106108
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,7 @@
112112
</div>
113113
</div>
114114
</div>
115+
<div class="message notice" if="message">
116+
<div data-bind="text: message"></div>
117+
</div>
115118
</li>

app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@
246246
margin-bottom: @indent__xs;
247247
}
248248

249+
.message {
250+
margin-bottom: 0;
251+
margin-top: 10px;
252+
}
253+
249254
.product {
250255
> .product-item-photo,
251256
> .product-image-container {

app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@
264264
margin-bottom: @indent__xs;
265265
}
266266

267+
.message {
268+
margin-bottom: 0;
269+
margin-top: 10px;
270+
}
271+
267272
.product-item-name {
268273
font-weight: @font-weight__regular;
269274
margin: 0 0 @indent__s;

0 commit comments

Comments
 (0)