new: add channel management
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Repositories\Shop;
|
||||
use App\Models\Shop\Article;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
@@ -70,9 +71,14 @@ class Articles
|
||||
|
||||
public static function getArticleToSell($id, $saleChannelId = false)
|
||||
{
|
||||
$saleChannelId = $saleChannelId ?: SaleChannels::getDefaultID();
|
||||
$data = self::getArticle($id);
|
||||
$data['offers'] = self::getOffersGroupedByNature($id, $saleChannelId);
|
||||
|
||||
$currentSaleChannel = $saleChannelId ? SaleChannels::get($saleChannelId) : null;
|
||||
$data['current_sale_channel'] = $currentSaleChannel ? $currentSaleChannel->toArray() : null;
|
||||
$data['available_sale_channels'] = Offers::getSaleChannelsForArticle($id);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user