Files
ladill-merchant/resources/views/merchant/storefronts/partials/payment-shipping.blade.php
T
isaaccladandClaude Opus 4.8 8b68fad82c
Deploy Ladill Merchant / deploy (push) Successful in 1m1s
Build real shop/menu/booking storefronts (replace church giving UI).
The storefront create/edit/manage UI and the public storefront page were
give's church-donation flow relabeled. Replace with genuine merchant
storefronts, reusing the QR-core manager + validator (which already build
sections/services content):

- Merchant create: type picker (shop/menu/booking) + per-type editors in a
  shared partial (products/menu items with prices; bookable services with
  days/hours). x-if per type so inputs never collide across types.
- StorefrontController store/update/create now delegate to QrCodeManagerService
  for all three types (was hardcoded church org_type/denomination/collection).
- Storefront show = QR preview + download + live toggle + delete + full editor.
- QrCodeManagerService: shop/menu/booking are free (no QR-wallet gate); drop
  the duplicate church TYPE_SHOP arm in hasContentChanges.
- Public: new storefront catalog+cart view for shop/menu (posts items[] to the
  existing order/Pay flow); route shop+menu to it. Booking already had a real
  public page; church TYPE_SHOP landing branch retired.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:24:39 +00:00

49 lines
3.1 KiB
PHP

@php
$content = $content ?? [];
$noun = $noun ?? 'items';
$word = $word ?? 'shipping';
$hasFlat = old('shipping_type', $content['shipping_type'] ?? 'none') === 'flat';
@endphp
<label class="mb-4 flex cursor-pointer items-center justify-between rounded-xl border border-slate-200 bg-white px-4 py-3 shadow-sm">
<div>
<p class="text-sm font-semibold text-slate-900">Accept payments</p>
<p class="mt-0.5 text-xs text-slate-500">Customers can add {{ $noun }} to cart and pay online. Leave off for a display-only page.</p>
</div>
<div class="relative ml-4 shrink-0">
<input type="hidden" name="accepts_payment" value="0">
<input type="checkbox" name="accepts_payment" value="1" class="sr-only peer" @checked(old('accepts_payment', $content['accepts_payment'] ?? false))>
<div class="h-6 w-11 rounded-full bg-slate-200 transition-colors duration-200 peer-checked:bg-indigo-600"></div>
<div class="absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white shadow transition-transform duration-200 peer-checked:translate-x-5"></div>
</div>
</label>
<div x-data="{ hasFee: {{ $hasFlat ? 'true' : 'false' }} }" class="mb-4 overflow-hidden rounded-xl border border-slate-200 bg-white">
<label class="flex cursor-pointer items-center justify-between px-4 py-3">
<div>
<p class="text-sm font-semibold text-slate-900">Charge for {{ $word }}</p>
<p class="mt-0.5 text-xs text-slate-500">Add a flat {{ $word }} fee to customer orders.</p>
</div>
<div class="relative ml-4 shrink-0">
<input type="checkbox" x-model="hasFee" class="sr-only peer">
<div class="h-6 w-11 rounded-full bg-slate-200 transition-colors duration-200 peer-checked:bg-indigo-600"></div>
<div class="absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white shadow transition-transform duration-200 peer-checked:translate-x-5"></div>
</div>
</label>
<input type="hidden" name="shipping_type" :value="hasFee ? 'flat' : 'none'">
<div x-show="hasFee" x-cloak class="border-t border-slate-100 px-4 pb-4 pt-3 space-y-3">
<div>
<label class="block text-[11px] font-medium text-slate-500">Flat {{ $word }} fee</label>
<input type="number" name="shipping_fee" value="{{ old('shipping_fee', $content['shipping_fee'] ?? '0') }}"
min="0" step="0.01" placeholder="e.g. 15.00"
class="mt-1 w-full rounded-xl border border-slate-200 px-3.5 py-2.5 text-sm">
</div>
<div>
<label class="block text-[11px] font-medium text-slate-500">Free {{ $word }} above <span class="font-normal text-slate-400">(optional)</span></label>
<input type="number" name="free_shipping_above" value="{{ old('free_shipping_above', $content['free_shipping_above'] ?? '0') }}"
min="0" step="0.01" placeholder="e.g. 200.00"
class="mt-1 w-full rounded-xl border border-slate-200 px-3.5 py-2.5 text-sm">
<p class="mt-1 text-[10px] text-slate-400">Waive the fee when the cart reaches this amount. Enter 0 to always charge.</p>
</div>
</div>
</div>