• Hi all,

    We’re running a Woocommerce shop with a related products section on all product detail pages. We wanted to ensure different product were shown every time a user clicks different product variations, so we utilized this code:

    add_action( 'woocommerce_init', function(){
        if(!is_user_logged_in() && !is_admin()) {
    	    if ( ! WC()->session->has_session() ) {
    		    WC()->session->set_customer_session_cookie( TRUE );
    	    }
        }
    } );

    as part of a wider set of code to exclude repeat variations from showing up again in the related section.
    Unfortunately, this code was causing the infamous ‘eternal spinning circle of doom’ on our CF7 form.

    Once removed from functions.php, the form submitted correctly again.
    However we need the code to ensure the related products section works correctly.

    Does anyone have any suggestions for what we can do with our CF7 form to avoid this conflict?

    Rich

Viewing 2 replies - 1 through 2 (of 2 total)
  • hi @azzurridesigns

    tested but that action seems to have no influence on cf7.

    looks like that wider set of code breaks js execution so the mail can’t be sent. Check on your browser console for error messages, and please post here the script code and the console errors.

    I also have problems with sessions and cf7 : in the ajax call for sending a message, my WC variables looks empty, woocommerce->cart is empty like if the ajax call was in a different session, while woocommerce variable is initialized with version, and basic attributes.

    This result in an error 500 if I try to access method on undefined object.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Woocommerce Custom session cookie php snippet causing cf7 form failure!’ is closed to new replies.