woothemes/woocommerce — pull request #1358 by justinstern (2012-08-09 22:48:47+00:00)
Title: Fix Downloadable Product Variation Linking in WC 1.6.2

Fix the downloadable product variation linking, which seems to have been broken in WC 1.6.2 due to the introduction of the has_file() method at the WC_Product class, with an implementation that does not function properly for the child WC_Product_Variation class.

Tried creating a downloadable product variation in a fresh install with WC 1.6.2, the Download File link on the email order items and order details templates failed to display, because get_file() defined at WC_Product checks for a _file_path using the parent product id. My fix is to override the get_file() method in the WC_Product_Variation class with a check using variation_id instead.