Merge pull request #1358 from foxrunsoftware/master

Fix Downloadable Product Variation Linking in WC 1.6.2
This commit is contained in:
Mike Jolley 2012-08-10 04:16:36 -07:00
commit c92742284a
1 changed files with 15 additions and 0 deletions

View File

@ -310,6 +310,21 @@ class WC_Product_Variation extends WC_Product {
}
return (int) $this->variation_shipping_class_id;
}
/**
* Check if downloadable product has a file attached.
*
* @return bool Whether downloadable product has a file attached.
*/
function has_file() {
if ( ! $this->is_downloadable() )
return false;
if ( apply_filters( 'woocommerce_file_download_path', get_post_meta( $this->variation_id, '_file_path', true ), $this->variation_id ) )
return true;
return false;
}
}