Ecommerce Components

Jump to:

Multi-step Checkout

Cart, shipping, payment, and review with a promo code and a running total.

1. Cart
2. Shipping
3. Payment
4. Review

Cart

  • Pro component pack × 1 $79
  • Priority updates × 1 $29

Code
Please login to View/Download the Code

Sorry, this component's code is restricted
Sorry, this component's code is restricted

A four-step checkout you can hand to a Laravel app. Validate shipping before payment, keep the summary beside the form, and replace placeOrder with Stripe, Paddle, or Lemon Squeezy.

Pricing Table

Three tiers with a monthly/yearly toggle and a highlighted plan.

Monthly Yearly save 20%

Starter

For a single side project.

$15/mo

Billed yearly

  • ✓ 20 components
  • ✓ Personal license
  • ✓ Community support

Most popular

Pro

The pack most Laravel teams buy.

$39/mo

Billed yearly

  • ✓ Full component library
  • ✓ Commercial license
  • ✓ New components each month
  • ✓ Source zips

Team

Shared seats for a product squad.

$79/mo

Billed yearly

  • ✓ Everything in Pro
  • ✓ 5 seats
  • ✓ Priority email
  • ✓ Private Slack

Code
Please login to View/Download the Code

Sorry, this component's code is restricted
Sorry, this component's code is restricted

The pricing block SaaS landing pages ask for. Yearly prices are the monthly equivalent, and the selected plan is a Livewire action you can turn into a checkout.

Shopping Cart Component using Laravel Livewire

Shopping Cart Component using Laravel Livewire

UI Stack: Tailwind CSS, Livewire

Add Product to Cart

Shopping Cart

Items in your shopping cart

  • Your cart is empty

Order summary

Subtotal
$0.00
Shipping
$5.00
Tax
$0.00
Order total
$5.00

Code

Sorry, this component's code is restricted
Sorry, this component's code is restricted
Sorry, this component's code is restricted
Sorry, this component's code is restricted
Sorry, this component's code is restricted
Sorry, this component's code is restricted

1. Run the migration to create the cart_items table:

php artisan migrate

2. Copy the component files:

  • Copy ShoppingCart.php to your app/Livewire directory
  • Copy shopping-cart.blade.php to your resources/views/livewire directory
  • Copy CartItem.php to your app/Models directory

Integration

To integrate this component into your Laravel project, use the following Livewire directive:

@livewire('shopping-cart')

For testing purposes, you can also include the test component:

@livewire('add-to-cart-test')

Usage Instructions

The shopping cart automatically manages items based on the user's session. Users can:

  • Update item quantities using the dropdown selector
  • Remove items using the X button
  • View real-time price calculations
  • Proceed to checkout when ready

Configuration Options

The component includes several configurable options:

public $shipping = 5.00;    // Default shipping cost
private $taxRate = 0.08;    // Tax rate (8% by default)

Customization Possibilities

The component can be customized in several ways:

1. Tax Calculation:

private function calculateTotals()
{
    $this->tax = round($this->subtotal * $this->taxRate, 2);
}

2. Checkout Process:

public function checkout()
{
    // Add your custom checkout logic here
    $this->dispatch('checkout-initiated', [
        'total' => $this->total,
        'items' => $this->cartItems->count()
    ]);
}

3. Session Management:

public function mount()
{
    $this->sessionId = session()->get('cart_session_id', Str::random(32));
    session()->put('cart_session_id', $this->sessionId);
}

Additional Features

  • Real-time quantity updates
  • Dynamic price calculations
  • Tax and shipping handling
  • Session-based cart management
  • Support for guest and authenticated users
  • Responsive design with Tailwind CSS

Requirements

  • Laravel 10.x or higher
  • Livewire 3.x
  • Alpine.js
  • Tailwind CSS

Ecommerce Product Filter using Livewire and TailwindCSS

UI Stack: Tailwind CSS, Alpine JS, Livewire

Filters

Filters , active

Code

Sorry, this component's code is restricted
Sorry, this component's code is restricted
Sorry, this component's code is restricted
Sorry, this component's code is restricted
Sorry, this component's code is restricted
Sorry, this component's code is restricted

Usage


        @livewire('tailwind-product-filter')
    

Components on this page

4 components