Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter benji7

    (@benji7)

    That’s me again 😉

    When accessing directly:

    https://local.beautysofa24.de/wp-json/wc-analytics/reports/orders/stats

    it always returns:

    {"code":"woocommerce_rest_cannot_view","message":"Entschuldigung, es können keine Ressourcen aufgelistet werden.","data":{"status":401}}

    This happens even when logged in as administrator (user ID 1).

    I verified that the administrator role includes all the required WooCommerce capabilities:

    wp eval "print_r( get_role('administrator')->capabilities );"

    Output includes:

    'manage_woocommerce' => true
    'view_woocommerce_reports' => true
    'view_woocommerce_analytics' => true

    But checking the current user:

    wp eval "var_dump( current_user_can('view_woocommerce_reports') );"

    returns bool(false)

    So the role has the capability, but the user context in CLI and REST does not recognize it.

    wp wc tool list --user=1

    shows all analytics tools, including clear_woocommerce_analytics_cache,
    so WooCommerce Admin is properly registered.

    wp user meta get 1 wp_capabilities

    returns: array ('administrator' => true,) → so the user is indeed an administrator.

    What to do now?

    Thread Starter benji7

    (@benji7)

    Yes! You’re right! Thank you very much! 🙂

    There’s still one more issue to resolve. The WooCommerce Analytics dashboard now loads and opens correctly, but no statistics are being displayed. Each chart shows the error:

    “There was an error getting your stats.”

    You can see it in the attached screenshot:

    (The screenshot was taken with all plugins disabled — except WooCommerce and WooCommerce Analytics — and the active theme switched to twentytwentyfive.)

    Thread Starter benji7

    (@benji7)

    (/wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Foverview)

    The screenshot taken after disabling all plugins excluding WooCommerce and WooCommerce Analytics, also theme set to default twentytwentyfive.

    Before I updated WooCommerce to 10.2.2 also on my local development copy instance it’s not working – same as on production.

    • This reply was modified 7 months, 3 weeks ago by benji7.
    • This reply was modified 7 months, 3 weeks ago by benji7.
    Thread Starter benji7

    (@benji7)

    The checkbox has been checked already. It’s strange that it’s kinda blocked (the checkbox is gray, “block” cursor on checkbox hover and I can’t change the value).

    • ✅ Clear your browser cache and cookies, then log back in.
    • ✅ Ensure your user role has the manage_woocommerce capability (this is required to access Analytics).

    System Status Report:
    https://pastebin.com/6sL6NZJj

    WooCommerce > Status > Logs (no fatals):
    https://pastebin.com/vt4inypi

    • This reply was modified 7 months, 3 weeks ago by Yui.
    • This reply was modified 7 months, 3 weeks ago by benji7. Reason: Forgot about the blocked checkbox
Viewing 4 replies - 1 through 4 (of 4 total)