5.4 KiB
Of course! A good README.md is essential for any project. Here is a comprehensive README file tailored for your productlinkchecker module, crediting you as the developer.
Just copy and paste the content below into a new file named README.md in the root of your productlinkchecker module directory.
PrestaShop Product Link Checker Module
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.
Features
- JSON Output: Generates a clean, machine-readable JSON array of product links.
- 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
- PrestaShop Version: 1.7.6 or newer.
Installation
You can install the module using one of two methods:
Method 1: Using the PrestaShop Module Manager (Recommended)
- Download the latest release as a
.zipfile from the repository. - Log in to your PrestaShop Back Office.
- Navigate to Modules > Module Manager.
- Click the "Upload a module" button.
- Drag and drop the downloaded
.zipfile into the upload area. - The module will be installed automatically. Find "Product Link Checker" in your module list and click Install.
Method 2: Manual Installation
- Download and unzip the latest release.
- Rename the folder to
productlinkchecker. - Upload the
productlinkcheckerfolder to themodules/directory of your PrestaShop installation. - In your PrestaShop Back Office, navigate to Modules > Module Manager.
- Find "Product Link Checker" in your module list and click Install.
Configuration
After installing the module, click the "Configure" button.
The configuration page provides two key pieces of information:
- Your Security Token: A unique 32-character string that must be included in every request to the generator endpoint.
- 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.
(Optional: Replace this with a link to a screenshot of your module's configuration page)
Usage: The generate Endpoint
The module exposes a single front controller endpoint to generate the links.
Base URL: https://your-prestashop-url/module/productlinkchecker/generate
Parameters
token(string, required): Your unique security token found on the module's configuration page.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).
Examples
1. Get all links for all shops and all languages
https://your-prestashop-url/module/productlinkchecker/generate?token=YOUR_SECRET_TOKEN
2. Get all links for a specific shop (e.g., Shop ID 1)
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)
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.
[
"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",
"https://your-prestashop-url/en/men/1-2-hummingbird-printed-t-shirt.html#/2-size-m/11-color-black",
"https://your-prestashop-url/fr/hommes/1-tee-shirt-imprime-colibri.html",
"https://your-prestashop-url/fr/hommes/1-1-tee-shirt-imprime-colibri.html#/1-taille-s/8-couleur-blanc",
"https://your-prestashop-url/fr/hommes/1-2-tee-shirt-imprime-colibri.html#/2-taille-m/11-couleur-noir",
...
]
⚠️ 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.
License
This module is released under the Academic Free License (AFL 3.0).
Author
Developed by panariga.