\ProductGroup

Product Group is a 'holder' for Products within the CMS It contains functions for versioning child products

The way the products are selected:

Controller calls:
ProductGroup::ProductsShowable($extraFilter = "")

ProductsShowable runs currentInitialProducts. This selects ALL the applicable products
but it does NOT PAGINATE (limit) or SORT them.
After that, it calls currentFinalProducts, this sorts the products and notes the total
count of products (removing ones that can not be shown for one reason or another)

Pagination is done in the controller.

For each product page, there is a default:
- filter
- sort
- number of levels to show (e.g. children, grand-children, etc...)
and these settings can be changed in the CMS, depending on what the
developer makes available to the content editor.

In extending the ProductGroup class, it is recommended
that you override the following methods (as required ONLY!):
- getBuyableClassName
- getGroupFilter
- getStandardFilter
- getGroupJoin
- currentSortSQL
- limitCurrentFinalProducts
- removeExcludedProductsAndSaveIncludedProducts

To filter products, you have three options:

(1) getGroupFilter
- the standard product groups from which the products are selected
- if you extend Product Group this is the one you most likely want to change
- for example, rather than children, you set it to "yellow" products
- goes hand in hand with changes to showProductLevels / LevelOfProductsToShow
- works out the group filter based on the LevelOfProductsToShow value
- it also considers the other group many-many relationship
- this filter ALWAYS returns something: 1 = 1 if nothing else.

(2) getStandardFilter
- these are the standard (user selectable) filters
- available options set via config
- the standard filter is updated by controller
- options can show above / below product lists to let user select alternative filter.

(3) the extraWhere in ProductsShowable
- provided by the controller for specific ('on the fly') sub-sets
- this is for example for search results
- set in ProductShowable($extraWhere)


Caching
==================

There are two type of caching available:

(1) caching of Product SQL queries
- turned on and off by variable: ProductGroup->allowCaching
- this is not a static so that you can create different settings for ProductGroup extensions.
(2) caching of product lists
- see Product_Controller::ProductGroupListAreCacheable

You can also ajaxify the product list, although this has nothing to do with
caching, it is related to it.