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

Okay
  Public Ticket #2366089
Products with 0 prices
Closed

Comments

  • Krisztian started the conversation

    Hi guys,

    Our problem is that the WC method wc_get_order() returns not only our bundles (with a unique price), but all the products with zero prices.

    We have tried all settings I think to remove them, they are not present on the checkout page, but they are returned to our Payment Gateway, which cannot handle products with 0 price.

    Is there a way to force the plugin to only add the bundle? Or do we have to remove these products from functions.php? Any tips on where / how to do it best?


    Thanks, awesome plugin btw!

  •  767
    Janilyn replied

    Hi Krisztian,

    Thank you for contacting WPClever Support Forum. 

    We’ve received your ticket and assigned one of our developers to help you with that. 

    He’ll be looking into your question and responding with specific instructions as soon as possible. Please stay in touch as he might need discuss further with you. 

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,228
    Dustin replied

    Hi Krisztian,

    Please add below function to current theme (or child-theme) / functions.php

    add_filter( 'woocommerce_order_get_items', 'woosb_exclude_bundled_from_order', 10, 1 );
    function woosb_exclude_bundled_from_order( $items ) {
        foreach ( $items as $key => $item ) {
            if ( $item->meta_exists( '_woosb_parent_id' ) ) {
                unset( $items[ $key ] );
            }
        }
        return $items;
    }

    Let me know if it works or not.

    Best regards,
    Dustin

  • Krisztian replied

    Hey Frankie,


    Works like a charm, thanks. U guys are awesome. Did not know about the get items hook, and it's pretty cool you put that meta on the bundled items!

    Kudos,

    Krisz

  •  1,228
    Dustin replied

    You're welcome!smile.png

    If you are satisfied with our plugin and support, please reward it with a full five-star ★★★★★ rating. https://wordpress.org/support/plugin/woo-product-bundle/reviews?rate=5#new-post
    Thank you in advance! <3

    Best regards,
    Dustin