Woocommerce cart is not clear after logout

Try this code by using global $woocommerce

add_action( 'wp_logout', 'force_clear_woocommerce_cart' );
function force_clear_woocommerce_cart() 
{

    error_log("Clearing cart");
    global $woocommerce;
    $woocommerce->cart->empty_cart();

}

hope this will help you

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)