Custom variable product type doesn’t work
-
Hi I create a variable product using following code. It shows this new product type on the product type drop down menu but after select this and save the product, product type saving as a “Variable product”, not “Variable new product”.
How I can correct this one?
Thanks for help.
function register_variable_new_product_type() { class WC_Product_New_Variable extends WC_Product_Variable { public $product_type = 'new_variable'; public function __construct( $product ) { parent::__construct( $product ); } } } add_action( 'init', 'register_variable_new_product_type' ); function add_variable_new_product( $types ){ $types[ 'new_variable' ] = __( 'Variable new product' ); return $types; } add_filter( 'product_type_selector', 'add_variable_new_product' );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom variable product type doesn’t work’ is closed to new replies.