Add prices and filtering by sale_channel with default

This commit is contained in:
Ludovic CANDELLIER
2022-02-22 22:32:46 +01:00
parent 3c3481b39d
commit f8c686caa3
6 changed files with 43 additions and 13 deletions

View File

@@ -6,6 +6,21 @@ use App\Models\Shop\SaleChannel;
class SaleChannels
{
public static function getDefaultID()
{
return self::getDefault()->id;
}
public static function getDefault()
{
return self::getByCode('clic');
}
public static function getByCode($code)
{
return SaleChannel::byCode($code)->first();
}
public static function getOptions()
{
return SaleChannel::orderBy('name', 'asc')->pluck('name', 'id')->toArray();