products_collection.filter
Allows to perform preparation actions in the product collection handling class constructor.
Shop-Script
Input (passed by reference)
$collection shopProductsCollection Product collection handling class instance.
… your plugin code …
Output
Shop-Script
Plugin code example
PHP
public function productsCollectionFilter(shopProductsCollection $collection)
{
$collection_hash = $collection->getHash();
if (is_array($collection_hash) && reset($collection_hash) == 'category' && wa()->getEnv() == 'frontend') {
// Show only products with price above 0 in frontend categories
$collection->addWhere('price > 0');
}
}









