fixed shopping card

pull/26/head
A1Gard 8 months ago
parent 69d49ede58
commit 3e8513f3be

@ -60,7 +60,7 @@ PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
ZARINPAL_MERCHANT='12000000-0220-0000-0220-220000000001'
ZARINPAL_MERCHANT='test'
PAY_GATWAY=zarinpal
THUMBNAIL_SIZE=600x600

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,5 +1,6 @@
var data = require('./plugins/data');
var isSendSms = false;
var step = 1;
function nocomma(num) {
a = num.toString().replace(/\,/g, ''); // 1125, but a string, so convert it to number
@ -268,5 +269,38 @@ jQuery(function ($) {
});
}
}, 500);
$(".next-step").bind('click', function () {
step++;
$(".step" + step).click();
});
$(".progress-step .step").click(function () {
$(".progress-step .step").removeClass('done');
$($(this).data('done')).addClass('done');
$("#card-steps .active").slideUp(300).removeClass('active');
$('#' + $(this).data('id')).slideDown(500).addClass('active');
step = parseInt($(this).data('id').substr(4, 1));
if ($(this).data('id') == 'step3') {
$(".last-step").slideDown(300);
$(".next-step").slideUp(300);
} else {
$(".last-step").slideUp(300);
$(".next-step").slideDown(300);
}
});
if ($('.card-submit').length > 0){
if ($("input.transport:checked").length == 0){
$('.card-submit').removeAttr('disabled');
}else{
$("input.transport").bind('change',function () {
console.log('fire');
$('.card-submit').removeAttr('disabled');
});
}
}
});

