I have a output structure of $collection like this:
I have array with sample data:
$arr = [
'id_1' => 10,
'id_2' => 30,
'id_3' => 20
]
I need add $arr to above collection and then i have it’s output:
After that, i can filter with price:
$collection->addAttributeToFilter('price', ['gt' => 12]);
How do I achieve this?