diff --git a/src/sCommerce.php b/src/sCommerce.php index c58e3dc..57b4012 100644 --- a/src/sCommerce.php +++ b/src/sCommerce.php @@ -187,6 +187,8 @@ public function getProducts(array|QueryBuilder $productIds, ?string $lang = null ->where('s_product_category.category', $this->getCategoryId()) ->orWhere('s_product_category.scope', 'primary'); }) + // Prefer the row of the current category (manual order from admin) over the primary one + ->orderByRaw('(' . DB::getTablePrefix() . 's_product_category.category = ' . (int)$this->getCategoryId() . ') desc') ->limit(1) ]) ->whereIn('id', $productIds)