Add prices and filtering by sale_channel with default
This commit is contained in:
@@ -6,15 +6,24 @@ use App\Models\Shop\Offer;
|
||||
|
||||
class Offers
|
||||
{
|
||||
|
||||
public static function getOffersByArticles($articles_ids)
|
||||
public static function getOffersByArticles($articles_ids, $sale_channel_id = false)
|
||||
{
|
||||
return Offer::active()->with(['article_nature', 'variation', 'tariff.price_lists.price_list_values'])->byArticles($articles_ids)->get();
|
||||
$sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID();
|
||||
return Offer::active()
|
||||
->with(['article_nature', 'variation', 'tariff.price_lists.price_list_values'])
|
||||
->byArticles($articles_ids)
|
||||
->bySaleChannel($sale_channel_id)
|
||||
->get();
|
||||
}
|
||||
|
||||
public static function getOffersByArticle($article_id)
|
||||
public static function getOffersByArticle($article_id, $sale_channel_id = false)
|
||||
{
|
||||
return Offer::active()->with(['article_nature', 'variation', 'tariff.price_lists.price_list_values'])->byArticle($article_id)->get();
|
||||
$sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID();
|
||||
return Offer::active()
|
||||
->with(['article_nature', 'variation', 'tariff.price_lists.price_list_values'])
|
||||
->byArticle($article_id)
|
||||
->bySaleChannel($sale_channel_id)
|
||||
->get();
|
||||
}
|
||||
|
||||
public static function getThumbSrcById($id)
|
||||
|
||||
Reference in New Issue
Block a user