=== Kraan Occasion Engine for Autotelex ===
Contributors: marcelkraan
Tags: autotelex, occasion, car dealer, hexon, vehicles, inventory
Requires at least: 5.8
Tested up to: 6.6
Stable tag: 2.9.51
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automate your inventory! Add Autotelex XML to display cars in a responsive grid, list or carousel with filters and SEO images.

== Description ==

The **Kraan Occasion Engine for Autotelex** is a powerful, lightweight plugin designed specifically for car dealerships using the Autotelex (Hexon) B2B platform. It receives your XML inventory feed in real-time and automatically generates beautiful, conversion-optimized vehicle pages on your WordPress website.

No monthly third-party iframe fees, just pure SEO-friendly HTML on your own domain.

### Key Features
* **Real-Time Sync:** Automatically imports, updates, and deletes vehicles via the Autotelex Webhook.
* **Smart Layouts:** Choose between Grids, Wide Lists, or Compact Lists using unlimited layout shortcodes.
* **Auto-Scrolling Carousel:** Display a dynamic vehicle carousel anywhere on your site using `[marcelkraan_occasion_carousel limit="15"]`.
* **Dynamic License Plates:** Automatically styles license plates into authentic EU/NL visual plates.
* **Energy Labels:** Dynamically renders the official European visual energy label badges based on the XML data.
* **"Keep Sold Cars" SEO Feature:** Choose to instantly delete sold cars, OR keep them on your site with a prominent "SOLD" badge to retain your Google search rankings.
* **Smart Contact Forms (Autofill):** Seamlessly integrates with Enfold forms. When a user clicks to request a test drive, the car details (License plate, subject, model) are instantly pre-filled in your form.
* **Smart Reservation Locks:** If a car is marked as "Reserved" or "Sold", the test-drive/contact links are automatically disabled and grayed out to prevent invalid inquiries.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/occasion-engine-for-autotelex` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to your WordPress User Profile and create an **Application Password** (name it 'Autotelex').
4. Navigate to **Occasions > API & Settings** to find your Webhook URL.
5. Log into your Autotelex Portal (https://eigenwebsite.dv.nl/).
6. Enter your Webhook URL, your WordPress username, and your new Application Password in the export settings.
7. Create your desired Layout in the plugin settings and paste the generated Shortcode on your pages!

== Frequently Asked Questions ==

= Why are my vehicle images not showing? =
Ensure your website has a valid SSL (HTTPS). The plugin downloads the primary featured image to your media library for SEO purposes, and loads the gallery images directly from the Autotelex CDN to save your server disk space. 

= How do I add the Auto-Carousel? =
Simply paste `[marcelkraan_occasion_carousel limit="15"]` on your homepage or footer. You can change the "15" to any number of cars you want to display.

= The form autofill isn't working? =
Ensure your contact form has field labels that include the words "Auto", "Onderwerp", or "Kenteken". The plugin uses these labels to inject the correct vehicle data.

== Changelog ==

= 2.9.51 =
* Feature: Added logic to automatically gray out and disable test drive / contact buttons for vehicles marked as "Sold" or "Reserved".
* Tweak: Improved CSS styling for unavailable vehicle links.

= 2.9.50 =
* Fix: Prevented broken images on the frontend. When Autotelex sends a hard `actie="delete"` command, the vehicle is now always removed from the database to prevent loading dead CDN image links.

= 2.9.49 =
* Feature: Complete overhaul of the API & Settings dashboard with a modern, tabbed UI.
* Feature: Added the "Keep Sold Cars" SEO setting. Choose to retain sold cars with a custom badge instead of deleting them.
* Feature: Added visual European Energy Label badges to the occasion list and grid views.
* Feature: Added Background Image uploader for single vehicle pages.
* Tweak: Shortened the plugin short description to meet WordPress.org directory guidelines.

= 2.9.31 =
* Initial public release optimizations and layout restructuring.

== Upgrade Notice ==

= 2.9.51 =
Crucial update for dealers: Prevents visitors from requesting test drives on vehicles that are already sold or reserved.

