better management of shipping and basket summary display

This commit is contained in:
ludo
2023-12-03 00:40:47 +01:00
parent 4bcfc7bc6d
commit ec509df665
26 changed files with 317 additions and 477 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Repositories\Shop;
use App\Models\Shop\Offer;
use App\Models\Shop\PriceList;
use App\Traits\Model\Basic;
class Offers
@@ -36,7 +37,7 @@ class Offers
return Offer::with([
'variation',
'article.article_nature',
'article.product.Specie',
'article.product',
'article.image',
'price_lists.price_list_values',
])->withPriceListsBySaleChannel($saleChannelId)->byIds($ids)->get();
@@ -67,8 +68,9 @@ class Offers
{
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
$offer = Offer::withPriceBySaleChannelByQuantity($saleChannelId, $quantity)->find($id);
return $offer->price_lists->first()->price_list_values->first();
$priceList = $offer->price_lists->first();
return $priceList ? $priceList->price_list_values->first() : false;
}
public static function getOffersByArticles($article_ids, $saleChannelId = false)