• Resolved ozanyilmaz2017

    (@ozanyilmaz2017)


    After updating woocommerce, “add_to_cart” inside “class-wc-cart.php” now returning false for my plugin.

    Can you tell me a way to debug this? I am originally a .NET developer, and I am novice on debugging the php. I changed WP_DEBUG to true, but it is not returning any errors or creating an error_log file. So how can I debug this function step by step and find the line which causes this function to return false?

Viewing 1 replies (of 1 total)
  • Insert temporary lines to write to the error log at key points in the function to ensure each line is doing what you think it should.

    // arrays and objects
    error_log( print_r( $log, true ) );
    // simple variables
    error_log( $log );
Viewing 1 replies (of 1 total)
  • The topic ‘How To Debug A Woocommerce Function?’ is closed to new replies.