Fix on default sale channel

This commit is contained in:
Ludovic CANDELLIER
2022-03-07 22:58:40 +01:00
parent aa50f908ba
commit 0eaa11b2a9
2 changed files with 19 additions and 4 deletions

View File

@@ -75,8 +75,9 @@ class Articles
return Article::orderBy('name', 'asc')->get();
}
public static function getArticleToSell($id, $sale_channel = false)
public static function getArticleToSell($id, $sale_channel_id = false)
{
$sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID();
$article = self::get($id);
$data = $article->toArray();
$parents = self::getInheritedByProduct($article->product_id, $article->product_type);
@@ -87,7 +88,7 @@ class Articles
$data['inherited'] = self::getInherited($id);
$data['categories'] = self::getCategoriesNameByArticle($article);
$data['tags'] = self::getTagsSlugByArticle($article);
$data['offers'] = self::getOffersGroupedByNature($id, $sale_channel);
$data['offers'] = self::getOffersGroupedByNature($id, $sale_channel_id);
return $data;
}