fixed shopping card bugs

improved panel ui/ux
fixed product page select by quantity
pull/26/head
A1Gard 8 months ago
parent 3e8513f3be
commit 1794d1853a

@ -12,9 +12,11 @@ class TransportController extends Controller
{
function createOrUpdate(Transport $transport,TransportSaveRequest $request){
$transport->price = $request->price;
$transport->title = $request->title;
$transport->description = $request->description;
$transport->is_default = $request->has('is_default');
if ($request->has('is_default')){
Transport::where('is_default')->update([
'is_default' => 0,

@ -11437,6 +11437,48 @@ h3.textt{
transform: scale(1);
}
}
.color-pick .color {
display: inline-block;
opacity: 0.75;
margin-right: 4px;
border-radius: 15px;
border: 1px dotted silver;
}
.color-pick .color span {
display: inline-block;
mix-blend-mode: darken;
font-size: 11px;
padding-right: 4px;
padding-left: 4px;
}
.color-pick .color .cl {
float: left;
min-width: 25px;
height: 25px;
display: inline-block;
border-radius: 50%;
position: relative;
cursor: pointer;
}
.color-pick .color.active {
opacity: 1;
border: 1px solid black;
position: relative;
padding-right: 15px;
}
.color-pick .color.active .cl:after {
content: "✓";
right: 20%;
top: 5%;
position: absolute;
color: white;
mix-blend-mode: difference;
}
.x-mega-menu {
background: #eeeeee;
display: grid;

File diff suppressed because one or more lines are too long

@ -403,3 +403,49 @@
transform: scale(1);
}
}
.color-pick {
}
.color-pick .color {
display: inline-block;
opacity: .75;
margin-right: 4px;
border-radius: 15px;
border: 1px dotted silver;
}
.color-pick .color span {
display: inline-block;
mix-blend-mode: darken;
font-size: 11px;
padding-right: 4px;
padding-left: 4px;
}
.color-pick .color .cl{
float: left;
min-width: 25px;
height: 25px;
display: inline-block;
border-radius: 50%;
position: relative;
cursor: pointer;
}
.color-pick .color.active {
opacity: 1;
border: 1px solid black;
position: relative;
padding-right: 15px;
}
.color-pick .color.active .cl:after {
content: '';
right: 20%;
top:5%;
position: absolute;
color: white;
mix-blend-mode: difference;
}

@ -381,8 +381,8 @@ jQuery(function ($) {
try {
if ($('#qnt').length != 0) {
sizes = {};
qnt = JSON.parse($('#qnt').val());
// console.log(qnt);
let qnt = JSON.parse($('#qnt').val());
console.log(qnt);
let txt = '';
for( const q of qnt) {
if (q.count > 0){
@ -401,17 +401,17 @@ jQuery(function ($) {
setTimeout(function () {
$("#size-pick .size:first-child").click();
},50);
$("#size-pick .size").bind('click.select',function () {
$("#size-pick .size").removeClass('active');
// $("#size-pick .size").bind('click.select',function () {
// $("#size-pick .size").removeClass('active');
let colorNames = {};
try {
colorNames = JSON.parse($("#colors").val());
} catch {
}
$(this).addClass('active');
// $(this).addClass('active');
let colors = sizes[$(this).data('id')];
let txt = '';
txt = '';
let cl = '';
for( const c of colors) {
cl = colorNames[c.color];
@ -439,7 +439,7 @@ jQuery(function ($) {
$("#counting").text($(this).data('count'));
$(".product-count").attr('max',$(this).data('count')).val(1);
});
});
// });
}
} catch (e) {

@ -2,18 +2,13 @@
<div class="row">
<div class="col-md-6 mt-3">
<div class="form-group pt-3" >
<br>
<label for="active">
{{__('Active')}}
</label>
<input name="active" type="checkbox" id="active"
class="float-left ml-4 mt-1 form-check-inline @error('active') is-invalid @enderror"
@if (old('active',$product->active??0) != 0)
checked
@endif
value="1"/>
</div>
<div class="form-check form-switch">
<input name="active" class="form-check-input @error('active') is-invalid @enderror" type="checkbox" value="1" id="active" @if (old('active',$product->active??0) != 0)
checked
@endif>
<label class="form-check-label" for="active">{{__('Active')}}</label>
</div>
</div>
</div>

@ -35,7 +35,7 @@
<div class="form-group">
<label for="width">{{__("Width")}}:</label>
<input type="text" placeholder="{{__("Width")}}" name="width" class="form-control" id="width" required
value="{{old('width',$p->width??null)}}">
value="{{old('width',$p->width??'col-md-12')}}">
</div>
<div class="form-group">

@ -45,16 +45,19 @@
<label for="description">
{{__('Description')}}
</label>
<textarea name="description" rows="4" class="form-control @error('description') is-invalid @enderror" placeholder="{{__('Description')}}" >{{old('description',$transport->description??null)}}</textarea>
<textarea name="description" rows="4" class="form-control @error('description') is-invalid @enderror" placeholder="{{__('Description')}}" @if( isset($transport) && $transport->is_default) checked @endif >{{old('description',$transport->description??null)}}</textarea>
</div>
</div>
<div class="col-md-12 mt-3 mr-5">
<div class="form-group">
<input id="is_default" name="is_default" type="checkbox" class="form-check-input @error('is_default') is-invalid @enderror" @if( isset($transport) && $transport->is_default) checked @endif/>
<label class="form-check-label" for="is_default">
{{__('Is default')}}
</label>
<div class="form-check form-switch">
<input value="1" class="form-check-input @error('is_default') is-invalid @enderror" name="is_default" @if( isset($transport) && $transport->is_default) checked @endif type="checkbox" id="is_default">
<label class="form-check-label" for="is_default"> {{__('Is default')}}</label>
</div>
</div>
</div>
<div class="col-md-12">
<label> &nbsp; </label>

@ -151,9 +151,9 @@
{{\App\Helpers\getColorName($data->color)}}
</b>
</span>
<span class="badge bg-dark">
{{$data->size}}
</span>
{{-- <span class="badge bg-dark">--}}
{{-- {{$data->size}}--}}
{{-- </span>--}}
</td>
<td colspan="2" class="price-td" data-price="{{$qpro->price}}">
@if($qpro->price == 0)

@ -139,17 +139,29 @@
</th>
<td>
<div class="color-pick">
<input type="hidden" class="color" value="red"/>
@php $colors = json_decode(\App\Helpers\getProp('color')->options,'true'); @endphp
@foreach($colors as $c)
<div style="background: {{$c['value']}}" data-color="{{$c['value']}}"
class="color @if($c['value'] == $pro->getMeta('color')) active @endif"></div>
@endforeach
</div>
</td>
</tr>
@endif
<tr>
<th style="vertical-align: middle">
تعداد
</th>
<td>
{{-- <div id="counting" class="text-muted float-start mt-2"></div>--}}
<div class="product-count d-inline-block">
<div class="btn btn-info count-inc" style="padding: 2px 5px">
<i class="fa fa-plus"></i>
</div>
<input type="number" id="single-count" class="product-count"
value="1" max="1">
<div class="btn btn-info count-dec" style="padding: 2px 5px">
<i class="fa fa-minus"></i>
</div>
</div>
</td>
</tr>
@if($pro->hasMeta('warranty'))
<tr>
<th>
@ -199,8 +211,8 @@
</a>
</div>
<div class="col">
<a href="{{route('card.add',$pro->slug)}}"
class="add-to-card btn btn-primary w-100 mt-1">
<a href="{{route('card.addq',['',''])}}"
class="add-to-card-q btn btn-primary w-100 mt-1">
<img src="{{asset('images/basket.svg')}}" class="basket-icon" alt="">
افزودن به سبد خرید
</a>
@ -219,6 +231,7 @@
</ul>
<div class="tab-container">
<div id="tab-detail" class="active">
<table class="table table-bordered attribute ">
@foreach($pro->getAllMeta() as $k => $meta)
@if($k != 'color' && $k != 'warranty')
@ -374,6 +387,7 @@
</div>
</div>
</div>
</section>
<input type="hidden" id="qn" value="">
<input type="hidden" id="qnt" value='{!! $pro->quantities()->orderBy('price')->get();!!}'>

Loading…
Cancel
Save