Viewing 8 replies - 1 through 8 (of 8 total)
  • AJ a11n

    (@amandasjackson)

    Hi there,

    I am not sure that I completely understand your question here. Can you please clarify a little further exactly what you are looking to achieve regarding your monthly revenue and what you are referring to when you say, “store it in a variable”?

    Thanks

    Thread Starter Saleem Summour

    (@sal4sup)

    i need to print this variable in fronted for example
    i want to print the revenue for each month in frontend

    AJ a11n

    (@amandasjackson)

    Hi there,

    The built-in WooCommerce Reports have an Export CSV link that you can use to download your data for further analysis in a spreadsheet.

    You can see this by going to WooCommerce> Reports> Orders> Sales by Date> This month and then export the CSV to print.

    Best,

    Thread Starter Saleem Summour

    (@sal4sup)

    Thank you Amanda
    But i need to display the “total of revenue” as a number in frontend not in the dashboard
    i need a codex help to get total revenue for each month

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi there,

    It’ll definitely take some custom work, but perhaps take a look at how reports are built in WooCommerce core. I bet a lot of the same functions could be re-used to get the data you need.

    From there outputting it on the front end depends on if you’re wanting to graph the data, etc… There are lots of libraries for that, but again it likely takes a lot of elbow grease to make happen. 🙂

    Thread Starter Saleem Summour

    (@sal4sup)

    Thank you Ryarnr14
    i just need to display the total revenue as a number
    add a month and year to the function and return the total number of renenue

    Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    Hey @sal4sup – perhaps you can use something like this as a starting point:
    https://gist.github.com/tommyshellberg/b30b65c30a9f2c409ec0feddf85dca17

    It’s super rudimentary but it takes the last 30 days of sales data and displays it wherever the [display_monthly_sales] shortcode is used.

    AJ a11n

    (@amandasjackson)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to get revenue for each month’ is closed to new replies.