I have extended the product type to create a custom product class. However, even after extending the 'simple product' the inventory function isn't included. How would I add this to my custom product type?
// add a product type
add_filter( 'product_type_selector', 'wdm_add_custom_product_type' );
function wdm_add_custom_product_type( $types ){
$types[ 'opd_custom_product' ] = __( 'Classes' );
return $types;
}
add_action( 'plugins_loaded', 'opd_create_custom_product_type' );
function wdm_create_custom_product_type(){
// declare the product class
class WC_Product_Wdm extends WC_Product_Simple{
public function __construct( $product ) {
$this->product_type = 'opd_custom_product';
parent::__construct( $product );
// add additional functions here
}
}
}
Aucun commentaire:
Enregistrer un commentaire