Support » Plugin: Bread Finance » Fatal error on WC > Subscriptions page

  • Resolved MisterR

    (@mister_r)


    Active plugins:
    Bread Finance 1.0.9
    WooCommerce 4.5.2
    WooCommerce Subscriptions 3.0.5

    When you try to open the WC > Subscriptions page, you see only the upper filters, the list of subscriptions is absent. In source code the output ends at

    Fatal error: Uncaught Error: Call to a member function get_cart() on null in /public_html/wp-content/plugins/bread-finance/classes/WCGatewayBreadFinance.php:649

    At this line the following block starts:

    $items = WC()->cart->get_cart();
    foreach ( $items as $item ) {
    	$product_id = $item["product_id"];
    	$products_to_exclude = explode( ",", $this->get_products_to_exclude() );
    	if ( in_array ( $product_id, $products_to_exclude ) ) {
    		return;
    	}
    }

    If you wrap it with if (is_object(WC()->cart)) {}, you can normally see the list of subscriptions.

    This issue is the same (or very similar) as this one (which seems you haven’t fixed):
    https://wordpress.org/support/topic/bug-in-combination-with-polylang-for-woocommerce

    Please correct your mistake in the next release. Thank you!

Viewing 1 replies (of 1 total)
  • Thread Starter MisterR

    (@mister_r)

    It has been fixed in the most recent version.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.