Snippets

Visser Labs Link custom Product Types to WooCommerce Product Types when importing

Created by Michael Visser

File functions.php Added

  • Ignore whitespace
  • Hide word diff
+<?php
+function custom_woo_pd_is_valid_product_type( $output, $product_type ) {
+
+	if( $product_type == 'variabile' )
+		$output = 'variable';
+	if( $product_type == 'simpleproduct' )
+		$output = 'simple';
+
+	return $output;
+
+}
+add_filter( 'woo_pd_is_valid_product_type', 'custom_woo_pd_is_valid_product_type', 10, 2 );
+?>
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.