Skip to content

Commit

Permalink
fix: Old trouble code removed. (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
kidunot89 authored Sep 14, 2023
1 parent 628816f commit 5701fb1
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions includes/class-core-schema-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ public static function add_filters() {
'graphql_wp_connection_type_config',
[ '\WPGraphQL\WooCommerce\Connection\Products', 'set_connection_config' ]
);

add_filter(
'woographql_cart_connection_definitions',
[ self::class, 'skip_cart_item_connection' ]
);
}

/**
Expand Down Expand Up @@ -389,32 +384,4 @@ public static function inject_type_resolver( $type, $value ) {

return $type;
}

/**
* Return true if WooGraphQL Pro is handling cart item connections.
*
* @return boolean
*/
private static function should_skip_cart_item_connection() {
if ( ! class_exists( 'WPGraphQL\WooCommerce\Pro\WooGraphQL_Pro' ) ) {
return false;
}

return Pro\WooGraphQL_Pro::is_composite_products_enabled()
&& Pro\WooGraphQL_Pro::is_composite_products_active();
}

/**
* Skip core cart item connection definitions if WooGraphQL Pro is handling it.
*
* @param array $connections Cart connection defintions.
* @return array
*/
public static function skip_cart_item_connection( $connections ) {
if ( self::should_skip_cart_item_connection() ) {
unset( $connections['contents'] );
}

return $connections;
}
}

0 comments on commit 5701fb1

Please sign in to comment.