Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #19026


    I’m using Replete 1.0 on WordPress 3.5, WooCommerce 1.6.6 with extension Product Bundles 2.27.

    This error is shown in my PHP error log when trying to list products of type “product bundle” at the shop page:

    mod_fcgid: stderr: PHP Fatal error: Call to undefined method WC_Product::get_available_bundle_variations() in /home/x/public_html/wp-content/plugins/woocommerce-product-bundles/woocommerce-product-bundles.php on line 466

    HTML output breaks where a bundle should be listed, effectively breaking the web site. However, going directly to the product bundle page URL seems to work.

    Surprisingly enough, I read in another thread that there was no issues running the Product Bundles extension on Replete, but for me the above error log message appears only with Replete, not with the Twenty Twelve theme etc.

    Any ideas for a solution?



    I think following line in (Purchase code hidden if logged out) .php causes the error:

    add_action( 'add_to_cart_url', array($this, 'woo_bundles_add_to_cart_url'), 10 );

    Please try to delete it (or comment out the line) and check if the error message disappears…

    If yes I guess the problem is that the product bundles class isn’t called/initialized properly – following code line should load the product bundle plugin on the shop page:

    add_action( 'woocommerce_before_shop_loop_item', array($this, 'woo_bundles_init_bundled_product') );


    Thanks for your answer.

    In woocommerce-product-bundles.php I needed to comment out this line as well to get the listing to work:

    add_action( ‘add_to_cart_text’, array($this, ‘woo_bundles_add_to_cart_text’), 10 );

    New error message:

    mod_fcgid: stderr: PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /home/x/public_html/wp-includes/plugin.php on line 406

    I don’t know in which file I should put the second line you suggested and what it does. As of now, the button says “Add to cart” which doesn’t work, it should be “select alternatives” or similar.


    Another thing I should mention is that the product bundle I created has variable products in it, so it cannot be put into the cart right away. The buyer needs to do a selection first, just as with other variable products in WooCommerce.


    Ok I found the problem. Open up replete/config-woocommerce/config.php and replace following code:

    add_action( 'woocommerce_before_shop_loop_item', 'avia_add_cart_button', 6);
    function avia_add_cart_button()
    global $product;


    add_action( 'woocommerce_before_shop_loop_item', 'avia_add_cart_button', 6);
    function avia_add_cart_button()
    global $product;

    if ($product->product_type == 'bundle' ){
    $product = new WC_Product_Bundle($product->id);

    It seems like you need to “rewrite” the global product variable in order to use the product bundle extension.


    Seems to work just fine. Thanks for your excellent support!


    Glad Dude could help :)



Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘WooCommerce Product Bundles extension PHP Fatal Error’ is closed to new replies.