discounted configurables

This commit is contained in:
merdan 2022-04-21 16:08:10 +05:00
parent 15e5c76f6a
commit 40ba2c8e77
1 changed files with 3 additions and 1 deletions

View File

@ -426,7 +426,6 @@ class ProductRepository extends WProductRepository
});
# apply scope query so we can fetch the raw sql and perform a count
$repository->applyScope();
# sort direction
$orderDirection = 'asc';
if (isset($params['order']) && in_array($params['order'], ['desc', 'asc'])) {
@ -446,6 +445,9 @@ class ProductRepository extends WProductRepository
}
}
$repository->applyScope();
$countQuery = "select count(*) as aggregate from ({$repository->model->toSql()}) c";
$count = collect(DB::select($countQuery, $repository->model->getBindings()))->pluck('aggregate')->first();