wp-e-commerce/WP-e-Commerce — pull request #446 by benhuson (2013-05-21 11:41:49+00:00)
Title: Make wpsc_the_product_thumbnail_id() filterable and include default fallback functionality

PR for issue #440

This ensures that the wpsc_the_product_thumbnail_id() is flexible enough for people who want to use it with variations.

If passed a variation ID, this function now tries to return the image assigned to that variation. The result of this function is filtered with 'wpsc_the_product_thumbnail_id'.

We then hook into this filter with wpsc_maybe_get_the_parent_product_thumbnail_id() to provide default behaviour to use parent product's image if variation has no image.

If a user wants to disable this behaviour (they may want to handle missing variation image differently instead of defaulting top parent) they can remove it with:

```
remove_filter( 'wpsc_the_product_thumbnail_id', 'wpsc_maybe_get_the_parent_product_thumbnail_id', 10, 2 );
```