SQL templates/PrestaShop

Monthly revenue in PrestaShop

Total valid PrestaShop order revenue grouped by month for trend analysis.

PrestaShop · PostgreSQL
SELECT to_char(o.date_add, 'YYYY-MM') AS month,
       COUNT(*) AS orders,
       ROUND(SUM(o.total_paid_tax_incl), 2) AS revenue
FROM ps_orders o
WHERE o.valid = 1
GROUP BY month
ORDER BY month DESC
LIMIT 24;

How it works

Buckets paid orders by month using date_add and sums the tax-included total. Excludes carts that never became valid orders.

Run this on your own database

BeQuery mirrors your PrestaShop MySQL database to an isolated PostgreSQL copy, so you can run queries like this one without ever touching production.

Start free No credit card