Skip to content

Commit 40706b2

Browse files
committed
Shopping cart view updated
1 parent 64a7cf2 commit 40706b2

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

EasyShop/resources/views/cart/index.blade.php

+18-11
Original file line numberDiff line numberDiff line change
@@ -47,33 +47,40 @@
4747

4848
<tr>
4949
<td class="cart_product">
50-
<a href=""><img src="http://localhost/easyshop/upload/images/{{$cartItem->options->img}}" alt="" width="200px"></a>
50+
<a href="{{url('/product_details')}}/{{$cartItem->id}}"><img src="{{$cartItem->options->img}}" alt="" width="200px"></a>
5151
</td>
5252
<td class="cart_description">
53-
<h4><a href="">{{$cartItem->name}}</a></h4>
54-
<p>Web ID: {{$cartItem->id}}</p>
53+
<h4><a href="{{url('/product_details')}}/{{$cartItem->id}}" style="color:blue">{{$cartItem->name}}</a></h4>
54+
<p>Product ID: {{$cartItem->id}}</p>
5555
</td>
5656
<td class="cart_price">
5757
<p>${{$cartItem->price}}</p>
5858
</td>
5959
<td class="cart_quantity">
6060
<div class="cart_quantity_button">
6161
{!! Form::open(['url' => ['cart/update',$cartItem->rowId], 'method'=>'put']) !!}
62-
<input type="button" value="-" id="moins{{$cartItem->id}}" onclick="minus{{$cartItem->id}}()" class="cart_quantity_down">
63-
<input type="text" size="3" value="{{$cartItem->qty}}" name="qty" id="count{{$cartItem->id}}" autocomplete="off" style="text-align:center" >
64-
<input type="button" value="+" id="plus{{$cartItem->id}}" onclick="plus{{$cartItem->id}}()" class="cart_quantity_up">
65-
66-
67-
<br>
68-
<input type="submit" value="Update" class="btn btn-primary" style="margin:5px">
62+
<?php /*
63+
* <input type="button" value="-" id="moins{{$cartItem->id}}" onclick="minus{{$cartItem->id}}()" class="cart_quantity_down">
64+
*/?>
65+
<input type="number" size="2" value="{{$cartItem->qty}}" name="qty" id="count{{$cartItem->id}}"
66+
autocomplete="off" style="text-align:center; max-width:50px; " MIN="1" MAX="30">
67+
<?php /*
68+
* <input type="button" value="+" id="plus{{$cartItem->id}}" onclick="plus{{$cartItem->id}}()" class="cart_quantity_up">
69+
*/?>
70+
71+
<button type="submit" class="btn btn-success btn-sm" title="Update Count">
72+
<span class="glyphicon glyphicon-edit"></span></button>
73+
74+
6975
{!! Form::close() !!}
7076
</div>
7177
</td>
7278
<td class="cart_total">
7379
<p class="cart_total_price">${{$cartItem->subtotal}}</p>
7480
</td>
7581
<td class="cart_delete">
76-
<a class="cart_quantity_delete" href="{{url('/cart/remove')}}/{{$cartItem->rowId}}"><i class="fa fa-times"></i></a>
82+
<a class="cart_quantity_delete" style="background-color:red"
83+
href="{{url('/cart/remove')}}/{{$cartItem->rowId}}"><i class="fa fa-times"></i></a>
7784
</td>
7885
</tr>
7986

EasyShop/resources/views/front/recommends.blade.php

+10-7
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66
->orderby('total','DESC')
77
->take(3)
88
->get();
9-
10-
9+
if(Auth::check()){
1110
$products2 = DB::table('recommends')
1211
->leftJoin('products','recommends.pro_id','products.id')
1312
->where('uid',Auth::user()->id)
1413
->inRandomOrder()
1514
->take(3)
1615
->get();
17-
16+
}else{
17+
$products2 = DB::table('recommends')
18+
->leftJoin('products','recommends.pro_id','products.id')
19+
->inRandomOrder()
20+
->take(3)
21+
->get();
22+
}
1823
?>
1924
<div id="recommended-item-carousel" class="carousel slide" data-ride="carousel">
2025
<div class="carousel-inner">
@@ -27,8 +32,7 @@
2732
<a href="{{url('/product_details')}}/{{$p->pro_id}}">
2833
<img src="{{$p->pro_img}}" alt="" /></a>
2934
<h2>${{$p->pro_price}}</h2>
30-
<p> <a href="{{url('/product_details')}}/{{$p->pro_id}}">
31-
{{$p->pro_name}} {{$p->pro_id}}</a></p>
35+
<p> <a href="{{url('/product_details')}}/{{$p->pro_id}}">{{$p->pro_name}}</a></p>
3236
<a href="{{url('/cart/addItem')}}/{{$p->pro_id}}" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
3337
</div>
3438

@@ -46,8 +50,7 @@
4650
<a href="{{url('/product_details')}}/{{$p->pro_id}}">
4751
<img src="{{$p->pro_img}}" alt="" /></a>
4852
<h2>${{$p->pro_price}}</h2>
49-
<p> <a href="{{url('/product_details')}}/{{$p->pro_id}}">
50-
{{$p->pro_name}} {{$p->pro_id}}</a></p>
53+
<p> <a href="{{url('/product_details')}}/{{$p->pro_id}}">{{$p->pro_name}}</a></p>
5154
<a href="{{url('/cart/addItem')}}/{{$p->pro_id}}" class="btn btn-default add-to-cart">
5255
<i class="fa fa-shopping-cart"></i>
5356
Add to cart</a>

0 commit comments

Comments
 (0)