Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #2225211
Check if the product is a bundle
Closed

Comments

  • rrd started the conversation

    When I have a bundle in my cart my credit card payment plugin adds the bundle itself and on the top of them all the products in the bundle to pay, so at the payment gateway the amount is doubled.

    So I would need a way to filter out the bundle members form 

    $order->get_items()

  •  767
    Janilyn replied

    Hi, 

    We’ve received your ticket and assigned one of our developers to help you with that. He’ll be looking into your issue and responding as soon as finding a solution. Please stay in touch as he might need you to provide further information.

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,226
    Dustin replied

    Hi,

    You can try to add below PHP code to the current theme (or child-theme) / functions.php

    add_filter( 'woocommerce_order_get_items', 'woosb_exclude_bundles_from_order', 10, 1 );
    function woosb_exclude_bundles_from_order( $items ) {
        foreach ( $items as $key => $item ) {
            if ( method_exists( $item, 'get_product' ) ) {
                $item_product = $item->get_product();
                if ( $item_product->is_type( 'woosb' ) ) {
                    unset( $items[ $key ] );
                }
            }
        }
        return $items;
    }


    Best regards,
    Dustin