Magento 2 ChatGPT Product Review SummaryMagento 2 ChatGPT Product Review Summary
Buy Now
Support
Buy Now
Support
  • Getting Started

    • Introduction
    • Key Features
    • How It Works
  • Installation

    • Requirements
    • Install the Module
    • Install the AI Packages
    • Enable & Compile
    • Verify the Installation
  • Setup

    • Enable the Module
    • Activate Your Licence
    • Select an LLM Provider
    • Validate & Load Models
    • First Summaries
  • Configuration

    • Overview
    • General Settings
    • Scope & Store Views
    • Admin Menu
    • Access Control
  • LLM Providers

    • Provider Overview
    • How Validation Works
    • Ollama (Self-Hosted)
    • Switching Providers
  • Generating Summaries

    • Summary Basics
    • What Is Sent to the Model
    • From the Reviews Grid
    • CLI Command
    • Keeping Summaries Fresh
  • Storefront

    • On the Product Page
    • Full-Width Layout
    • Styling
  • Developers

    • Data Model
    • Useful SQL
    • Logging
  • Help

    • Setup Problems
    • Generation Problems
    • Storefront Problems
    • FAQ

Useful SQL

Add your table prefix if you use one.

See every summary

SELECT s.product_id, p.sku, s.store_id, LEFT(s.ai_review_summary, 80) AS summary
FROM wk_ai_review_summary_list s
LEFT JOIN catalog_product_entity p ON p.entity_id = s.product_id
ORDER BY s.product_id, s.store_id;

Summary for one product

SELECT store_id, ai_review_summary
FROM wk_ai_review_summary_list
WHERE product_id = 42;

Products with approved reviews but no summary

SELECT DISTINCT r.entity_pk_value AS product_id, rs.store_id
FROM review r
JOIN review_store rs ON rs.review_id = r.review_id
LEFT JOIN wk_ai_review_summary_list s
       ON s.product_id = r.entity_pk_value AND s.store_id = rs.store_id
WHERE r.status_id = 1
  AND rs.store_id <> 0
  AND s.entity_id IS NULL;

Orphan rows (product no longer exists)

SELECT s.*
FROM wk_ai_review_summary_list s
LEFT JOIN catalog_product_entity p ON p.entity_id = s.product_id
WHERE p.entity_id IS NULL;

Remove one summary

DELETE FROM wk_ai_review_summary_list
WHERE product_id = 42 AND store_id = 1;

Back up first

Run DELETE statements on a backup or staging copy first. Flush the full-page cache afterwards so the storefront stops showing the removed summary.

Next: Logging.

Prev
Data Model
Next
Logging