@ -13,11 +13,13 @@
<i class="fa fa-shopping-bag"></i>
سبد خرید
</div>
<div class="step step2" data-id="step2" data-done=".progress-step .step1,.progress-step .step2">
<div class="step step2" data-id="step2"
data-done=".progress-step .step1,.progress-step .step2">
<i class="fa fa-truck-fast"></i>
اطلاعات ارسال
</div>
<div class="step step3" data-id="step3" data-done=".progress-step .step1,.progress-step .step2, .progress-step .step3">
<div class="step step3" data-id="step3"
data-done=".progress-step .step1,.progress-step .step2, .progress-step .step3">
<i class="fa fa-credit-card"></i>
اطلاعات پرداخت
</div>
@ -29,7 +31,7 @@
<div class="row">
<div class="col-md-9">
<div id="card-steps">
<div id="step1" class="step active" >
<div id="step1" class="step active">
<div class="text-center" id="card">
<table class="table table-hover table-responsive-lg"
id="card-table">
@ -74,7 +76,8 @@
@endif
@endforeach
@else
<span class="active" data-count="{{$pro->stock_quantity}}"></span>
<span class="active"
data-count="{{$pro->stock_quantity}}"></span>
@foreach(\App\Helpers\getPriceableMeta($pro) as $k => $meta)
<div class="meta">
{{\App\Helpers\getPropLabel($k)}}
@ -89,7 +92,8 @@
@endforeach
@endif
</td>
<td colspan="2" class="price-td" data-price="{{$pro->getPurePrice()}}">
<td colspan="2" class="price-td"
data-price="{{$pro->getPurePrice()}}">
@if($pro->getPurePrice() == 0)
{{__("We call you about price soon.")}}
@else
@ -105,8 +109,10 @@
<div class="btn btn-info count-inc">
<i class="fa fa-plus"></i>
</div>
<input type="number" data-stock="{{$pro->stock_quantity}}"
max="{{$pro->stock_quantity}}" name="count[{{$pro->id}}]"
<input type="number"
data-stock="{{$pro->stock_quantity}}"
max="{{$pro->stock_quantity}}"
name="count[{{$pro->id}}]"
min="1"
data-price="{{str_replace(',','',$pro->getPurePrice())}}"
class="form-control product-count"
@ -117,7 +123,8 @@
</div>
</td>
<td>
<a href="{{route('card.rem',$pro->slug)}}" class="btn btn-outline-danger">
<a href="{{route('card.rem',$pro->slug)}}"
class="btn btn-outline-danger">
<i class="fa fa-times"></i>
</a>
</td>
@ -129,7 +136,8 @@
<td>
<a href="{{route('product',$qpro->product->slug)}}">
<img src="{{$qpro->product->thumbUrl()}}" class="img-64" alt="">
<img src="{{$qpro->product->thumbUrl()}}" class="img-64"
alt="">
</a>
</td>
<td colspan="2">
@ -137,7 +145,8 @@
</td>
<td colspan="2">
@php($data = json_decode($qpro->data))
<span class="badge badge-inverse" style="background: {{$data->color}};">
<span class="badge badge-inverse"
style="background: {{$data->color}};">
<b>
{{\App\Helpers\getColorName($data->color)}}
</b>
@ -162,7 +171,8 @@
<div class="btn btn-info count-inc">
<i class="fa fa-plus"></i>
</div>
<input type="number" data-stock="{{$qpro->count}}" max="{{$qpro->count}}"
<input type="number" data-stock="{{$qpro->count}}"
max="{{$qpro->count}}"
name="qcount[{{$qpro->id}}]"
min="1"
data-price="{{$qpro->price}}"
@ -174,7 +184,8 @@
</div>
</td>
<td>
<a href="{{route('card.remq',$qpro->id)}}" class="btn btn-outline-danger">
<a href="{{route('card.remq',$qpro->id)}}"
class="btn btn-outline-danger">
<i class="fa fa-times"></i>
</a>
</td>
@ -183,16 +194,19 @@
@endforeach
</table>
</div>
<div class="alert alert-success text-center">
شما می‌توانید محصولات را رزرو کنید , برای اینکار به مرحله بعدی بروید و
<b>
گزینه فعال سازی
حالت
رزرو
</b>
@if(\App\Helpers\getSetting('reserve') != null )
را انتخاب کنید
</div>
<div class="alert alert-success text-center">
شما می‌توانید محصولات را رزرو کنید , برای اینکار به مرحله بعدی بروید و
<b>
گزینه فعال سازی
حالت
رزرو
</b>
را انتخاب کنید
</div>
@endif
</div>
<div id="step2" class="step">
@if(count($transports) > 0)
@ -207,6 +221,7 @@
<input id="tns{{$k}}" type="radio" name="transport_id"
data-price="{{$t->price}}"
value="{{$t->id}}"
required
onclick="$('.product-count').change();"
@if ($t->is_default) checked
@endif class="form-check-input transport">
@ -215,8 +230,13 @@
{{$t->title}}
</label>
@if(strlen($t->description) > 1)
<p class="preline alert alert-info mt-1">{{$t->description}} <span
class="float-end">@if($t->price > 0){{number_format($t->price)}} @else {{__("Free")}} @endif</span>
<p class="preline alert alert-info mt-1">{{$t->description}}
<span
class="float-end">@if($t->price > 0)
{{number_format($t->price)}}
@else
{{__("Free")}}
@endif</span>
</p>
@endif
</li>
@ -249,18 +269,21 @@
@endforeach
@endif
</ul>
<div class="p-5 py-3" id="resv">
<div class="form-check form-switch">
<input name="reserve" class="form-check-input" type="checkbox" role="switch"
id="flexSwitchCheckDefault">
<label class="form-check-label"
for="flexSwitchCheckDefault">{{__("Reserve order for :H hours",['H'=>\App\Helpers\getSetting('reserve')])}}</label>
@if(\App\Helpers\getSetting('reserve') != null )
<div class="p-5 py-3" id="resv">
<div class="form-check form-switch">
<input name="reserve" class="form-check-input" type="checkbox"
role="switch"
id="flexSwitchCheckDefault">
<label class="form-check-label"
for="flexSwitchCheckDefault">{{__("Reserve order for :H hours",['H'=>\App\Helpers\getSetting('reserve')])}}</label>
</div>
</div>
</div>
@endif
@endif
<div>
<div class="text-left p-3">
<div class="text-left p-3">
@if(auth('customer')->check() && auth('customer')->user()->colleague == 1)
<div class="p-3 ">
اگر همکاری هستید آدرس مشتری را در این قسمت بنویسید
@ -287,13 +310,14 @@
</div>
</div>
<div id="step3" class="step">
<div >
<div>
<label class="text-start d-block">
{{__("Discount code")}}
</label>
<div class="row">
<div class="col-md-6">
<input type="text" class="form-control" id="discount-code" name="discount"
<input type="text" class="form-control" id="discount-code"
name="discount"
placeholder="{{__("Discount code")}}">
</div>
<div class="col-md-6">
@ -360,18 +384,20 @@
تکمیل اطلاعات
</a>
@else
<button type="submit" class="btn btn-success float-end me-3 ms-3">
<button type="submit" class="btn btn-success float-end my-2 w-100 card-submit" >
<i class="far fa-credit-card"></i>
پرداخت از درگاه های آنلاین
</button>
<button type="submit" class="btn btn-secondary float-end " name="nopay" value="no-payment">
<button type="submit" class="btn btn-secondary float-end w-100 card-submit" name="nopay"
value="no-payment" >
<i class="far fa-credit-card"></i>
ثبت سفارش پرداخت اعتباری + آنلاین
</button>
<br>
<br>
@endif
&nbsp;@else
&nbsp;
@else
{{-- {{__("Register or login to complete purchase")}}--}}
<hr>
<br>

Loading…
Cancel
Save