A
Anonymous

Order Placement Form - Copy this React, Tailwind Component to your project

@extends('layouts.app') @section('content') <h1>Đặt hàng</h1> @if(session('error')) <div class="alert alert danger"> {{ session('error') }} </div> @endif @if(count($cartItems) > 0) <form action="{{ route('orders.store') }}" method="POST"> @csrf <table class="table"> <thead> <tr> <th>Tên sản phẩm</th> <th>Số lượng</th> <th>Giá</th> <th>Thành tiền</th> </tr> </thead> <tbody> @foreach ($cartItems as $id => $details) <tr> <td>{{ $details['name'] }}</td> <td>{{ $details['quantity'] }}</td> <td>{{ number_format($details['price'], 2) }}</td> <td>{{ number_format($details['price'] * $details['quantity'], 2) }}</td> </tr> @endforeach </tbody> </table> <button type="submit" class="btn btn primary">Xác nhận đặt hàng</button> </form> @else <p>Giỏ hàng của bạn trống.</p> @endif @endsection

Prompt
Component Preview

About

OrderPlacementForm - Seamlessly manage your cart with a responsive layout, error alerts, and order confirmation button, built with Rea. Get instant access!

Share

Last updated 1 month ago