Woocommerce Custom session cookie php snippet causing cf7 form failure!
-
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
- The topic ‘Woocommerce Custom session cookie php snippet causing cf7 form failure!’ is closed to new replies.