• Resolved drewilson23

    (@drewilson23)


    Hi,

    Since updating to Order Splitter for WooCommerce 1.5.0, the “Split order” button is now disabled on every order. Inspecting the button, it has disabled=”disabled” with an accessibility description reading:

    “The source order contains private line-item metadata that has not been classified by a compatibility adapter.”

    The specific meta keys on our line items are:

    • _wwp_wholesale_priced
    • _wwp_wholesale_role

    Could that be the reason splitting is disabled? If so, how can we fix it?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Jacob

    (@jacobb26)

    Hi,

    Yes, those two meta keys are the reason the Split order button is being disabled.

    Since version 1.5.0, Order Splitter treats private line-item metadata (keys beginning with _) as unclassified unless its behavior is explicitly declared. This is a safety measure to prevent third-party metadata from being copied or ignored incorrectly during a split.

    For WooCommerce Wholesale Prices, these two keys should be treated as business metadata:

    add_filter(
        'wcos_order_item_meta_classification',
        static function ( $classification, $key ) {
            $business_keys = array(
                '_wwp_wholesale_priced',
                '_wwp_wholesale_role',
            );
    
            if ( in_array( (string) $key, $business_keys, true ) ) {
                return 'business';
            }
    
            return $classification;
        },
        10,
        2
    );
    

    You can add this using a small custom plugin, a mu-plugin, or a snippets plugin. After adding it, the Split order button should become available again for those orders.

    Best regards,

    Thread Starter drewilson23

    (@drewilson23)

    It worked for some orders. I also had to add
    ‘_wccs_main_price’, ‘_wccs_main_display_price’, ‘_wccs_before_discounted_price’, ‘_wccs_discounted_price’, ‘_wccs_prices’, ‘_wccs_prices_main’, ‘_wccs_main_sale_price’, ‘_wccs_applied_rules’ since we also use Woo Pricing & Discounts / AsanaPlugins.

    Thanks for the help!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.