Merge pull request #4617 from nikolayandreev/master

Fix getMaximamPrice returning Special price, and add capability to filter products via ?category_id=1,2,3 instead of ?category_id=1 while using getAll()
This commit is contained in:
Glenn Hermans 2021-02-23 15:01:52 +01:00 committed by GitHub
commit 0f6d3d3253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 4 deletions

View File

@ -129,7 +129,7 @@ class ProductRepository extends Repository
}
/**
* @param int $categoryId
* @param string $categoryId
*
* @return \Illuminate\Support\Collection
*/
@ -162,7 +162,7 @@ class ProductRepository extends Repository
->whereNotNull('product_flat.url_key');
if ($categoryId) {
$qb->where('product_categories.category_id', $categoryId);
$qb->whereIn('product_categories.category_id', explode(',', $categoryId));
}
if (! core()->getConfigData('catalog.products.homepage.out_of_stock_items')) {

View File

@ -288,4 +288,14 @@ class Downloadable extends AbstractType
return $result;
}
/**
* Get product maximam price
*
* @return float
*/
public function getMaximamPrice()
{
return $this->product->price;
}
}

View File

@ -63,4 +63,14 @@ class Simple extends AbstractType
return $qty <= $this->totalQuantity() ? true : $backorders;
}
}
/**
* Get product maximam price
*
* @return float
*/
public function getMaximamPrice()
{
return $this->product->price;
}
}

View File

@ -71,4 +71,14 @@ class Virtual extends AbstractType
{
return $qty <= $this->totalQuantity() ? true : false;
}
}
/**
* Get product maximam price
*
* @return float
*/
public function getMaximamPrice()
{
return $this->product->price;
}
}