Files
Additional/storage/framework/views/963a42c38bd8e0fdfe0b4e765ea9f100.php
T
twotalesanimation b8cc8bd421 feat: Add Google Places autocomplete for address search
- Add address search input field with autocomplete
- Integrate Google Places API to provide address suggestions
- Parse selected address components and auto-populate form fields
- Address fields initially hidden, show when address is selected
- Add clear button to reset address selection
- Support South Africa locations with country restriction
- Add Google Places API key config to services.php
- Hide/show address fields based on selection and validation errors
2026-01-03 00:15:30 +02:00

324 lines
13 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php $__env->startSection('title', 'Checkout - Additional Design'); ?>
<?php $__env->startSection('styles'); ?>
<style>
h1 {
font-family: 'Abril Fatface', cursive;
font-size: 2.5rem;
color: var(--primary-color);
margin-bottom: 2rem;
}
.checkout-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 3rem;
margin: 2rem 0 3rem 0;
}
.checkout-form,
.order-summary {
border-radius: 20px;
}
.checkout-form h2,
.order-summary h2 {
font-family: 'Abril Fatface', cursive;
font-size: 1.5rem;
color: var(--primary-color);
margin-bottom: 1.5rem;
}
.form-group {
margin-bottom: 1.5rem;
}
.form-group label {
display: block;
font-weight: 600;
margin-bottom: 0.5rem;
color: var(--primary-color);
}
.form-group input,
.form-group textarea {
width: 100%;
padding: 0.75rem;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 1rem;
font-family: inherit;
}
.form-group textarea {
resize: vertical;
min-height: 100px;
}
.form-group input:focus,
.form-group textarea:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(45, 80, 71, 0.1);
}
.order-summary {
height: fit-content;
}
.order-item {
padding: 1rem 0;
border-bottom: 1px solid #eee;
}
.order-item:last-child {
border-bottom: none;
}
.order-item-name {
font-weight: 600;
margin-bottom: 0.25rem;
}
.order-item-details {
font-size: 0.85rem;
color: #666;
margin-bottom: 0.5rem;
}
.order-item-price {
text-align: right;
font-weight: 600;
color: var(--primary-color);
}
.summary-row {
display: flex;
justify-content: space-between;
padding: 1rem 0;
border-bottom: 1px solid #eee;
}
.summary-row.total {
font-weight: 600;
font-size: 1.2rem;
color: var(--primary-color);
border-top: 2px solid var(--primary-color);
border-bottom: none;
padding-top: 1.5rem;
margin-top: 1rem;
}
.btn-submit {
width: 100%;
margin-top: 2rem;
padding: 1rem;
background-color: var(--primary-color);
color: white;
border: none;
border-radius: 4px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: var(--transition);
}
.btn-submit:hover {
background-color: #1f3633;
}
.alert {
padding: 1rem;
border-radius: 4px;
margin-bottom: 2rem;
}
.alert-error {
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.info-box {
background: var(--section-light-bg);
padding: 1rem;
border-radius: 4px;
margin-bottom: 1.5rem;
font-size: 0.9rem;
color: #666;
}
.back-link {
display: block;
text-align: center;
margin-top: 1.5rem;
color: var(--primary-color);
text-decoration: none;
}
.back-link:hover {
text-decoration: underline;
}
@media (max-width: 768px) {
.checkout-container {
grid-template-columns: 1fr;
gap: 2rem;
}
h1 {
font-size: 1.8rem;
}
}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="container">
<h1>Checkout</h1>
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($errors->any()): ?>
<div class="alert alert-error">
<ul style="margin: 0; padding-left: 1.5rem;">
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li><?php echo e($error); ?></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
</ul>
</div>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
<div class="checkout-container">
<!-- Checkout Form -->
<form action="<?php echo e(route('order-process')); ?>" method="POST" class="checkout-form card">
<?php echo csrf_field(); ?>
<h2>Delivery Information</h2>
<div class="form-group">
<label for="customer_name">Full Name</label>
<input type="text" id="customer_name" name="customer_name" value="<?php echo e(old('customer_name')); ?>" required>
</div>
<div class="form-group">
<label for="customer_email">Email Address</label>
<input type="email" id="customer_email" name="customer_email" value="<?php echo e(old('customer_email')); ?>" required>
</div>
<div class="form-group">
<label for="customer_phone">Phone Number</label>
<input type="tel" id="customer_phone" name="customer_phone" value="<?php echo e(old('customer_phone')); ?>" required>
</div>
<div class="form-group">
<label for="shipping_street_address">Street Address</label>
<input type="text" id="shipping_street_address" name="shipping_street_address" placeholder="e.g., 123 Main Street" value="<?php echo e(old('shipping_street_address')); ?>" required>
</div>
<div class="form-group">
<label for="shipping_local_area">Suburb/Local Area</label>
<input type="text" id="shipping_local_area" name="shipping_local_area" placeholder="e.g., Menlyn" value="<?php echo e(old('shipping_local_area')); ?>" required>
</div>
<div class="form-group">
<label for="shipping_city">City</label>
<input type="text" id="shipping_city" name="shipping_city" placeholder="e.g., Pretoria" value="<?php echo e(old('shipping_city')); ?>" required>
</div>
<div class="form-group">
<label for="shipping_zone">Province/Zone</label>
<input type="text" id="shipping_zone" name="shipping_zone" placeholder="e.g., Gauteng" value="<?php echo e(old('shipping_zone')); ?>" required>
</div>
<div class="form-group">
<label for="shipping_postcode">Postal Code</label>
<input type="text" id="shipping_postcode" name="shipping_postcode" placeholder="e.g., 0181" value="<?php echo e(old('shipping_postcode')); ?>" required>
</div>
<div class="form-group">
<label for="shipping_country">Country</label>
<input type="text" id="shipping_country" name="shipping_country" value="ZA" readonly>
</div>
<div class="form-group">
<label for="shipping_type">Address Type</label>
<select id="shipping_type" name="shipping_type" required>
<option value="residential" <?php echo e(old('shipping_type') === 'residential' ? 'selected' : ''); ?>>Residential</option>
<option value="business" <?php echo e(old('shipping_type') === 'business' ? 'selected' : ''); ?>>Business</option>
</select>
</div>
<div class="form-group">
<label for="notes">Order Notes (Optional)</label>
<textarea id="notes" name="notes" placeholder="Any special instructions or notes for your order..."><?php echo e(old('notes')); ?></textarea>
</div>
<div class="info-box">
<strong>Note:</strong> Payment will be processed securely through Yoco. You'll be redirected to complete your card payment after confirming this order.
</div>
<button type="submit" class="btn">Complete Order & Proceed to Payment</button>
</form>
<!-- Order Summary -->
<div class="order-summary card">
<h2>Order Summary</h2>
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="order-item">
<div class="order-item-name"><?php echo e($item['product']->name); ?><?php echo e($item['is_sample'] ? ' - Sample' : ''); ?></div>
<?php
$stockCost = 0;
$stockUnit = $item['type'] === 'wallpaper' ? '/m' : '/m²';
if (!$item['is_sample'] && $item['stock']) {
$stockCost = $item['type'] === 'wallpaper' ? $item['stock']->cost_per_meter : $item['stock']->cost_per_m2;
}
?>
<div class="order-item-details">
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($item['is_sample']): ?>
<strong>Sample - Fixed Price:</strong> R<?php echo e(number_format(\App\Services\ShippingService::getSampleCost(), 2)); ?><br>
<?php elseif($item['stock']): ?>
<strong><?php echo e($item['stock']->name); ?>:</strong> R<?php echo e(number_format($stockCost, 2)); ?><?php echo e($stockUnit); ?><br>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!$item['is_sample']): ?>
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($item['type'] === 'wallpaper'): ?>
<strong>Length:</strong> <?php echo e($item['length']); ?>m
<?php elseif($item['type'] === 'mural'): ?>
<strong>Dimensions:</strong> <?php echo e($item['width']); ?>m × <?php echo e($item['height']); ?>m (<?php echo e(number_format($item['width'] * $item['height'], 2)); ?>m²)
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($item['quantity'] > 1): ?>
<br><strong>Quantity:</strong> <?php echo e($item['quantity']); ?>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
</div>
<div class="order-item-price">R<?php echo e(number_format($item['subtotal'], 2)); ?></div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
<div class="summary-row">
<span>Subtotal:</span>
<span>R<?php echo e(number_format($total, 2)); ?></span>
</div>
<div class="summary-row">
<span><?php echo e($shippingLabel); ?>:</span>
<span>R<?php echo e(number_format($shippingFee, 2)); ?></span>
</div>
<div class="summary-row total">
<span>Total:</span>
<span>R<?php echo e(number_format($grandTotal, 2)); ?></span>
</div>
<a href="<?php echo e(route('cart')); ?>" class="back-link">← Back to Cart</a>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/additional_design/resources/views/checkout.blade.php ENDPATH**/ ?>