Skip to content

Commit 8c53c2d

Browse files
authored
Merge pull request #5140 from magento-borg/MC-29780
[CIA] MC-29780: Cannot add configurable product to cart
2 parents 8dcd0a7 + 5835e88 commit 8c53c2d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ public function getIdentities()
355355
}
356356

357357
foreach ($this->_getProductCollection() as $item) {
358+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
358359
$identities = array_merge($identities, $item->getIdentities());
359360
}
360361

@@ -369,7 +370,7 @@ public function getIdentities()
369370
*/
370371
public function getAddToCartPostParams(Product $product)
371372
{
372-
$url = $this->getAddToCartUrl($product);
373+
$url = $this->getAddToCartUrl($product, ['_escape' => false]);
373374
return [
374375
'action' => $url,
375376
'data' => [

app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public function testGetAddToCartPostParams()
217217
->will($this->returnValue(true));
218218
$this->cartHelperMock->expects($this->any())
219219
->method('getAddUrl')
220-
->with($this->equalTo($this->productMock), $this->equalTo([]))
220+
->with($this->equalTo($this->productMock), $this->equalTo(['_escape' => false]))
221221
->will($this->returnValue($url));
222222
$this->productMock->expects($this->once())
223223
->method('getEntityId')

0 commit comments

Comments
 (0)