woothemes/woocommerce — pull request #2539 by thenbrent (2013-02-27 08:02:55+00:00)
Title: Allow extensions to run core WC add-to-cart handlers

Rather than determining how to handle a product being added to the cart based on its type, create a handler flag which extensions can set in order to run core WC handlers for different product types.

For example, with this patch, a `'variable_subscription'` product could choose to run the WC core `'variable'` add-to-cart routine, and avoid having to duplicate that code, using a function like this:

```php
function eg_add_to_cart_handler( $handler, $product ) {

if ( 'variable_subscription' === $handler )
$handler = 'variable';

return $handler;
}
add_filter( 'woocommerce_add_to_cart_handler', 'eg_add_to_cart_handler', 10, 2 );

```