fix checkout

This commit is contained in:
Bayu Lukman Yusuf 2026-02-11 21:09:09 +07:00
parent 9288a13e07
commit f547c6e158
12 changed files with 50 additions and 109 deletions

View File

@ -70,9 +70,12 @@ WMS_ASSET_URL="https://dev.smgdev.top/api/storage"
BITESHIP_URL= BITESHIP_URL=
BITESHIP_KEY= BITESHIP_KEY=
BITESHIP_COURIER_ALL=grab,gojek,tiki,jnt,anteraja BITESHIP_COURIER=grab,gojek,tiki,jnt,anteraja
GOOGLE_CLIENT_ID=1023147148625-3igh5253tr1lkflmbfj76iopvp2n52od.apps.googleusercontent.com GOOGLE_CLIENT_ID=1023147148625-3igh5253tr1lkflmbfj76iopvp2n52od.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=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 GOOGLE_CLIENT_SECRET=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
GOOGLE_REDIRECT_URI=http://localhost:8000/login/google/callback GOOGLE_REDIRECT_URI=http://localhost:8000/login/google/callback
XENDIT_PRIVATE_KEY=

View File

@ -116,6 +116,7 @@ class CheckoutController extends Controller
'shipping_list' => $shipping_list, 'shipping_list' => $shipping_list,
]); ]);
} catch (\Exception $e) { } catch (\Exception $e) {
Log::info($e);
return redirect()->route('checkout.delivery')->with('error', 'Invalid checkout data'); return redirect()->route('checkout.delivery')->with('error', 'Invalid checkout data');
} }
} }

View File

@ -104,4 +104,8 @@ class Transaction extends Model
return __('order.status.'.strtolower($this->attributes['status'])); return __('order.status.'.strtolower($this->attributes['status']));
} }
public function getTotalAttribute()
{
return $this->attributes['subtotal'] + $this->attributes['shipping_price'];
}
} }

View File

@ -12,6 +12,7 @@ use App\Models\Transaction;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Validation\ValidationException; use Illuminate\Validation\ValidationException;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
class ShippingRepository class ShippingRepository
{ {
@ -95,20 +96,23 @@ class ShippingRepository
}); });
if ($hasLatLong){ if ($hasLatLong){
return $biteship->rateByLatLong([ $list = $biteship->rateByLatLong([
"origin_latitude" => $location->latitude, "origin_latitude" => $location->latitude,
"origin_longitude" => $location->longitude, "origin_longitude" => $location->longitude,
"destination_latitude" => $address->latitude, "destination_latitude" => $address->latitude,
"destination_longitude" => $address->longitude, "destination_longitude" => $address->longitude,
"items" => $items "items" => $items
]); ]);
}else{ }else{
return $biteship->rateByPostal([ $list = $biteship->rateByPostal([
"origin_postal_code" => $location->postal_code, "origin_postal_code" => $location->postal_code,
"destination_postal_code" => $address->postal_code, "destination_postal_code" => $address->postal_code,
"items" => $items "items" => $items
]); ]);
} }
return $list;
} }

View File

