Plugin Directory

Changeset 3393651


Ignore:
Timestamp:
11/11/2025 12:36:47 PM (3 months ago)
Author:
kovalchik8
Message:

Fixed Woocommerce adapter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • magic-export-import/tags/1.1.6/includes/plugin-adapters/class-magic-ex-im-adapter-woocommerce.php

    r3393511 r3393651  
    9595            $post_types_to_exlude = array( 'product_variation', 'shop_order_refund' );
    9696
    97             // Exclude shop order if new storing feature within custom tables is enabled.
     97            // Exclude shop order if new storing feature within custom tables (HPOS) is enabled.
    9898            if ( wc_string_to_bool( get_option( self::CUSTOM_TABLES_FEATURE_KEY ) ) ) {
    9999                $post_types_to_exlude[] = 'shop_order';
     
    121121
    122122            case 'posts:product':
    123                 $mandatory_keys[] = 'product_type';
    124                 break;
     123                if ( magic_ex_im_is_export() ) {
     124                    $mandatory_keys[] = 'product_type';
     125                }
    125126        }
    126127
     
    527528        if ( 'posts:product' === magic_ex_im_get_magic() ) {
    528529
     530            $post_type_key = magic_ex_im_build_key( 'post_type', 'post' );
     531            $post_type     = $item_data[ $post_type_key ] ?? '';
     532
     533            if ( 'product_variation' === $post_type ) {
     534                return $errors;
     535            }
     536
    529537            $product_type_key = magic_ex_im_build_key( 'product_type', 'taxonomy' );
    530538            $product_type     = $item_data[ $product_type_key ] ?? '';
Note: See TracChangeset for help on using the changeset viewer.