• Hi man,

    Thank you very much for your plugin. It is great ??

    I’m a theme developer. My theme use your Contact Form 7 plugin and the latest version of WooCommerce plugin. When I enable Debug in wp-config.php. I get an error message after submitting the contact form. The spin icon won’t go away. Please see my screenshot https://postimg.org/image/fjxzpcsj5/. It called the maybe_set_cart_cookies() function in plugins/woocommerce/includes/class-wc-cart.php. Could you please take your time to check it?

    Thank you very much!

    https://www.ads-software.com/plugins/contact-form-7/

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Can I see the actual site?

    Thread Starter Stormit

    (@stormit)

    Hi man,

    I test on my localhost.
    Just set up a new wordpress site. You install WooCommerce plugin and your Contact Form 7 plugin. You enable Debug in wp-config.php and you will see error as shown in my screenshot https://postimg.org/image/fjxzpcsj5/

    Regards,

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    I tested the combination and confirmed it works with no error.

    Thread Starter Stormit

    (@stormit)

    Did you enable Debug in wp-config.php file?
    define(‘WP_DEBUG’, true);

    @takayukister

    I tested the combination and confirmed it works with no error.

    I can reproduce it, with only WooCommerce 2.4.6 and CF7 4.3 loaded.

    [21-Sep-2015 06:19:41 UTC] PHP Notice: get_cart was called incorrectly. Get cart should not be called before the wp_loaded action. Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /Users/jasonhendriks/Sites/wordpress/wp-includes/functions.php on line 3623

    Don’t know if it helps, but here’s a backtrace:

    [21-Sep-2015 06:23:02 UTC] /Users/jasonhendriks/Sites/wordpress/wp-includes/functions.php line 3618 function get_callstack()
    /Users/jasonhendriks/Sites/wordpress/wp-content/plugins/woocommerce/includes/class-wc-cart.php line 681 function _doing_it_wrong()
    /Users/jasonhendriks/Sites/wordpress/wp-content/plugins/woocommerce/includes/class-wc-cart.php line 354 function get_cart()
    /Users/jasonhendriks/Sites/wordpress/wp-content/plugins/woocommerce/includes/class-wc-cart.php line 259 function is_empty()
    /Users/jasonhendriks/Sites/wordpress/wp-content/plugins/woocommerce/includes/class-wc-cart.php line 684 function get_cart_from_session()
    /Users/jasonhendriks/Sites/wordpress/wp-content/plugins/woocommerce/includes/class-wc-cart.php line 354 function get_cart()
    /Users/jasonhendriks/Sites/wordpress/wp-content/plugins/woocommerce/includes/class-wc-cart.php line 173 function is_empty()
     line  function maybe_set_cart_cookies()
    /Users/jasonhendriks/Sites/wordpress/wp-includes/plugin.php line 503 function call_user_func_array()
    /Users/jasonhendriks/Sites/wordpress/wp-includes/load.php line 611 function do_action()
     line  function shutdown_action_hook()

    I tried to trace where the Ajax call comes in but I could not find it. Submitting the form with Javascript disabled does not produce the warning message. It’s only triggered by the Ajax call.

    I can reproduce it, with only WooCommerce 2.4.6 and CF7 4.3 loaded.

    Same thing for me here.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Hmm… Still can’t reproduce it. Maybe something is different on my environment.

    Anyway, can you test it with changing a line in Contact Form 7’s code?

    In contact-form-7/includes/controller.php line #3

    add_action( 'init', 'wpcf7_control_init', 11 );

    to

    add_action( 'wp_loaded', 'wpcf7_control_init' );

    Do you still see the error with this change?

    Maybe something is different on my environment.

    Or a WooCommerce setting.

    Do you still see the error with this change?

    The error no longer occurs with this change.

    FYI, the problem is triggered by the exit() call that is made by CF7 on the init hook. WooCommerce is probably not ready to be exited at this point hence the error. When I replace the contents with a simple return the error also goes away. Hooking on wp_load seem to be the right event at which to execute and die.

    add_action( 'init', 'wpcf7_control_init', 11 );
    
    function wpcf7_control_init() {
    	return;
    }

    Hello there,

    to be honest I do not understand the 90% of the topic discussed in this forum, therefore my question will look stupid but I don’t know anywhere else I could ask.

    Is it possible to create a form that somehow it is carrying some information tag, id of the page where is coming from ?

    Being more specific I need from a product page to compile a form that sends an email containing the reference of the product where the form has been compiled.

    Does it make sense ?

    Is it possibile and, if yes how ?

    Thanks for the attention,

    Roc

    @194roc – As per the Forum Welcome, please post your own topic.

    Posting in an existing topic and taking over the original posters question is generally considered inappropriate.

    Miguel

    (@teledirigido)

    I had the same problem and Takayuki Miyoshi’s
    comment solved my issue. Thanks!

    @buzztone
    sorry I do not realize I was writing on this topic.

    @teledirigido
    Where can I find this comment ? Clicking on the link it bring me to the comment on this post that buzztone rightly pointed out is related to something different.

    @194roc – teledirigido is contributing to the question asked by the OP (original poster). He is not answering your question. You probably find things simpler if you ignore further posts in this thread at this stage.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Thank you for testing. Maybe I’ll change the action hook to wp_loaded since it’s almost equivalent to init and seems to make no trouble with WooCommerce.

    +1 for changing the action hook to wp_loaded – this could also help to avoid conflicts with the many plugins that hook to init in a way that causes problems for other plugins.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Conflict with WooCommerce plugin’ is closed to new replies.