add shipping rules
This commit is contained in:
@@ -2,15 +2,10 @@
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
use App\Models\Shop\PriceList;
|
||||
|
||||
class PriceLists
|
||||
{
|
||||
|
||||
public static function getByOfferAndSaleChannel($offer_id, $sale_channel_id)
|
||||
{
|
||||
return PriceList::bySaleChannel($sale_channel_id)->byOffer($offer_id)->get();
|
||||
@@ -28,7 +23,7 @@ class PriceLists
|
||||
|
||||
public static function getStatuses()
|
||||
{
|
||||
return ['Actif','Suspendu','Invisible','Obsolete'];
|
||||
return ['Actif', 'Suspendu', 'Invisible', 'Obsolete'];
|
||||
}
|
||||
|
||||
public static function getByTariff($id)
|
||||
@@ -53,6 +48,7 @@ class PriceLists
|
||||
if ($n <= 3) {
|
||||
$price_list['price_list_values'] += array_fill($n, 3 - $n, '');
|
||||
}
|
||||
|
||||
return $price_list;
|
||||
}
|
||||
|
||||
@@ -78,6 +74,7 @@ class PriceLists
|
||||
unset($data['price_list_values']);
|
||||
$price_list = $id ? self::update($data) : self::create($data);
|
||||
PriceListValues::storePrices($price_list->id, $price_list_values);
|
||||
|
||||
return $price_list;
|
||||
}
|
||||
|
||||
@@ -91,6 +88,7 @@ class PriceLists
|
||||
$id = $id ? $id : $data['id'];
|
||||
$item = self::get($id);
|
||||
$item->update($data);
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user