Skip to content

Commit 6e4326b

Browse files
author
Roman Lytvynenko
committed
MC-19060: [Magento Cloud] Incorrect SKU wishlist count
1 parent c1a0451 commit 6e4326b

File tree

1 file changed

+17
-0
lines changed
  • app/code/Magento/Wishlist/Model/ResourceModel/Item/Collection

1 file changed

+17
-0
lines changed

app/code/Magento/Wishlist/Model/ResourceModel/Item/Collection/Grid.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,18 @@ public function setOrder($field, $direction = self::SORT_ORDER_DESC)
126126
}
127127
}
128128

129+
/**
130+
* Add quantity to filter
131+
*
132+
* @param $field
133+
* @param $condition
134+
* @return \Magento\Wishlist\Model\ResourceModel\Item\Collection
135+
*/
136+
private function addQtyFilter($field, $condition)
137+
{
138+
return parent::addFieldToFilter('main_table.' . $field, $condition);
139+
}
140+
129141
/**
130142
* Add field filter to collection
131143
*
@@ -150,6 +162,11 @@ public function addFieldToFilter($field, $condition = null)
150162
if (!isset($condition['datetime'])) {
151163
return $this->addDaysFilter($condition);
152164
}
165+
break;
166+
case 'qty':
167+
if (isset($condition['from']) || isset($condition['to'])) {
168+
return $this->addQtyFilter($field, $condition);
169+
}
153170
}
154171
return parent::addFieldToFilter($field, $condition);
155172
}

0 commit comments

Comments
 (0)