Skip to content

Commit

Permalink
Limit order search to last valid 30
Browse files Browse the repository at this point in the history
  • Loading branch information
prestaalba committed Mar 30, 2021
1 parent 46f168e commit a26cec6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ps_crossselling.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ protected function getOrderProducts(array $productIds = [])
FROM ' . _DB_PREFIX_ . 'orders o
LEFT JOIN ' . _DB_PREFIX_ . 'order_detail od ON (od.id_order = o.id_order)
WHERE o.valid = 1
AND od.product_id IN (' . implode(',', $productIds) . ')';
AND od.product_id IN (' . implode(',', $productIds) . ')
ORDER BY o.id_order DESC
LIMIT 30';

$orders = Db::getInstance((bool) _PS_USE_SQL_SLAVE_)->executeS($q_orders);

Expand Down

0 comments on commit a26cec6

Please sign in to comment.