Fixes on articles by sale_channel
This commit is contained in:
@@ -75,7 +75,7 @@ class Articles
|
||||
return Article::orderBy('name', 'asc')->get();
|
||||
}
|
||||
|
||||
public static function getArticleToSell($id)
|
||||
public static function getArticleToSell($id, $sale_channel = false)
|
||||
{
|
||||
$article = self::get($id);
|
||||
$data = $article->toArray();
|
||||
@@ -85,7 +85,7 @@ class Articles
|
||||
$data['inherited'] = self::getInherited($id);
|
||||
$data['categories'] = self::getCategoriesNameByArticle($article);
|
||||
$data['tags'] = self::getTagsSlugByArticle($article);
|
||||
$data['offers'] = self::getOffersGroupedByNature($id);
|
||||
$data['offers'] = self::getOffersGroupedByNature($id, $sale_channel);
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -135,9 +135,10 @@ class Articles
|
||||
return $data ?? false;
|
||||
}
|
||||
|
||||
public static function getArticlesWithOffers($category_id = false, $tags = false)
|
||||
public static function getArticlesWithOffers($category_id = false, $tags = false, $sale_channel_id = false)
|
||||
{
|
||||
return Article::byCategory($category_id)->byTags($tags)->visible()->withAvailableOffers()->with([
|
||||
$sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID();
|
||||
return Article::byCategory($category_id)->byTags($tags)->visible()->withAvailableOffers($sale_channel_id)->with([
|
||||
'image',
|
||||
'product',
|
||||
'article_nature',
|
||||
|
||||
Reference in New Issue
Block a user