Issue #3164 fixed
This commit is contained in:
parent
bac17a08fb
commit
0de17f4711
|
|
@ -27,9 +27,14 @@ class Toolbar extends AbstractProduct
|
|||
*/
|
||||
public function getAvailableLimits()
|
||||
{
|
||||
return core()->getConfigData('catalog.products.storefront.products_per_page')
|
||||
? explode(',', core()->getConfigData('catalog.products.storefront.products_per_page'))
|
||||
: [9, 15, 21, 28];
|
||||
if (core()->getConfigData('catalog.products.storefront.products_per_page')) {
|
||||
$pages = explode(',', core()->getConfigData('catalog.products.storefront.products_per_page'));
|
||||
|
||||
var_dump($pages);
|
||||
return $pages;
|
||||
}
|
||||
|
||||
return [9, 15, 21, 28];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class ProductRepository extends Repository
|
|||
}
|
||||
}
|
||||
|
||||
if( $priceFilter = request('price') ){
|
||||
if ( $priceFilter = request('price') ){
|
||||
$priceRange = explode(',', $priceFilter);
|
||||
if( count($priceRange) > 0 ) {
|
||||
$qb->where('variants.min_price', '>=', core()->convertToBasePrice($priceRange[0]));
|
||||
|
|
@ -171,7 +171,7 @@ class ProductRepository extends Repository
|
|||
request()->except(['price'])
|
||||
));
|
||||
|
||||
if( count($attributeFilters) > 0 ) {
|
||||
if ( count($attributeFilters) > 0 ) {
|
||||
$qb->where(function ($filterQuery) use($attributeFilters){
|
||||
|
||||
foreach ($attributeFilters as $attribute) {
|
||||
|
|
@ -220,7 +220,7 @@ class ProductRepository extends Repository
|
|||
$countQuery = "select count(*) as aggregate from ({$repository->model->toSql()}) c";
|
||||
$count = collect(DB::select($countQuery, $repository->model->getBindings()))->pluck('aggregate')->first();
|
||||
|
||||
if($count > 0) {
|
||||
if ($count > 0) {
|
||||
# apply a new scope query to limit results to one page
|
||||
$repository->scopeQuery(function ($query) use ($page, $perPage) {
|
||||
return $query->forPage($page, $perPage);
|
||||
|
|
|
|||
|
|
@ -344,9 +344,10 @@ class Configurable extends AbstractType
|
|||
/**
|
||||
* Get product minimal price
|
||||
*
|
||||
* @param int $qty
|
||||
* @return float
|
||||
*/
|
||||
public function getMinimalPrice()
|
||||
public function getMinimalPrice($qty = null)
|
||||
{
|
||||
$minPrices = [];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue