Add new data in getBasket context
This commit is contained in:
@@ -47,10 +47,16 @@ class Offers
|
||||
{
|
||||
$basket = ShopCart::getContent();
|
||||
// dump($basket->toArray());
|
||||
$offers = Offer::with(['variation', 'article.article_nature', 'article.image'])->whereIn('id', ShopCart::keys())->get();
|
||||
|
||||
$offers = Offer::with([
|
||||
'variation',
|
||||
'article.article_nature',
|
||||
'article.product.Specie',
|
||||
'article.image',
|
||||
])->whereIn('id', ShopCart::keys())->get();
|
||||
foreach ($basket as $item) {
|
||||
$offer = $offers->where('id', $item->id)->first();
|
||||
dump($offer->toArray());
|
||||
exit;
|
||||
$article_nature = strtolower($offer->article->article_nature->name);
|
||||
$data[$article_nature][] = [
|
||||
'id' => (int) $item->id,
|
||||
|
||||
Reference in New Issue
Block a user