add shipping to order, methods to calculate, little refactoring
This commit is contained in:
@@ -25,6 +25,23 @@ class Offers
|
||||
return $offer ? $offer->weight * $quantity : 0;
|
||||
}
|
||||
|
||||
public static function getWithVariationByIds($ids)
|
||||
{
|
||||
return Offer::with('variation')->byIds($ids)->get();
|
||||
}
|
||||
public static function getWithPricesByIds($ids, $saleChannelId = false)
|
||||
{
|
||||
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
|
||||
|
||||
return Offer::with([
|
||||
'variation',
|
||||
'article.article_nature',
|
||||
'article.product.Specie',
|
||||
'article.image',
|
||||
'price_lists.price_list_values',
|
||||
])->withPriceListsBySaleChannel($saleChannelId)->byIds($ids)->get();
|
||||
}
|
||||
|
||||
public static function getFull($id, $saleChannelId = false)
|
||||
{
|
||||
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
|
||||
|
||||
Reference in New Issue
Block a user