php - Wordpress / WooCommerce Custom Product type -
i have made custom product type woo commerce, problem getting work.
i've added filter product type , appears in dropdown box, when click , has no boxes other sku .
is there location file has go im missing? have lobbed other product type files.
thanks may give
first of need create class custom product type. let customproduct
class wc_product_customproduct extends wc_product{ public function __construct( $product ) { $this->product_type = 'customproduct'; parent::__construct( $product ); } }
and put class under includes/
folder. after that, need activate product type;
add_filter( 'product_type_selector', 'add_custom_product_type' ); function add_custom_product_type( $types ){ $types[ 'customproduct' ] = __( 'custom product' ); return $types; }
add functions.php
Comments
Post a Comment