@ -5,6 +5,7 @@ return [
'categories' => 'Categories', 'categories' => 'Categories',
'genders' => 'Genders', 'genders' => 'Genders',
'price' => 'Price', 'price' => 'Price',
'brands' => 'Brands',
'filter' => 'Filter', 'filter' => 'Filter',
'sort_by' => 'Sort by', 'sort_by' => 'Sort by',
'sort_relevance' => 'Relevance', 'sort_relevance' => 'Relevance',

View File

@ -4,6 +4,7 @@ return [
"title" => "Katalog", "title" => "Katalog",
'categories' => 'Kategori', 'categories' => 'Kategori',
'genders' => 'Gender', 'genders' => 'Gender',
'brands' => 'Merek',
'price' => 'Harga', 'price' => 'Harga',
'filter' => 'Filter', 'filter' => 'Filter',
'sort_by' => 'Urutkan', 'sort_by' => 'Urutkan',

View File

@ -1,12 +1,13 @@
@if($categories && $categories->count() > 0) @if($categories && $categories->count() > 0)
<ul class="nav align-items-center text-body-tertiary gap-2"> <ul class="nav flex-column gap-2 pt-sm-3 pb-3 pb-sm-0 mt-n1 mb-1 mb-sm-0">
@foreach($categories as $index => $category) @foreach($categories as $index => $category)
<li class="animate-underline"> <li class="d-flex w-100 pt-1">
<a class="nav-link fw-normal p-0 animate-target" href="#!">{{ $category->name }}</a>
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
href="{{ route('product.index',['filter[category_id]'=>$category->id]) }}">{{ $category->name }}</a>
</li> </li>
@if($index < $categories->count() - 1)
<li class="px-1">/</li>
@endif
@endforeach @endforeach
</ul> </ul>
@endif @endif

View File

@ -40,6 +40,7 @@
<div class="h6 mb-2"> <div class="h6 mb-2">
@if ($product->display_discount_price > 0) @if ($product->display_discount_price > 0)
Rp {{ number_format($product->display_discount_price,0,",",".") }} Rp {{ number_format($product->display_discount_price,0,",",".") }}
<br class="d-block d-md-none">
<del class="fs-sm fw-normal text-body-tertiary">Rp {{ number_format($product->display_price,0,",",".") }}</del> <del class="fs-sm fw-normal text-body-tertiary">Rp {{ number_format($product->display_price,0,",",".") }}</del>
@else @else
Rp {{ number_format($product->display_price,0,",",".") }} Rp {{ number_format($product->display_price,0,",",".") }}

View File

@ -102,7 +102,7 @@
<div class="d-flex align-items-center justify-content-between fs-sm border-top pt-4"> <div class="d-flex align-items-center justify-content-between fs-sm border-top pt-4">
{{ __('order_detail.estimated_total') }}: {{ __('order_detail.estimated_total') }}:
<span class="h5 text-end ms-2 mb-0"> <span class="h5 text-end ms-2 mb-0">
Rp {{ number_format($order?->total ?? 210590, 0, ',', '.') }} Rp {{ number_format($order?->total ?? 0, 0, ',', '.') }}
</span> </span>
</div> </div>
</div> </div>

View File

@ -69,32 +69,7 @@
</h6> </h6>
<div class="accordion-collapse collapse d-sm-block" id="categoriesLinks" <div class="accordion-collapse collapse d-sm-block" id="categoriesLinks"
aria-labelledby="categoriesHeading" data-bs-parent="#footerLinks"> aria-labelledby="categoriesHeading" data-bs-parent="#footerLinks">
<ul class="nav flex-column gap-2 pt-sm-3 pb-3 pb-sm-0 mt-n1 mb-1 mb-sm-0"> <x-footer-category />
<li class="d-flex w-100 pt-1">
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
href="#!">Vectors</a>
</li>
<li class="d-flex w-100 pt-1">
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
href="#!">Photos</a>
</li>
<li class="d-flex w-100 pt-1">
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
href="#!">3D illustrations</a>
</li>
<li class="d-flex w-100 pt-1">
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
href="#!">AI images</a>
</li>
<li class="d-flex w-100 pt-1">
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
href="#!">Templates</a>
</li>
<li class="d-flex w-100 pt-1">
<a class="nav-link animate-underline animate-target d-inline fw-normal text-truncate p-0"
href="#!">Mockups</a>
</li>
</ul>
</div> </div>
<hr class="d-sm-none my-0"> <hr class="d-sm-none my-0">
</div> </div>
@ -164,7 +139,7 @@
<p class="fs-xs text-body text-center text-lg-start mb-0"> <p class="fs-xs text-body text-center text-lg-start mb-0">
&copy; All rights reserved. Made with <i class="ci-heart-filled align-middle"></i> by <span &copy; All rights reserved. Made with <i class="ci-heart-filled align-middle"></i> by <span
class="animate-underline"><a class="animate-target text-white text-decoration-none" class="animate-underline"><a class="animate-target text-white text-decoration-none"
href="https://coderthemes.com/" target="_blank" rel="noreferrer">{{ config('app.name') }}</a></span> href="/" target="_blank" rel="noreferrer">{{ config('app.name') }}</a></span>
</p> </p>
</div> </div>

View File

@ -26,7 +26,7 @@
<aside class="col-lg-3"> <aside class="col-lg-3">
<div class="offcanvas-lg offcanvas-start pe-lg-4" id="filterSidebar"> <div class="offcanvas-lg offcanvas-start pe-lg-4" id="filterSidebar">
<div class="offcanvas-header py-3"> <div class="offcanvas-header py-3">
<h5 class="offcanvas-title">Filter products</h5> <h5 class="offcanvas-title"> {{ __('catalog_fashion.filter') }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" <button type="button" class="btn-close" data-bs-dismiss="offcanvas"
data-bs-target="#filterSidebar" aria-label="Close"></button> data-bs-target="#filterSidebar" aria-label="Close"></button>
</div> </div>
@ -81,7 +81,7 @@
<h4 class="accordion-header" id="headingBrands"> <h4 class="accordion-header" id="headingBrands">
<button type="button" class="accordion-button p-0 pb-3" data-bs-toggle="collapse" <button type="button" class="accordion-button p-0 pb-3" data-bs-toggle="collapse"
data-bs-target="#brands" aria-expanded="true" aria-controls="brands"> data-bs-target="#brands" aria-expanded="true" aria-controls="brands">
Brands {{ __('catalog_fashion.brands') }}
</button> </button>
</h4> </h4>
<div class="accordion-collapse collapse show" id="brands" <div class="accordion-collapse collapse show" id="brands"
@ -101,7 +101,7 @@
<h4 class="accordion-header" id="headingPrice"> <h4 class="accordion-header" id="headingPrice">
<button type="button" class="accordion-button p-0 pb-3" data-bs-toggle="collapse" <button type="button" class="accordion-button p-0 pb-3" data-bs-toggle="collapse"
data-bs-target="#price" aria-expanded="true" aria-controls="price"> data-bs-target="#price" aria-expanded="true" aria-controls="price">
Price {{ __('catalog_fashion.price') }}
</button> </button>
</h4> </h4>
<div class="accordion-collapse collapse show" id="price" <div class="accordion-collapse collapse show" id="price"
@ -610,7 +610,7 @@
</section> </section>
</main> </main>
@include('layouts.partials/footer2') @include('layouts.partials.footer2')
<button type="button" <button type="button"
class="fixed-bottom z-sticky w-100 btn btn-lg btn-dark border-0 border-top border-light border-opacity-10 rounded-0 pb-4 d-lg-none" class="fixed-bottom z-sticky w-100 btn btn-lg btn-dark border-0 border-top border-light border-opacity-10 rounded-0 pb-4 d-lg-none"

View File

@ -13,7 +13,7 @@
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li> <li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
<li class="breadcrumb-item"><a href="{{ route('home') }}">Product</a></li> <li class="breadcrumb-item"><a href="{{ route('home') }}">Product</a></li>
<li class="breadcrumb-item active" aria-current="page">Detail</li> <li class="breadcrumb-item active" aria-current="page">{{ $product->name ?? 'Detail' }}</li>
</ol> </ol>
</nav> </nav>
@ -100,6 +100,16 @@
<!-- Title --> <!-- Title -->
<h1 class="h3">{{ $product->name }}</h1> <h1 class="h3">{{ $product->name }}</h1>
{{-- add category --}}
<div class="mb-4 gap-2">
<a href="{{ route('product.index',['filter[category_id]' => $product->category->id]) }}"
class="text-decoration-none text-body-emphasis animate-underline text-xs border border-secondary rounded-pill px-2 py-1" style="font-size:10pt;">{{ $product->category->name }}</a>
<a href="{{ route('product.index',['filter[brand_id]' => $product->brand->id]) }}"
class="text-decoration-none text-body-emphasis animate-underline text-xs border border-secondary rounded-pill px-2 py-1" style="font-size:10pt;">{{ $product->brand->name }}</a>
</div>
<!-- Description --> <!-- Description -->
<p class="fs-sm mb-0">{!! nl2br(Str::limit($product->description, 500)) !!}</p> <p class="fs-sm mb-0">{!! nl2br(Str::limit($product->description, 500)) !!}</p>
<div class="collapse" id="moreDescription"> <div class="collapse" id="moreDescription">
@ -782,73 +792,10 @@
<!-- Instagram feed --> <!-- Instagram feed -->
<section class="container pt-5 mt-2 mt-sm-3 mt-lg-4 mt-xl-5"> <x-home.instagram-feed />
<div class="text-center pt-1 pb-2 pb-md-3">
<h2 class="pb-2 mb-1">
<span class="animate-underline">
<a class="animate-target text-dark-emphasis text-decoration-none" href="#!">#AsiaGolf</a>
</span>
</h2>
<p>Find more inspiration on our Instagram</p>
</div>
<div class="overflow-x-auto pb-3 mb-n3" data-simplebar>
<div class="d-flex gap-2 gap-md-3 gap-lg-4" style="min-width: 700px">
<a class="hover-effect-scale hover-effect-opacity position-relative w-100 overflow-hidden"
href="#!">
<span
class="hover-effect-target position-absolute top-0 start-0 w-100 h-100 bg-black bg-opacity-25 opacity-0 z-1"></span>
<i
class="ci-instagram hover-effect-target fs-4 text-white position-absolute top-50 start-50 translate-middle opacity-0 z-2"></i>
<div class="hover-effect-target ratio ratio-1x1">
<img src="/img/instagram/01.jpg" alt="Instagram image">
</div>
</a>
<a class="hover-effect-scale hover-effect-opacity position-relative w-100 overflow-hidden"
href="#!">
<span
class="hover-effect-target position-absolute top-0 start-0 w-100 h-100 bg-black bg-opacity-25 opacity-0 z-1"></span>
<i
class="ci-instagram hover-effect-target fs-4 text-white position-absolute top-50 start-50 translate-middle opacity-0 z-2"></i>
<div class="hover-effect-target ratio ratio-1x1">
<img src="/img/instagram/02.jpg" alt="Instagram image">
</div>
</a>
<a class="hover-effect-scale hover-effect-opacity position-relative w-100 overflow-hidden"
href="#!">
<span
class="hover-effect-target position-absolute top-0 start-0 w-100 h-100 bg-black bg-opacity-25 opacity-0 z-1"></span>
<i
class="ci-instagram hover-effect-target fs-4 text-white position-absolute top-50 start-50 translate-middle opacity-0 z-2"></i>
<div class="hover-effect-target ratio ratio-1x1">
<img src="/img/instagram/03.jpg" alt="Instagram image">
</div>
</a>
<a class="hover-effect-scale hover-effect-opacity position-relative w-100 overflow-hidden"
href="#!">
<span
class="hover-effect-target position-absolute top-0 start-0 w-100 h-100 bg-black bg-opacity-25 opacity-0 z-1"></span>
<i
class="ci-instagram hover-effect-target fs-4 text-white position-absolute top-50 start-50 translate-middle opacity-0 z-2"></i>
<div class="hover-effect-target ratio ratio-1x1">
<img src="/img/instagram/04.jpg" alt="Instagram image">
</div>
</a>
<a class="hover-effect-scale hover-effect-opacity position-relative w-100 overflow-hidden"
href="#!">
<span
class="hover-effect-target position-absolute top-0 start-0 w-100 h-100 bg-black bg-opacity-25 opacity-0 z-1"></span>
<i
class="ci-instagram hover-effect-target fs-4 text-white position-absolute top-50 start-50 translate-middle opacity-0 z-2"></i>
<div class="hover-effect-target ratio ratio-1x1">
<img src="/img/instagram/05.jpg" alt="Instagram image">
</div>
</a>
</div>
</div>
</section>
</main> </main>
<footer class="footer pt-5 pb-4"> {{-- <footer class="footer pt-5 pb-4">
<div class="container pt-sm-2 pt-md-3 pt-lg-4"> <div class="container pt-sm-2 pt-md-3 pt-lg-4">
<div class="row pb-5 mb-lg-3"> <div class="row pb-5 mb-lg-3">
@ -1076,7 +1023,10 @@
</div> </div>
</div> </div>
</div> </div>
</footer> </footer> --}}
@include('layouts.partials.footer2')
@endsection @endsection
@section('scripts') @section('scripts')