minor fixes

This commit is contained in:
ludo
2023-12-09 21:02:28 +01:00
parent b5da5fc881
commit 2a429e4163
49 changed files with 448 additions and 266 deletions

View File

@@ -3,7 +3,6 @@
namespace App\Repositories\Shop;
use App\Models\Shop\Offer;
use App\Models\Shop\PriceList;
use App\Traits\Model\Basic;
class Offers
@@ -30,6 +29,7 @@ class Offers
{
return Offer::with('variation')->byIds($ids)->get();
}
public static function getWithPricesByIds($ids, $saleChannelId = false)
{
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
@@ -69,7 +69,7 @@ class Offers
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
$offer = Offer::withPriceBySaleChannelByQuantity($saleChannelId, $quantity)->find($id);
$priceList = $offer->price_lists->first();
return $priceList ? $priceList->price_list_values->first() : false;
}