Skip to content

Commit 285af5b

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #20589: [Backport] Fixed-Wishlist-alignment-issue-at-mobile-2.2 (by @amol2jcommerce) - #20644: [Backport] 19482 increase product quantity with disabled manage stock when place order is failed (by @amol2jcommerce) - #20257: [Backport]changes-add-your-review-text-is-not-show-uniformly-in-Mobile-view (by @amol2jcommerce) Fixed GitHub Issues: - #19482: Increase product quantity with disabled Manage Stock when place order is failed (reported by @iGerchak) has been fixed in #20644 by @amol2jcommerce in 2.2-develop branch Related commits: 1. abddea8 2. 5d38ec6 3. 582a1e7 - #20221: add your review text is not show uniformly in Mobile view (reported by @preeti-gupta123) has been fixed in #20257 by @amol2jcommerce in 2.2-develop branch Related commits: 1. 3b1be58
2 parents 745e9ac + 297a0ae commit 285af5b

File tree

7 files changed

+31
-17
lines changed

7 files changed

+31
-17
lines changed

app/code/Magento/CatalogInventory/Model/StockManagement.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function __construct(
8383

8484
/**
8585
* Subtract product qtys from stock.
86+
*
8687
* Return array of items that require full save.
8788
*
8889
* @param string[] $items
@@ -139,17 +140,25 @@ public function registerProductsSale($items, $websiteId = null)
139140
}
140141

141142
/**
142-
* @param string[] $items
143-
* @param int $websiteId
144-
* @return bool
143+
* @inheritdoc
145144
*/
146145
public function revertProductsSale($items, $websiteId = null)
147146
{
148147
//if (!$websiteId) {
149148
$websiteId = $this->stockConfiguration->getDefaultScopeId();
150149
//}
151-
$this->qtyCounter->correctItemsQty($items, $websiteId, '+');
152-
return true;
150+
$revertItems = [];
151+
foreach ($items as $productId => $qty) {
152+
$stockItem = $this->stockRegistryProvider->getStockItem($productId, $websiteId);
153+
$canSubtractQty = $stockItem->getItemId() && $this->canSubtractQty($stockItem);
154+
if (!$canSubtractQty || !$this->stockConfiguration->isQty($stockItem->getTypeId())) {
155+
continue;
156+
}
157+
$revertItems[$productId] = $qty;
158+
}
159+
$this->qtyCounter->correctItemsQty($revertItems, $websiteId, '+');
160+
161+
return $revertItems;
153162
}
154163

155164
/**
@@ -193,6 +202,8 @@ protected function getProductType($productId)
193202
}
194203

195204
/**
205+
* Get stock resource.
206+
*
196207
* @return ResourceStock
197208
*/
198209
protected function getResource()

app/code/Magento/CatalogInventory/Observer/RevertQuoteInventoryObserver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public function execute(EventObserver $observer)
6464
{
6565
$quote = $observer->getEvent()->getQuote();
6666
$items = $this->productQty->getProductQty($quote->getAllItems());
67-
$this->stockManagement->revertProductsSale($items, $quote->getStore()->getWebsiteId());
68-
$productIds = array_keys($items);
67+
$revertedItems = $this->stockManagement->revertProductsSale($items, $quote->getStore()->getWebsiteId());
68+
$productIds = array_keys($revertedItems);
6969
if (!empty($productIds)) {
7070
$this->stockIndexerProcessor->reindexList($productIds);
7171
$this->priceIndexer->reindexList($productIds);

app/design/frontend/Magento/blank/Magento_MultipleWishlist/web/css/source/_module.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@
342342
.product {
343343
&-item {
344344
&-checkbox {
345-
left: 20px;
345+
left: 0;
346346
position: absolute;
347347
top: 20px;
348348
}
@@ -381,16 +381,16 @@
381381
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
382382
.wishlist {
383383
&.window.popup {
384+
.field {
385+
.lib-form-field-type-revert(@_type: block);
386+
}
387+
384388
bottom: auto;
385389
.lib-css(top, @desktop-popup-position-top);
386390
.lib-css(left, @desktop-popup-position-left);
387391
.lib-css(margin-left, @desktop-popup-margin-left);
388392
.lib-css(width, @desktop-popup-width);
389393
right: auto;
390-
391-
.field {
392-
.lib-form-field-type-revert(@_type: block);
393-
}
394394
}
395395
}
396396

app/design/frontend/Magento/blank/Magento_Wishlist/web/css/source/_module.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@
177177
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
178178
.products-grid.wishlist {
179179
margin-bottom: @indent__l;
180-
margin-right: -@indent__s;
180+
margin-right: 0;
181181
.product {
182182
&-item {
183-
padding: @indent__base @indent__s @indent__base @indent__base;
183+
padding: @indent__base 0 @indent__base 0;
184184
position: relative;
185185

186186
&-photo {

app/design/frontend/Magento/luma/Magento_MultipleWishlist/web/css/source/_module.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@
435435
.product {
436436
&-item {
437437
&-checkbox {
438-
left: 20px;
438+
left: 0;
439439
position: absolute;
440440
top: 20px;
441441
}

app/design/frontend/Magento/luma/Magento_Review/web/css/source/_module.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@
298298
a:not(:last-child) {
299299
margin-right: 30px;
300300
}
301+
.action.add {
302+
white-space: nowrap;
303+
}
301304
}
302305
}
303306

app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/_module.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@
185185
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
186186
.products-grid.wishlist {
187187
margin-bottom: @indent__l;
188-
margin-right: -@indent__s;
188+
margin-right: 0;
189189

190190
.product {
191191
&-item {
192-
padding: @indent__base @indent__s @indent__base @indent__base;
192+
padding: @indent__base 0 @indent__base 0;
193193
position: relative;
194194

195195
&-photo {

0 commit comments

Comments
 (0)