Skip to content

Commit 3aeaf0f

Browse files
MC-33230: [Magento Cloud] - Minicart stock verification
1 parent d4a9098 commit 3aeaf0f

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,6 @@ public function testGetItemData()
102102
$this->assertArrayHasKey('product_price_value', $itemData);
103103
$this->assertArrayHasKey('product_image', $itemData);
104104
$this->assertArrayHasKey('canApplyMsrp', $itemData);
105+
$this->assertArrayHasKey('message', $itemData);
105106
}
106107
}

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-top: 10px;
251+
margin-bottom: 0px;
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-top: 10px;
269+
margin-bottom: 0px;
270+
}
271+
267272
.product-item-name {
268273
font-weight: @font-weight__regular;
269274
margin: 0 0 @indent__s;

0 commit comments

Comments
 (0)