woothemes/woocommerce — pull request #1135 by franticpsyx (2012-06-09 15:50:09+00:00)
Title: A few filters needed by the 'Product Bundles' extension.

Following Mike's advice, I am sending a few lines of additions useful to theme & extension developers in general (tr formatting commit), myself included.

The filtering of the get_product_subtotal output is used by the 'Product Bundles' extension to "hide" the 0$ subtotals of bundled items (when the bundle price is fixed), or the 0$ subtotal of the "bundle" itself (when doing per-product pricing).

The reason a "bundle" entry gets added to the cart apart from all bundled items is multi-fold:

1) It controls all quantities of the bundled items in the cart, just like "forced sells".

2) Is has "real" shipping properties, which are used when doing "bundle shipping". In this case, all bundled items are marked as virtual and do not contribute to any shipping cost.

3) It has its own price, when selling a bundle at a fixed price, regardless of its contents. In this case, all bundled items' prices are set to zero (that's the zeroes I'm hiding, since they are irrelevant - and the opposite, in the case of per-product pricing).

4) It is used to group the bundled items under a single logical "umbrella" in the above template files.

Since these items are grouped together in all template tables (bundle + bundled items below), it is a good idea to allow changing the style of these "item groups" by looking at the class attribute of each item.

For example, bundled items could get a smaller font, or have no tr borders. That's up to theme developers to decide.