Skip to content

Commit

Permalink
product page updated header and css
Browse files Browse the repository at this point in the history
  • Loading branch information
S4nfs committed Apr 10, 2022
1 parent 480b3f3 commit 20eaacf
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
5 changes: 5 additions & 0 deletions app/Http/Controllers/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ function myOrders()
function searchProducts(Request $req)
{
$search = $req->search; //can also use If(request('search'))
if($search != ""){
$data = Product::Where('category', 'like', '%' . $search . '%')->orWhere('description', 'like', '%' . $search . '%')->get();
return view('searchresults',['sproducts' => $data]);
}
else{
return redirect('/')->with('jsalert', 'No Products Found');
}
}
}
26 changes: 21 additions & 5 deletions public/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ img.slider-img{
.custom-product{
height: 1000px;;
}
.trend{
margin-bottom: 100px;
}
.trending-items{
float: left;
width: 150px;
height: 120px;
position: relative;
margin: 50px 50px 250px 50px;
}
.trendtilename{
margin-bottom: 2rem;
}
.trendbtn{
text-align: center;
}
.cc{
background-color: gainsboro;
border-radius: 50px;
Expand All @@ -62,12 +78,12 @@ img.slider-img{
.trending-wrapper{
margin: 30px;
}
.trending-items{
float: left;
width: 20%;
}
.trending-img{
height: 100px;
margin: 1px 5px 1px 5px;
}
.trendtile{
min-height: 17rem;
}
.detail-img{
height: 200px;
Expand All @@ -76,4 +92,4 @@ margin: 30px;
.dropdown{
margin-right: 1rem;

}
}
9 changes: 6 additions & 3 deletions resources/views/product.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,26 @@
</button>
</div>
</div>
<div class="custom-product">
<div class="custom-product trend">

<div class="trending-wrapper">
<h3>Trending on S-Mart <span class="badge bg-dark">new</span></h3>
@foreach ($products as $items)
<div class="trending-items">
<div class="ti">
<div class="trendtile">
<a href="detail/{{ $items['id'] }}">
<img class="trending-img" src="{{ $items['gallery'] }}" alt="First slide">
<div class="" style="margin-top: 3rem;">
<div class="">
<div class="trendtilename">
<p style="color:black;">{{ $items['name'] }} </p>
{{-- <p style="color:black;">Price: Rs {{ $items['price'] }}</p> --}}
</div>
</div>
</a>
</div>
<div class="trendbtn">
<a href="/detail/{{ $items->cart_id }}" class="btn btn-warning">Add</a>
</div>
</div>
@endforeach
</div>
Expand Down

0 comments on commit 20eaacf

Please sign in to comment.