woocommerce / storefront

Official theme for WooCommerce
https://wordpress.org/themes/storefront/
974 stars 470 forks source link

Calculate total sales during a particular time period #1987

Open Yatoom opened 2 years ago

Yatoom commented 2 years ago

Is your feature request related to a problem? Please describe.

Within the storefront-best-selling-products homepage section, the best-selling products are calculated over the total sales for each product. However, we would like to show the best-selling products over - for example - the last 6 months.

Describe the solution you'd like

I would like to set a startDate parameter that accepts a DateTime object. I can then calculate the datetime of 6 months ago and pass this value to the startDate. Storefront will then display the best-selling products based on the sales in those last 6 months.

Describe alternatives you've considered

There is a paid plugin, which allows you to decide whether to calculate best sellers based on total sales or total sales during a particular time period. https://woocommerce.com/document/best-sellers/

tomasztunik commented 2 years ago

Thanks for the feature idea @Yatoom. I can see myself using this as well, and we'll review if it is possible to implement it on the storefront level.

We are also working on updating how product listing works for WooCommerce Blocks and we'll be updating these blocks to use QueryLoop behind the scene. It should make it possible to give much more control over how and what we list in product grids/lists.