update reamde
This commit is contained in:
219
README.md
219
README.md
@@ -1,114 +1,185 @@
|
|||||||
# PrestaShop Product Link Checker Module
|
Of course. Here is a comprehensive `README.md` file for your module. It explains the purpose, features, and usage, with a special focus on the intended use case of feeding data into AI models and external tools.
|
||||||
> A PrestaShop module developed by **panariga**.
|
|
||||||
|
|
||||||

|
---
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
A simple, secure, and powerful PrestaShop module designed to generate a comprehensive JSON list of all product URLs. It's the perfect tool for developers and QA testers who need to perform automated checks, SEO audits, or verify that all product pages are accessible and return a `200 OK` status.
|
# Product Link Checker for PrestaShop
|
||||||
|
|
||||||
## Features
|

|
||||||
|

|
||||||
|
|
||||||
- **JSON Output**: Generates a clean, machine-readable JSON array of product links.
|
A PrestaShop module that provides secure, configurable JSON endpoints to export detailed product and category data. It is designed to act as a data bridge between your store and external services, such as SEO audit tools, data analysis platforms, and AI models for large-scale content generation and optimization.
|
||||||
- **Includes Combinations**: Lists URLs for both base products and all their attribute combinations.
|
|
||||||
- **Multi-Shop Support**: Works seamlessly in a multi-store environment.
|
|
||||||
- **Multi-Language Support**: Generates links for all installed languages.
|
|
||||||
- **Secure Access**: The endpoint is protected by a unique, auto-generated security token to prevent unauthorized access.
|
|
||||||
- **Filtering**: Easily filter the results by a specific shop (`plc_id_shop`) or language (`plc_id_lang`).
|
|
||||||
- **User-Friendly Configuration**: The module configuration page displays the security token and provides a list of ready-to-use links for quick access.
|
|
||||||
|
|
||||||
## Compatibility
|
## The Problem It Solves
|
||||||
|
|
||||||
- **PrestaShop Version**: 1.7.6 or newer.
|
Managing and optimizing a large e-commerce catalog is a monumental task. Manually checking thousands of product links, meta descriptions, or product identifiers is inefficient and prone to error. This module provides a programmatic way to extract this data, enabling powerful, automated workflows.
|
||||||
|
|
||||||
|
**Primary Use Cases:**
|
||||||
|
|
||||||
|
* **AI-Powered Content Generation:** Export product data (name, attributes, short description) in JSON format and feed it into AI models like GPT-4 to automatically generate unique, high-quality long descriptions or meta tags at scale.
|
||||||
|
* **Batch SEO Audits:** Pull a complete list of all product and category URLs, along with their meta titles and descriptions, to quickly identify missing or non-optimized SEO data using external scripts or tools.
|
||||||
|
* **Data Integrity Checks:** Systematically audit product identifiers (EAN, MPN, UPC, Reference) across the entire catalog, including all combinations, to ensure consistency and accuracy for marketplace feeds.
|
||||||
|
* **Third-Party Integration:** Provide a live, filterable data feed for external services, custom-built dashboards, or internal stock management tools.
|
||||||
|
|
||||||
|
## Key Features
|
||||||
|
|
||||||
|
* **Secure JSON Endpoints:** Access is protected by a unique 32-character security token, preventing unauthorized access to your store data.
|
||||||
|
* **Separate Product & Category Data:** Dedicated controllers for `products` and `categories` provide clean, focused data sets.
|
||||||
|
* **Interactive URL Builder:** A user-friendly back-office interface allows you to visually build the exact API URL you need without writing any code.
|
||||||
|
* **Granular Data Selection:** Choose exactly which data fields to include in the JSON output (e.g., name, description, meta tags, identifiers) to keep the payload minimal and efficient.
|
||||||
|
* **Multi-Store & Multi-Language Support:** Filter data by a specific shop or language, or pull data for all of them at once.
|
||||||
|
* **Handles Product Combinations:** The product endpoint correctly exports each product attribute combination as a unique item, complete with its own URL, reference, EAN, and other details.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
You can install the module using one of two methods:
|
1. Download the `productlinkchecker.zip` file.
|
||||||
|
2. Navigate to your PrestaShop Back Office.
|
||||||
#### Method 1: Using the PrestaShop Module Manager (Recommended)
|
3. Go to **Modules > Module Manager**.
|
||||||
|
|
||||||
1. Download the latest release as a `.zip` file from the repository.
|
|
||||||
2. Log in to your PrestaShop Back Office.
|
|
||||||
3. Navigate to **Modules > Module Manager**.
|
|
||||||
4. Click the **"Upload a module"** button.
|
4. Click the **"Upload a module"** button.
|
||||||
5. Drag and drop the downloaded `.zip` file into the upload area.
|
5. Drag & drop or select the downloaded ZIP file to install the module.
|
||||||
6. The module will be installed automatically. Find "Product Link Checker" in your module list and click **Install**.
|
6. Once installed, click the **"Configure"** button.
|
||||||
|
|
||||||
#### Method 2: Manual Installation
|
## Configuration & Usage
|
||||||
|
|
||||||
1. Download and unzip the latest release.
|
The module's configuration page is an interactive URL generator.
|
||||||
2. Rename the folder to `productlinkchecker`.
|
|
||||||
3. Upload the `productlinkchecker` folder to the `modules/` directory of your PrestaShop installation.
|
|
||||||
4. In your PrestaShop Back Office, navigate to **Modules > Module Manager**.
|
|
||||||
5. Find "Product Link Checker" in your module list and click **Install**.
|
|
||||||
|
|
||||||
## Configuration
|
1. **Find Your Security Token:** The first thing you'll see is your unique security token. You will need this for every request.
|
||||||
|
2. **Select an Endpoint:** Choose between the **Product Links** and **Category Links** tabs.
|
||||||
|
3. **Apply Filters (Step 1):**
|
||||||
|
* **Shop:** Select a specific shop or leave as "All Shops".
|
||||||
|
* **Language:** Select a specific language or leave as "All Languages".
|
||||||
|
* **Status:** Choose to export only "Active" items or "All" items.
|
||||||
|
4. **Select Data Fields (Step 2):**
|
||||||
|
* Check the boxes for each piece of data you want to include in the JSON response (e.g., `name`, `meta_description`, `ean13`).
|
||||||
|
5. **Get Your URL (Step 3):**
|
||||||
|
* The **Generated URL** is updated in real-time as you change your selections.
|
||||||
|
* Use the **Copy** button to copy the URL to your clipboard.
|
||||||
|
* Use the **Open** button to view the JSON output directly in your browser.
|
||||||
|
|
||||||
After installing the module, click the **"Configure"** button.
|
|
||||||
|
|
||||||
The configuration page provides two key pieces of information:
|
|
||||||
|
|
||||||
1. **Your Security Token**: A unique 32-character string that must be included in every request to the generator endpoint.
|
## API Endpoints & Data Structure
|
||||||
2. **Available URLs**: A list of pre-built URLs for all shops and languages, making it easy to copy the link you need for your tests.
|
|
||||||
|
|
||||||
|
### Authentication
|
||||||
*(Optional: Replace this with a link to a screenshot of your module's configuration page)*
|
|
||||||
|
|
||||||
## Usage: The `generate` Endpoint
|
All requests must include the security token as a query parameter: `?token=YOUR_SECRET_TOKEN`.
|
||||||
|
|
||||||
The module exposes a single front controller endpoint to generate the links.
|
### Base URLs
|
||||||
|
|
||||||
**Base URL:** `https://your-prestashop-url/module/productlinkchecker/generate`
|
* **Products:** `https://yourshop.com/module/productlinkchecker/product`
|
||||||
|
* **Categories:** `https://yourshop.com/module/productlinkchecker/category`
|
||||||
|
|
||||||
### Parameters
|
### Available Parameters
|
||||||
|
|
||||||
- `token` (string, **required**): Your unique security token found on the module's configuration page.
|
| Parameter | Description | Example |
|
||||||
- `plc_id_shop` (integer, *optional*): The ID of a specific shop. If omitted, the module will scan all active shops.
|
| -------------------------- | --------------------------------------------------------------------------- | ----------------------------- |
|
||||||
- `plc_id_lang` (integer, *optional*): The ID of a specific language. If omitted, the module will scan all active languages for the selected shop(s).
|
| `token` | **(Required)** Your unique security token. | `...&token=a1b2c3d4e5f6...` |
|
||||||
|
| `plc_id_shop` | Filter by a specific shop ID. If omitted, all shops are included. | `...&plc_id_shop=1` |
|
||||||
|
| `plc_id_lang` | Filter by a specific language ID. If omitted, all languages are included. | `...&plc_id_lang=2` |
|
||||||
|
| `plc_only_active` | Set to `1` to only include active products/categories. | `...&plc_only_active=1` |
|
||||||
|
| `plc_name` | Set to `1` to include the `name` field in the response. | `...&plc_name=1` |
|
||||||
|
| `plc_link_rewrite` | Set to `1` to include the `link_rewrite` field. | `...&plc_link_rewrite=1` |
|
||||||
|
| `plc_description` | Set to `1` to include the `description` field. | `...&plc_description=1` |
|
||||||
|
| `plc_meta_title` | Set to `1` to include the `meta_title` field. | `...&plc_meta_title=1` |
|
||||||
|
| `plc_meta_description` | Set to `1` to include the `meta_description` field. | `...&plc_meta_description=1` |
|
||||||
|
| **Product Only Parameters**| | |
|
||||||
|
| `plc_description_short` | Set to `1` to include the `description_short` field. | `...&plc_description_short=1` |
|
||||||
|
| `plc_reference` | Set to `1` to include the `reference` (SKU). | `...&plc_reference=1` |
|
||||||
|
| `plc_ean13` | Set to `1` to include the `ean13` barcode. | `...&plc_ean13=1` |
|
||||||
|
| `plc_upc` | Set to `1` to include the `upc` barcode. | `...&plc_upc=1` |
|
||||||
|
| `plc_mpn` | Set to `1` to include the `mpn` (Manufacturer Part Number). | `...&plc_mpn=1` |
|
||||||
|
| **Category Only Parameters**| | |
|
||||||
|
|`plc_additional_description`| Set to `1` to include the `additional_description` field. | `...&plc_additional_description=1` |
|
||||||
|
|
||||||
### Examples
|
---
|
||||||
|
|
||||||
#### 1. Get all links for all shops and all languages
|
### Sample JSON Output
|
||||||
```
|
|
||||||
https://your-prestashop-url/module/productlinkchecker/generate?token=YOUR_SECRET_TOKEN
|
#### Product with Combinations
|
||||||
|
|
||||||
|
**URL:** `.../product?token=...&plc_name=1&plc_reference=1`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"1_1": {
|
||||||
|
"id_lang": 1,
|
||||||
|
"id_shop": 1,
|
||||||
|
"id_product": 1,
|
||||||
|
"id_product_attribute": 1,
|
||||||
|
"active": true,
|
||||||
|
"link": "http://yourshop.com/en/men/1-1-hummingbird-printed-t-shirt.html#/1-size-s/8-color-white",
|
||||||
|
"name": "Hummingbird printed t-shirt",
|
||||||
|
"reference": "demo_1",
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"group_name": "Size",
|
||||||
|
"attribute_name": "S"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group_name": "Color",
|
||||||
|
"attribute_name": "White"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1_2": {
|
||||||
|
"id_lang": 1,
|
||||||
|
"id_shop": 1,
|
||||||
|
"id_product": 1,
|
||||||
|
"id_product_attribute": 2,
|
||||||
|
"active": true,
|
||||||
|
"link": "http://yourshop.com/en/men/1-2-hummingbird-printed-t-shirt.html#/2-size-m/8-color-white",
|
||||||
|
"name": "Hummingbird printed t-shirt",
|
||||||
|
"reference": "demo_1_m",
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"group_name": "Size",
|
||||||
|
"attribute_name": "M"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group_name": "Color",
|
||||||
|
"attribute_name": "White"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 2. Get all links for a specific shop (e.g., Shop ID 1)
|
#### Category
|
||||||
```
|
|
||||||
https://your-prestashop-url/module/productlinkchecker/generate?token=YOUR_SECRET_TOKEN&plc_id_shop=1
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 3. Get all links for a specific shop (ID 1) and a specific language (e.g., English, ID 2)
|
**URL:** `.../category?token=...&plc_name=1&plc_meta_title=1`
|
||||||
```
|
|
||||||
https://your-prestashop-url/module/productlinkchecker/generate?token=YOUR_SECRET_TOKEN&plc_id_shop=1&plc_id_lang=2
|
|
||||||
```
|
|
||||||
|
|
||||||
### Example Output
|
|
||||||
|
|
||||||
The endpoint will return a JSON array of strings, where each string is a complete, friendly URL.
|
|
||||||
|
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
"https://your-prestashop-url/en/men/1-hummingbird-printed-t-shirt.html",
|
{
|
||||||
"https://your-prestashop-url/en/men/1-1-hummingbird-printed-t-shirt.html#/1-size-s/8-color-white",
|
"id_lang": "1",
|
||||||
"https://your-prestashop-url/en/men/1-2-hummingbird-printed-t-shirt.html#/2-size-m/11-color-black",
|
"id_shop": "1",
|
||||||
"https://your-prestashop-url/fr/hommes/1-tee-shirt-imprime-colibri.html",
|
"id_category": "3",
|
||||||
"https://your-prestashop-url/fr/hommes/1-1-tee-shirt-imprime-colibri.html#/1-taille-s/8-couleur-blanc",
|
"id_parent": "2",
|
||||||
"https://your-prestashop-url/fr/hommes/1-2-tee-shirt-imprime-colibri.html#/2-taille-m/11-couleur-noir",
|
"active": "1",
|
||||||
...
|
"name": "Men",
|
||||||
|
"meta_title": "Men"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id_lang": "1",
|
||||||
|
"id_shop": "1",
|
||||||
|
"id_category": "4",
|
||||||
|
"id_parent": "2",
|
||||||
|
"active": "1",
|
||||||
|
"name": "Women",
|
||||||
|
"meta_title": "Women"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
## ⚠️ Security
|
## Security
|
||||||
|
|
||||||
The security token is the only thing preventing public access to this endpoint. **Keep it secret.** If you believe your token has been compromised, you can uninstall and reinstall the module to generate a new one.
|
The endpoint is protected by a 32-character security token which is automatically generated upon installation. This token is required for all API requests.
|
||||||
|
|
||||||
|
**Important:** Treat this token like a password. Do not share it publicly or commit it to public code repositories. If you believe your token has been compromised, you can uninstall and reinstall the module to generate a new one.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This module is released under the [Academic Free License (AFL 3.0)](http://opensource.org/licenses/afl-3.0.php).
|
This module is licensed under the [Academic Free License (AFL 3.0)](http://opensource.org/licenses/afl-3.0.php).
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
Developed by **panariga**.
|
Panariga
|
||||||
* [GitHub Profile](https://github.com/panariga)
|
|
||||||
* [Gitea Profile](https://git.panariga.com/PrestashopModules/productlinkchecker)
|
|
||||||
Reference in New Issue
Block a user