gestion multi point de relay des commandes

This commit is contained in:
Olivier Legat 2021-07-27 15:22:54 +02:00
parent b68d35c698
commit 65e423aeed
6 changed files with 6 additions and 6 deletions

View file

@ -477,7 +477,7 @@ class OrdersController extends Controller
$order = Order::where('reference', '=', $reference)->firstOrFail();
//1 seul magasin en base pour le moment
$magasin = Magasin::first();
$magasin = Magasin::find($order->timeslot->magasin->id);
return view('sales.confirm', compact('activestep', 'order', 'magasin'));
}

View file

@ -16,7 +16,7 @@ class ContactController extends Controller
{
$status = $request->session()->get('status');
//1 seul magasin en base pour le moment
//1er magasin en base pour le moment
$magasin = Magasin::first();
$content = Content::where('key', 'contact')->first();

View file

@ -389,7 +389,7 @@ class CustomerController extends Controller
$order = Order::where('reference', '=', $reference)
->where('customer_id', Auth::guard('customer')->user()->id)
->firstOrFail();
$magasin = Magasin::first();
$magasin = Magasin::find($order->timeslot->magasin->id);
return view('customer.order-detail', compact('order', 'magasin'));
}

View file

@ -32,7 +32,7 @@ class OrderConfirmAdminMail extends Mailable
public function build()
{
$order = $this->order;
$magasin = Magasin::first();
$magasin = Magasin::find($order->timeslot->magasin->id);
return $this->subject("Nouvelle Commande - " . config('theme.site_name'))->view('emails.order-confirm-admin', compact('order', 'magasin'));
}

View file

@ -32,7 +32,7 @@ class OrderConfirmMail extends Mailable
public function build()
{
$order = $this->order;
$magasin = Magasin::first();
$magasin = Magasin::find($order->timeslot->magasin->id);
return $this->subject("Votre commande - " . config('theme.site_name'))->view('mails.order-confirm', compact('order', 'magasin'));
}

View file

@ -32,7 +32,7 @@ class OrderStatusMail extends Mailable
public function build()
{
$order = $this->order;
$magasin = Magasin::first();
$magasin = Magasin::find($order->timeslot->magasin->id);
return $this->subject("Votre commande - " . config('theme.site_name'))->view('mails.order-status', compact('order', 'magasin'));
}