I've been trying to something for days and stuck! Need help. I'm trying to manipulate the getloadedproductcollection() method called in list.phtml file in catalog/product. I want to remove the duplicate entries of a product(by name). I tried to apply filters in phtml files but with no success. When looked in the list.php file, couldn't get anything to achieve what I want. Is there any possible way to apply that filter to the product collection on category pages.
I tried getSelect()->group('name')
as it was mentioned on a question in stackoverflow, but it generated error. Can't do distinct()
as it is having no effect. Also tried removeItemByKey(&key)
inside foreach loop, it again generated error.
Can anyone redirect me to right direction, as it strongly feel, it should be possible in an environment like magento.
P.S.: don't want to delete duplicate products from backend as they are necessity.