1
0
Fork 0

fix fast buy card

main
A1Gard 1 year ago
parent efc74948da
commit 841250f3c9

@ -663,8 +663,10 @@ class WebsiteController extends Controller
->get();
foreach ($qs as $q){
$p = Product::whereId($q->product_id)->first();
$p->stock_quantity = $q->count;
$p->save();
if ($p != null){
$p->stock_quantity = $q->count;
$p->save();
}
}
return 'Done!';
}

@ -1,7 +1,7 @@
<div class="quantity @if($pro->getPurePriceDef($q->price) == $pro->getPurePrice()) active @endif"
<div class="quantity @if($index == 0) active @endif"
data-price="{{$pro->getPurePriceDef($q->price)}}"
data-count="{{$q->count}}">
<input type="checkbox" name="data[{{$pro->id}}]" value='{{$q}}' @if($pro->getPurePriceDef($q->price) == $pro->getPurePrice()) checked @endif>
<input type="checkbox" name="data[{{$pro->id}}]" value='{{$q}}' @if($index == 0) checked @endif>
@foreach(\App\Helpers\jsonOrder( $q->data ) as $k => $meta)
@if($k != 'color' && $k != 'count' && $k != 'price')
<span>

@ -68,9 +68,9 @@
</td>
<td colspan="2">
@if($pro->quantities()->sum('count') > 0)
@foreach($pro->quantities as $q)
@foreach($pro->quantities as $index => $q)
@if($q->count > 0)
@include('component.card-quantity',compact('q','pro'))
@include('component.card-quantity',compact('q','pro','$index'))
@endif
@endforeach
@else

Loading…
Cancel
Save