This module integrates the Filecheck Element preflight widget directly into PrestaShop product pages. It allows customers to upload and validate print-ready assets before proceeding to add items to their cart.
The PrestaShop module is structured as follows:
-
filecheck.php
The main entry point of the module. Configures PrestaShop admin tabs, installs and uninstalls DB tables, registers modern hook listeners, and dispatches back-office AJAX calls. -
classes/FilecheckAPIClient.php
Server-side PHP wrapper to connect with the Filecheck REST API. Handles authenticating keys, listing active workflows, registering order details, and fetching job summaries/run outputs. -
classes/FilecheckProduct.php
Handles active product database persistence. Configures custom workflows, connectors, or presentation mode overrides per-product. -
classes/FilecheckJob.php
Active job mapping layer. Connects guests' uploaded Filecheck job IDs with their PrestaShop cart items and, upon successful checkout, links those files to finalized order lines. -
controllers/front/ajax.php
Frontend AJAX controller that allows the client to push job IDs to session cookies, ensuring robust session survival through AJAX-based cart checkouts. -
views/templates/admin/settings.tpl
Sleek back-office configuration page allowing merchants to save credentials, list workflows, and run connection checks. -
views/templates/admin/product_extra.tpl
Implements the extra product settings tab (Extra Fields) inside standard PrestaShop product editors. -
views/templates/admin/order_summary.tpl
Injected template grid displaying uploaded runs, status badges, proof thumbnails, and direct download links under the PrestaShop order edit page index. -
views/templates/hook/product_widget.tpl
Frontend template injecting the widget placeholder container and hidden inputs directly next to the add-to-cart action.
- Compress the root directory of this module into a ZIP file named
filecheck.zip. - Go to Modules > Module Manager in your PrestaShop 8 back office.
- Click Upload a module and select your
filecheck.zipfile. - After installation, click Configure.
- Input your Publishable Key and Secret Key. You can click Test Connection to verify keys immediately.
- Choose your Default Workflow from the synchronised dropdown and click Save Settings.
When a user visits a product page with an assigned Filecheck workflow, the module enqueues the per-tenant CDN client library:
https://cdn.filecheck.io/element/{publishable_key}/filecheck.js
And injects a target container element:
<div id="fc-slot-{product_id}"></div>
views/js/frontend.js awaits the presence of the Filecheck library, constructs the required mounting configurations, and calls window.Filecheck.mount(config).
Passes .add-to-cart as the cartButtonSelector configuration option, instructing the Element itself to control the Add to Cart button state, disabling it dynamically until valid files are provided.
To ensure compatibility with AJAX-based cart templates, the module uses a dual-gating pattern:
- Form POST Gating: Captures the
jobIdinside a hidden input field namedfilecheck_job_id. - PrestaShop Session Gating: Simultaneously pushes the current
jobIdto theajaxfront controller, which saves it inside$this->context->cookieunder the keyfc_job_{product_id}.
Upon standard or quick checkout:
- The
job_idis captured and committed tops_filecheck_jobs. - Upon order validation, details are synchronized securely with Filecheck to record origin details inside the merchant back-office.
- When an order transitions to paid or processing statuses, high-res outputs are safely downloaded to a shielded filesystem index (
/upload/filecheck-secure/) protected by.htaccessrules. - Merchants can inspect and download preflighted outputs directly within the PrestaShop Order details page.