added if all list pkb and koop are empty redirect to home and also add deleteCarts for mobile view

This commit is contained in:
Hafifie PKB
2025-01-26 14:38:05 +08:00
parent 64b1976906
commit 3787b6cb51
2 changed files with 6 additions and 1 deletions
@@ -46,6 +46,11 @@ class BayaranController extends Controller
if($exist_carts['status_pkb'] == 'PENDING') $list_pkb = ($list_pkb) ? $this->setUpahTawarruq($list_pkb) : []; else $list_pkb = [];
if($exist_carts['status_koop'] == 'PENDING') $list_koop = ($list_koop) ? $this->setUpahTawarruq($list_koop) : []; else $list_koop = [];
if (empty($list_pkb) && empty($list_koop)) {
$this->removeCartsInternal();
return redirect()->route('buffer');
}
}else{
/* Doesn't Have Carts. First Timer */
$request->validated();
@@ -362,7 +362,7 @@
</div>
</div>
<div class="">
<a href="{{ route('home') }}" type="button" class="btn btn-danger">Batal</a>
<a onclick="deleteCarts()" type="button" class="cursor-pointer btn btn-danger">Batal</a>&nbsp;
@if($totalupahasal == 1.00 || $errorcount > 0)
<button type="submit" id="bayarsbmt-phone" class="btn btn-primary" disabled onclick="loadingbtn();">Bayar</button>
@else