Skip to content

Instantly share code, notes, and snippets.

@DevJohnC
Created June 25, 2012 22:46
Show Gist options
  • Select an option

  • Save DevJohnC/2991930 to your computer and use it in GitHub Desktop.

Select an option

Save DevJohnC/2991930 to your computer and use it in GitHub Desktop.
Filtering specials
<?php
// in functions.php?
Hooks::addFilter('specials_filter', 'filterTheSpecials');
function filterTheSpecials($filter)
{
// limit to physical products only
$filter->limitTo('PhysicalProduct');
// or limit to the Computer category
$filter->limitTo('Category', 'Computer');
return $filter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment