cart->get_cart() ); } if ( ! empty( $input['keys'] ) && ! isset( $items ) ) { $items = array(); foreach ( $input['keys'] as $key ) { $item = \WC()->cart->get_cart_item( $key ); if ( empty( $item ) ) { /* translators: Cart item not found message */ throw new UserError( sprintf( __( 'No cart item found with the key: %s', 'wp-graphql-woocommerce' ), $key ) ); } $items[] = $item; } } return apply_filters( 'retrieve_cart_items', $items, $input, $context, $info, $mutation ); } /** * Return array of data to be when defining a cart fee. * * @param array $input input data describing cart item. * @param AppContext $context AppContext instance. * @param ResolveInfo $info query info. * * @return array */ public static function prepare_cart_fee( $input, $context, $info ) { $cart_item_args = array( $input['name'], $input['amount'], ! empty( $input['taxable'] ) ? $input['taxable'] : false, ! empty( $input['taxClass'] ) ? $input['taxClass'] : '', ); return apply_filters( 'woocommerce_new_cart_fee_data', $cart_item_args, $input, $context, $info ); } }