woothemes/woocommerce — pull request #6432 by franticpsyx (2014-09-30 10:34:16+00:00)
Title: [2.2] Introduce 'woocommerce_get_children' filter

The filter can be used to skip loading certain variations already from the stage of fetching their ids.

This is particularly useful for optimizing the performance of variable products with many variations when some of them need to be excluded. As an example, ```WC_Product_Variable::get_available_variations``` by default loads all children, which is particularly costly performance-wise if only a subset of the children must be active.

In many cases of reported slow performance with variations-heavy code (such as Bundles with many variable product instances), xdebug reveals that one of the culprits is the sheer amount of ```get_child``` calls, which can and should be avoided when calling ```WC_Product_Variable::get_available_variations```.

In these cases, caching cannot be used reliably to store this data - for example, extensions that implement conditional pricing rules will need to modify pricing info on the fly, which means that caching the output of ```WC_Product_Variable::get_available_variations``` to improve performance is not an option.