• Resolved yashranka

    (@yashranka)


    Hi, I am developing a plugin to add a subscription reports tab to the analytics menu, however i am unable to figure out the parent slug for the add_submenu_page() function.
    The below mentioned link does not work which I get while on the Analytics page.

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

    I was able to add the sub menu to the woocommerce menu using ‘woocommerce’ as the slug and to the products page using ‘edit.php?post_type=product’ as the slug however I am unable to figure out a way to add a sub menu to the Analytics Menu.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers!

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Cheers!

    I’m able to get the sub menu to appear under the Analytics heading by changing the %2F to fwd slashes. However I cannot get my admin page to render, it goes to a 404:

    add_submenu_page( ‘wc-admin&path=/analytics/overview’, ‘Report Download’, ‘Report Download’, ‘manage_options’, ‘cd-wc-report-download’, ‘function_name’);

    Hope that helps

    • This reply was modified 3 years, 6 months ago by Sam Pryor.

    OK I got it, this will work: add ‘woocommerce’ as the parent, then put ‘path=/analytics/your_page_slug‘ as the slug
    Eg:
    add_submenu_page( ‘woocommerce’, ‘Report Download’, ‘Report Download’, ‘manage_options’, ‘path=/analytics/cd-wc-report-download’, ‘function_name’);

    Apologies, I was wrong. This doesn’t work.

    • This reply was modified 3 years, 6 months ago by Sam Pryor.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How can i add a sub menu to the Analytics tab’ is closed to new replies.