PS PrestaShop Intermediate

AI Competitor — Competitor Price Monitoring

Install and configure AI-powered competitor price monitoring on PrestaShop 8 and 9.

Updated Module version 1.0.0

Overview

AI Competitor monitors your competitors’ prices straight from your PrestaShop back office. For each product in your catalog you declare one or more competitor URLs; the module visits them on a schedule, extracts the displayed price (with an AI fallback when classic methods fail), detects significant changes, alerts you by email, and suggests an adjusted price based on your pricing strategy.

Compatible with PrestaShop 8.0 to 9.x, PHP 7.4 to 8.3, native multistore. No Composer dependency.

Installation

  1. In your back office, open Modules → Module Manager → Upload a module.
  2. Upload the dfaicompetitor.zip file.
  3. The module installs and automatically creates its three tables (dfaicompetitor_url, dfaicompetitor_price, dfaicompetitor_alert) plus the Catalog → AI Competitor menu.

A unique cron token is generated on installation. You will find it on the module dashboard.

Initial configuration

Open Catalog → AI Competitor. The dashboard gathers the statistics and four configuration blocks.

AI provider

The AI fallback is optional but strongly recommended: it takes over when a competitor site exposes neither structured data nor a usable selector. Three providers are supported:

  • Mistral AI (default) — the cheapest, recommended model: mistral-small-latest
  • Anthropic Claude — best precision on complex pages, recommended model: claude-haiku-4-5-20251001
  • OpenAI — solid middle ground, recommended model: gpt-4o-mini

Enter the API key of the chosen provider. It is masked on display; leave the field empty on later saves to keep the stored key. You pay the provider directly, with no DataFirefly markup.

Alerts

  • Notification email — recipient of the alert digests and the weekly report.
  • Change threshold — percentage (3% by default). Below it, no alert is created.
  • Weekly report day — Monday by default.

Scraping

  • URLs per cron batch — number of URLs processed per run (20 by default).
  • Default interval — in hours, applied to new URLs (24h by default).
  • HTTP timeout and User-Agent — the shipped User-Agent is identifiable (DataFireflyBot); you may customize it.

Adjustment strategy

Three strategies determine the suggested price, always anchored to the cheapest competitor:

  • Match — same price as the lowest competitor.
  • Undercut by X% — X% below (default: 1%).
  • Premium at X% — X% above, for a deliberate up-market positioning.

Adding competitor URLs

Open Catalog → AI Competitor → Competitor URLs → Add. Each row binds one of your products to a competitor page:

  • Product — picked from your catalog.
  • Competitor name — free label (Amazon, eBay, any merchant site…).
  • URL — the full address of the competitor product page.
  • CSS selector (optional) — see below.
  • ISO currency — EUR by default.
  • Force AI extraction — bypasses the classic methods for this URL.
  • Interval — in hours, specific to this URL.

The Scrape button on each row triggers an immediate extraction — handy to validate a URL right after creating it.

How extraction works

For each URL, the module tries four methods in cascade and stops at the first one that succeeds:

  1. JSON-LD — Product/Offer structured data, present on the vast majority of e-commerce sites. Price, currency and availability are read directly, no configuration needed.
  2. OpenGraph — product price amount meta tags.
  3. CSS selector — if you provided one. The built-in converter handles classes, ids, attribute selectors and child combinators. Valid examples: .current-price, .price-box > .amount, span[itemprop=price].
  4. AI — a sanitized HTML excerpt is sent to your provider, which returns price, currency and stock state. International price formats are handled (1 299,90 — 1.234,56 — $49.99).

Always start without a CSS selector: JSON-LD is enough in most cases. Only add a selector or force AI when the Status column shows no_price.

Setting up the cron

Periodic scraping relies on a token-secured endpoint displayed on the dashboard. Schedule it every 30 minutes:

*/30 * * * * curl -s "https://your-shop.com/index.php?fc=module&module=dfaicompetitor&controller=cron&token=YOUR_TOKEN" > /dev/null

On each run, the cron: processes the batch of URLs whose interval has elapsed, sends pending alert emails, dispatches the weekly report on the configured day, and purges old data (snapshots > 180 days, alerts > 365 days). The response is a JSON summary.

The token can be regenerated at any time from the dashboard (existing cron jobs must then be updated). A manual trigger is also available via the Run cron now button.

Alerts

Five alert types are generated, each with a severity:

  • price_drop / price_rise — change beyond the threshold. A change ≥ 10% escalates to critical.
  • undercut — a competitor goes below your tax-inclusive selling price. Always critical.
  • out_of_stock / back_in_stock — availability transitions detected via structured data or AI.
  • scrape_error — only after 3 consecutive failures, eliminating noise from transient outages.

Alerts are batched into a single digest email per cron run, and browsable under Reports & Alerts with acknowledgement (“Acknowledge all”).

Weekly report

Every week, on the configured day, an HTML email summarizes: the most undercut products, the biggest competitor drops and rises, scraping health, and an AI-written executive summary that ranks the actions to take. A preview of the current report is available at any time under Reports & Alerts, with an immediate-send button.

Price suggestion

Under Reports & Alerts, select a monitored product: the module shows your current price, the competitor min/avg/max, the sources, and the suggested price based on your strategy. The Apply button writes the price to the PrestaShop product.

Application is never automatic — a deliberate choice to avoid mirror-down loops between competitors running the same kind of tool. Tax-inclusive → tax-exclusive conversion is handled automatically from the product’s tax rate.

Troubleshooting

Status “no_price”

None of the methods found a price. Check the URL in a browser, add a CSS selector targeting the price element, or enable “Force AI extraction” for this URL.

Status “error”

The page did not respond (HTTP ≥ 400 or timeout). Some sites block robots: customize the User-Agent in the configuration, raise the timeout, or widen the interval. An alert only fires on the 3rd consecutive failure.

AI extraction does not work

Check that the API key is valid and the model exists at your provider. AI call errors are logged under Advanced Parameters → Logs with the [dfaicompetitor] prefix.

Emails are not arriving

Test PrestaShop’s email configuration (Advanced Parameters → E-mail). The module uses the native mail system with its own FR/EN templates.

Good practice and compliance

  • Keep intervals wide (6 to 24h per URL is plenty for price monitoring) so you never hammer competitor servers.
  • Keep an identifiable User-Agent: it is the fair practice expected in competitive intelligence.
  • Reading publicly displayed prices is generally lawful in the EU and US, but you remain responsible for how you use the collected data.
Was this page helpful?

Still stuck? Contact support