If a product type does not exist, default to SIMPLE Closes #2360.

This commit is contained in:
Mike Jolley 2013-02-05 11:28:28 +00:00
parent 8742d83f72
commit 8f43d9cf8b
1 changed files with 3 additions and 4 deletions

View File

@ -54,10 +54,9 @@ class WC_Product_Factory {
// Filter classname so that the class can be overridden if extended.
$classname = apply_filters( 'woocommerce_product_class', $classname, $product_type, $post_type, $product_id );
if ( $classname && class_exists( $classname ) ) {
return new $classname( $the_product, $args );
}
if ( ! class_exists( $classname ) )
$classname = 'WC_Product_Simple';
return false;
return new $classname( $the_product, $args );
}
}