AJAX add to cart - theme not compatible with WC addons

Hi - I have a problem with BeTheme 25.1.7, Woocommerce 6.0 and Woocommerce Bookings 1.15.49.

We did an investigation with WC development Team and this is what we've got:

"This is most likely caused by a feature in your theme attempting to add the item to the cart via an AJAX action. The problem with the AJAX add to cart feature from the themes is that they are not coded to accept additional data that is on the product page, such as additional form fields provided for by product addons. I can see that you are using BeTheme, which as of version 25.x causes this incompatibility issue."

This is the error 500 content:

[29-Dec-2021 22:12:35 UTC] PHP Fatal error: Uncaught Error: Call to a member function is_type() on bool in /home/btycsfh/wp-content/plugins/woocommerce-bookings/includes/wc-bookings-functions.php:57

Stack trace:

#0 /home/btycsfh/wp-content/plugins/woocommerce-bookings/includes/class-wc-booking-cart-manager.php(77): is_wc_booking_product(false)

#1 /home/btycsfh/wp-includes/class-wp-hook.php(303): WC_Booking_Cart_Manager->validate_add_cart_item(true, 0, 1)

#2 /home/btycsfh/wp-includes/plugin.php(189): WP_Hook->apply_filters(true, Array)

#3 /home/btycsfh/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(406): apply_filters('woocommerce_add...', true, 0, 1)

#4 /home/btycsfh/wp-includes/class-wp-hook.php(303): WC_AJAX::add_to_cart('')

#5 /home/btycsfh/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array)

#6 /home/btycsfh/wp-includes/plugin.php(470): WP_Hook->do_action(Array)

#7 /home/btycsfh/wp-admin/admin-ajax.php(187): do_action('wp_ajax_woocomm...')

# in /home/btycsfh/wp-content/plugins/woocommerce-bookings/includes/wc-bookings-functions.php on line 57

Error is not present when

WooCommerce > Settings > Products and uncheck Enable AJAX add to cart buttons on archives

feature is disabled.


Could you please investigate this issue? Thanks.

Comments

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.