Support » Plugin: Post Type Switcher » WooCommerce Variable Products are loosing their connections

  • I would like to suggest a workaround for a problem we encountered using WooCommerce Multilingual with post type switcher.

    The problem is that the variations are getting disconnected from the original product only when post type switcher is enabled.

    We debugged the problem and it can be fixed by adding a more strict check to your plugin:

    --- post-type-switcher.php.orig	2017-01-04 23:34:14.000000000 +0100
    +++ post-type-switcher.php	2017-01-04 23:53:02.000000000 +0100
    @@ -371,7 +371,9 @@
     		// Update post type
    -		$data['post_type'] = $post_type;
    +		if ( $_REQUEST['post_ID'] === $postarr['ID'] ) {
    +			$data['post_type'] = $post_type;
    +		}
     		// Return modified post data
     		return $data;

    With this, the variations retain their post_type and everything works.
    Would you incorporate this fix to a future release?

    This issue was originally reported in

  • The topic ‘WooCommerce Variable Products are loosing their connections’ is closed to new replies.