order view for customer fixed

This commit is contained in:
Prashant Singh 2019-04-06 02:18:31 +05:30
parent 1f528736ec
commit 8cfcf3d484
1 changed files with 8 additions and 6 deletions

View File

@ -82,13 +82,15 @@ class OrderController extends Controller
{
$orders = auth()->guard('customer')->user()->all_orders;
if(isset($orders) && count($orders)) {
$order = $orders->first();
return view($this->_config['view'], compact('order'));
} else {
return redirect()->route( 'customer.orders.index');
if (isset($orders) && count($orders)) {
foreach ($orders as $order) {
if ($order->id == $id) {
return view($this->_config['view'], compact('order'));
}
}
}
return redirect()->route( 'customer.orders.index');
}
/**