Fix calculation logic for max addons count by replacing division with multiplication in SQL query

This commit is contained in:
Jeppe Bundgaard
2026-01-21 14:46:55 +01:00
parent 56d0ee03d3
commit d9b9958242
@@ -272,7 +272,7 @@ class product_options_o extends db
// Build the query
$query = "
SELECT SUM(oi.quantity / oi.quantity ) AS max_addons_count
SELECT SUM(oi.quantity * 1 ) AS max_addons_count
FROM order_items oi
INNER JOIN orders o ON oi.order_id = o.id
INNER JOIN products_options po ON oi.product_id = po.product_id