我收到一個未定義的變量錯誤,我不知道爲什麼。這裏是我的代碼:未定義變量:product_cart
@if(Session::has('cart'))
@foreach($product_cart as $cart)
<!-- one item -->
<div class="media">
<img width="25%" src="source/image/product/{{$cart['item']['image']}}" alt=""
class="pull-left">
<div class="media-body">
<p class="font-large">{{$cart['item']['name']}}</p>
<span class="color-gray your-order-info">Đơn giá: {{number_format($cart['price'])}} đồng</span>
<span class="color-gray your-order-info">Số lượng: {{$cart['qty']}}</span>
</div>
</div>
<!-- end one item -->
@endforeach
@endif
從哪裏獲取數組$ product_cart中的數據? – Nivedita
你通過$ product_cart的地方? –
請顯示您的控制器部件以查看此刀片文件 –