Vehicle Comparison

Introduction

When comparison is enabled, visitors can add up to 3 vehicles to a comparison list (persisted in localStorage) and view them side by side in a modal. The comparison shows key specifications — price and VAT, registration date and mileage, power and engine, transmission and fuel type, and additional specs.

Enabling Comparison

<div
  data-carpose-component="vehicle-search-form"
  data-api-key="your-api-key"
  data-compare="true"
></div>

Behavior

  • Adds a ComparisonButton to cards/detail pages, an overlay ComparisonIconButton on thumbnails, and a ComparisonFloatingButton to the UI

  • Comparison state persists across sessions via localStorage

  • Responsive layout: 1 vehicle (full width), 2 vehicles (50/50), 3 vehicles (equal thirds); mobile uses a horizontal scroll view

  • A warning is shown when trying to add more than 3 vehicles

Notes

Last updated