account pages: login, order history, order details, account details, wishlist

This commit is contained in:
elvira
2026-09-24 17:27:58 +03:00
parent 580adac33a
commit cf3681260b
42 changed files with 1972 additions and 15 deletions
+29
View File
@@ -0,0 +1,29 @@
{{-- A guest's wishlist (from the cookie). Logged-in users get account/wishlist instead. --}}
@extends('layouts.app')
@section('title', __('storefront.account.nav_wishlist'))
@push('seo')
<meta name="robots" content="noindex, follow">
@endpush
@section('content')
<section class="flex flex-col gap-12 px-4 py-20 sm:px-8 lg:px-16">
<div class="flex flex-col gap-6">
<h1 class="font-display text-h3 font-black tracking-tight sm:text-h2">
{{ __('storefront.account.nav_wishlist') }}
</h1>
<p>
{{ __('storefront.wishlist.guest_hint') }}
<a href="{{ route('login') }}" class="font-bold underline hover:no-underline">{{ __('storefront.auth.login') }}</a>
</p>
</div>
@include('wishlist.list')
</section>
@endsection
+38
View File
@@ -0,0 +1,38 @@
{{--
The wishlist grid (or its empty state), shared by the account page
(account/wishlist) and the guest page (wishlist/guest). Expects $products
from WishlistController::products().
--}}
@if ($products->isEmpty())
<div class="flex max-w-2xl flex-col items-start gap-8">
<p>{{ __('storefront.wishlist.empty') }}</p>
<x-ui.button :href="route('products')" size="md">{{ __('storefront.orders.shop_now') }}</x-ui.button>
</div>
@else
<ul class="grid grid-cols-2 gap-9 md:grid-cols-3 2xl:grid-cols-4">
@foreach ($products as $product)
<li class="flex flex-col gap-4">
<x-ui.product-card
:name="$product['name']"
:price="$product['price']"
:image="$product['image']"
:href="$product['href']"
:variant-id="$product['variantId']"
:has-custom-fields="$product['hasCustomFields']"
:product-id="$product['id']"
:wishlist="true"
/>
{{-- Plain post (no fetch): the page reloads without the product. --}}
<form method="POST" action="{{ route('wishlist.toggle', ['productId' => $product['id']]) }}">
@csrf
<button
type="submit"
class="cursor-pointer text-sm underline hover:no-underline"
aria-label="{{ __('storefront.wishlist.remove_named', ['name' => $product['name']]) }}"
>{{ __('storefront.wishlist.remove_short') }}</button>
</form>
</li>
@endforeach
</ul>
@endif