Skip to content

Commit 773fb1d

Browse files
committed
ACP2E-459: Qty from Wishlist is not updated when clicked from edit product.
1 parent 2c7f4a1 commit 773fb1d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app/code/Magento/Wishlist/Helper/Data.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ public function getConfigureUrl($item)
322322
'wishlist/index/configure',
323323
[
324324
'id' => $item->getWishlistItemId(),
325-
'product_id' => $item->getProductId()
325+
'product_id' => $item->getProductId(),
326+
'qty' => (int)$item->getQty()
326327
]
327328
);
328329
}

app/code/Magento/Wishlist/Test/Unit/Helper/DataTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ public function testGetAddToCartUrl()
184184

185185
public function testGetConfigureUrl()
186186
{
187-
$url = 'http://magento2ce/wishlist/index/configure/id/4/product_id/30/';
187+
$url = 'http://magento2ce/wishlist/index/configure/id/4/product_id/30/qty/1000';
188188

189189
/** @var WishlistItem|MockObject $wishlistItem */
190190
$wishlistItem = $this->getMockBuilder(WishlistItem::class)
191-
->addMethods(['getWishlistItemId', 'getProductId'])
191+
->addMethods(['getWishlistItemId', 'getProductId', 'getQty'])
192192
->disableOriginalConstructor()
193193
->getMock();
194194
$wishlistItem
@@ -199,10 +199,14 @@ public function testGetConfigureUrl()
199199
->expects($this->once())
200200
->method('getProductId')
201201
->willReturn(30);
202+
$wishlistItem
203+
->expects($this->once())
204+
->method('getQty')
205+
->willReturn(1000);
202206

203207
$this->urlBuilder->expects($this->once())
204208
->method('getUrl')
205-
->with('wishlist/index/configure', ['id' => 4, 'product_id' => 30])
209+
->with('wishlist/index/configure', ['id' => 4, 'product_id' => 30, 'qty' => 1000])
206210
->willReturn($url);
207211

208212
$this->assertEquals($url, $this->model->getConfigureUrl($wishlistItem));

0 commit comments

Comments
 (0)