I’m trying to join the tier price table to the getLoadedProductCollection () collection located in the list.phtml file.
What I would like to do is filter the products in the current category by tier price like so:
$joinConditions = 'e.entity_id = tier.entity_id';
$_productCollection = $block->getLoadedProductCollection();
$_productCollection->getSelect()->join(
'catalog_product_entity_tier_price as tier',
$joinConditions
)->where('tier.all_groups = 0')
->where('tier.customer_group_id = 0')
->where('tier.qty <= 1000')
->where('tier.value <= 0.70')
->where('tier.website_id = 0');
The following code does not generate an error but does not apply any filters and I keep seeing the same products over and over.
Where is the mistake?