If a product type does not exist, default to SIMPLE Closes #2360.
This commit is contained in:
parent
8742d83f72
commit
8f43d9cf8b
|
@ -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 );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue