Support » Theme: OceanWP » Add to cart doesn’t work when variable product

  • Hello,

    On my website it’s not possible to add to cart a product when you choose the color of the product. When there is no variation, there is no problem to add a product to cart.
    I’m not sure how long I get this error because I don’t often use this website.

    I enable true the WP-debug and this is the error message :

    [23-Aug-2021 09:13:06 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get_permalink() on bool in /home/***/www/wp-content/plugins/woocommerce/includes/class-wc-cart.php:1134
    Stack trace:
    #0 /home/***/www/wp-content/themes/oceanwp/inc/woocommerce/woocommerce-config.php(799): WC_Cart->add_to_cart(0, '1', 734, Array)
    #1 /home/***/www/wp-includes/class-wp-hook.php(303): OceanWP_WooCommerce_Config->add_cart_single_product_ajax('')
    #2 /home/***/www/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array)
    #3 /home/***/www/wp-includes/plugin.php(470): WP_Hook->do_action(Array)
    #4 /home/***/www/wp-admin/admin-ajax.php(187): do_action('wp_ajax_oceanwp...')
    #5 {main}
      thrown in /home/***/www/wp-content/plugins/woocommerce/includes/class-wc-cart.php on line 1134

    On the chrome console, I have error 500 :
    jquery.min.js?ver=3.6.0:2 POST /wp-admin/admin-ajax.php 500

    In the “Form data” there is no product_id, I don’t know if this is correct :

    action: oceanwp_add_cart_single_product
    product_id: 
    variation_id: 734
    variation[attribute_pa_modele-noeud]: jaguar-noir
    quantity: 1

    I tried to change the theme by “Twenty Twenty-One” and it’s working fine.

    All my plugins are up to date and wordpress version is 5.8.
    The only plugin I can’t update is “Ocean Elementor Widgets” because I have no more licence for OceanWP.

    Thanks for your help.

    • This topic was modified 2 years, 7 months ago by busterland.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Add to cart doesn’t work when variable product’ is closed to new replies.