Conflict with WPBakery Page Builder and blockUI - Defaults not defined woo-commerce checkout and cart pages

1.6k Views Asked by At

I am having an issue where the checkout in woo-commerce is not working because of $.blockUI.defaults not being defined, if I disable WPBakery it works but other aspects of the site do not work of course.

It also errors on blockUI in the cart when trying to update it.

Any help would be amazing!

I have disabled all plugins and had no there conflicts except WPBakery Page Builder.

Thought it was the older version of jQuery so have updated to latest.

Unfortunately can't find anything about this issue.

A product can be added to cart here:

https://www.actionart.com.au/product/portrait-poster-in-hearts-text-overlay/

https://www.actionart.com.au/checkout/

Full error message

checkout.min.js?ver=3.5.3:12 Uncaught TypeError: Cannot read property 'defaults' of undefined at HTMLDocument. (checkout.min.js?ver=3.5.3:12) at fire (jquery-1.12.4.js:3232) at Object.fireWith [as resolveWith] (jquery-1.12.4.js:3362) at Function.ready (jquery-1.12.4.js:3582) at HTMLDocument.completed (jquery-1.12.4.js:3617)

1

There are 1 best solutions below

0
janeojy On

Faced with the same issue, I have created an MU plugin to deactivate plugins based on current page URL, by following the steps here.

First, create a PHP file (e.g. plugin-filter-by-page.php) in the MU plugin folder (/wp-content/mu-plugins).

In this file, paste the following code which was modified from the link provided above:

<?php
// returns the path of the request URI without the query string
$request_uri = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );

$is_admin = strpos( $request_uri, '/wp-admin/' );

// add filter in front pages only
if( false === $is_admin ){
    add_filter( 'option_active_plugins', 'your_option_active_plugins' );
}

/**
 * Filters active plugins
 *
 * @param array   $plugins An array of active plugins.
 */
function your_option_active_plugins( $plugins ){
    global $request_uri;
    $is_woo_checkout_page = strpos( $request_uri, '/checkout/' );

    $unnecessary_plugins = array();

    // filter out WPBakery Page Builder plugin on WooCommerce Checkout page
    if( false !== $is_woo_checkout_page ){
        $unnecessary_plugins[] = 'js_composer/js_composer.php';
    }

    foreach ( $unnecessary_plugins as $plugin ) {
        $k = array_search( $plugin, $plugins );
        if( false !== $k ){
            unset( $plugins[$k] );
        }
    }

    return $plugins;
}

At the point of writing, I am using this on my own website which is using WordPress 5.0.3, WooCommerce 3.5.3 and WPBakery Page Builder 5.6 from the Bridge theme.

Alternatively, you can use plugins created by others via the same link.