Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.2-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - magento#20589: [Backport] Fixed-Wishlist-alignment-issue-at-mobile-2.2 (by @amol2jcommerce)
 - magento#20644: [Backport] 19482 increase product quantity with disabled manage stock when place order is failed (by @amol2jcommerce)
 - magento#20257: [Backport]changes-add-your-review-text-is-not-show-uniformly-in-Mobile-view (by @amol2jcommerce)


Fixed GitHub Issues:
 - magento#19482: Increase product quantity with disabled Manage Stock when place order is failed (reported by @iGerchak) has been fixed in magento#20644 by @amol2jcommerce in 2.2-develop branch
   Related commits:
     1. abddea8
     2. 5d38ec6
     3. 582a1e7

 - magento#20221: add your review text is not show uniformly in Mobile view (reported by @preeti-gupta123) has been fixed in magento#20257 by @amol2jcommerce in 2.2-develop branch
   Related commits:
     1. 3b1be58
  • Loading branch information
magento-engcom-team authored Feb 9, 2019
2 parents 745e9ac + 297a0ae commit 285af5b
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 17 deletions.
21 changes: 16 additions & 5 deletions app/code/Magento/CatalogInventory/Model/StockManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function __construct(

/**
* Subtract product qtys from stock.
*
* Return array of items that require full save.
*
* @param string[] $items
Expand Down Expand Up @@ -139,17 +140,25 @@ public function registerProductsSale($items, $websiteId = null)
}

/**
* @param string[] $items
* @param int $websiteId
* @return bool
* @inheritdoc
*/
public function revertProductsSale($items, $websiteId = null)
{
//if (!$websiteId) {
$websiteId = $this->stockConfiguration->getDefaultScopeId();
//}
$this->qtyCounter->correctItemsQty($items, $websiteId, '+');
return true;
$revertItems = [];
foreach ($items as $productId => $qty) {
$stockItem = $this->stockRegistryProvider->getStockItem($productId, $websiteId);
$canSubtractQty = $stockItem->getItemId() && $this->canSubtractQty($stockItem);
if (!$canSubtractQty || !$this->stockConfiguration->isQty($stockItem->getTypeId())) {
continue;
}
$revertItems[$productId] = $qty;
}
$this->qtyCounter->correctItemsQty($revertItems, $websiteId, '+');

return $revertItems;
}

/**
Expand Down Expand Up @@ -193,6 +202,8 @@ protected function getProductType($productId)
}

/**
* Get stock resource.
*
* @return ResourceStock
*/
protected function getResource()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public function execute(EventObserver $observer)
{
$quote = $observer->getEvent()->getQuote();
$items = $this->productQty->getProductQty($quote->getAllItems());
$this->stockManagement->revertProductsSale($items, $quote->getStore()->getWebsiteId());
$productIds = array_keys($items);
$revertedItems = $this->stockManagement->revertProductsSale($items, $quote->getStore()->getWebsiteId());
$productIds = array_keys($revertedItems);
if (!empty($productIds)) {
$this->stockIndexerProcessor->reindexList($productIds);
$this->priceIndexer->reindexList($productIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
.product {
&-item {
&-checkbox {
left: 20px;
left: 0;
position: absolute;
top: 20px;
}
Expand Down Expand Up @@ -381,16 +381,16 @@
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
.wishlist {
&.window.popup {
.field {
.lib-form-field-type-revert(@_type: block);
}

bottom: auto;
.lib-css(top, @desktop-popup-position-top);
.lib-css(left, @desktop-popup-position-left);
.lib-css(margin-left, @desktop-popup-margin-left);
.lib-css(width, @desktop-popup-width);
right: auto;

.field {
.lib-form-field-type-revert(@_type: block);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
.products-grid.wishlist {
margin-bottom: @indent__l;
margin-right: -@indent__s;
margin-right: 0;
.product {
&-item {
padding: @indent__base @indent__s @indent__base @indent__base;
padding: @indent__base 0 @indent__base 0;
position: relative;

&-photo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@
.product {
&-item {
&-checkbox {
left: 20px;
left: 0;
position: absolute;
top: 20px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@
a:not(:last-child) {
margin-right: 30px;
}
.action.add {
white-space: nowrap;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
.products-grid.wishlist {
margin-bottom: @indent__l;
margin-right: -@indent__s;
margin-right: 0;

.product {
&-item {
padding: @indent__base @indent__s @indent__base @indent__base;
padding: @indent__base 0 @indent__base 0;
position: relative;

&-photo {
Expand Down

0 comments on commit 285af5b

Please sign in to comment.