Rollpix QrLanding
rollpix/module-qr-landing
Enables QR code landing pages for products, recording visits when scanned. Redirects to the product page, preserving UTM parameters for analytics.
Build Tests
Code Quality
Tested on Magento 2.4.8-p4
Recent Test History
Each release is tested against the latest Magento version at that time.
Top Contributors
View LeaderboardLooking for Contributors
Composer installation fails. Your contribution could help the entire Magento community!
Share This Module's Status
README
Loaded from GitHubRollpix_QrLanding
SPONSOR: www.rollpix.com
Magento 2 module that serves as a QR code landing page for physical store products. When a customer scans a QR code printed next to a product, the module records the visit and redirects to the product detail page (PDP), preserving UTM parameters for Google Analytics tracking.
Compatibility
| Requirement | Version |
|---|---|
| PHP | 8.1 | 8.2 | 8.3 |
| Magento | 2.4.7 | 2.4.7-p1~p4 | 2.4.8 |
Installation
Via Composer (recommended)
composer config repositories.rollpix-qr-landing vcs https://github.com/ROLLPIX/M2-qr-landing.git
composer require rollpix/module-qr-landing
bin/magento module:enable Rollpix_QrLanding
bin/magento setup:upgrade
bin/magento cache:flush
Manual
- Create
app/code/Rollpix/QrLandingand copy all repo files there - Run:
bin/magento module:enable Rollpix_QrLanding
bin/magento setup:upgrade
bin/magento cache:flush
Admin Configuration
Path: Stores > Configuration > Rollpix > QR Landing
| Field | Type | Default | Scope |
|---|---|---|---|
| Enable Module | Yes/No | Yes | Store View |
| Enable Tracking | Yes/No | Yes | Store View |
| Identifier Type | Select | SKU | Store View |
| Fallback URL | Text | / |
Store View |
What It Does
QR Landing Controller (/qr/{sku})
- Receives QR scan via URL like
/qr/ABC123?utm_source=qr_store - Validates that the module is enabled for the current store view
- Resolves the SKU to a product and verifies it exists and is enabled
- Records the visit in
rollpix_qr_visits(automatic when tracking is enabled, with 5-minute deduplication per IP+SKU) - Sanitizes all stored inputs (strip_tags + length truncation)
- Redirects (302) to the product page, appending UTM parameters
- If the product is not found, redirects to the Fallback URL (defaults to homepage); shows 404 if fallback is empty
REST API β Status (GET /V1/rollpix-qr/status)
- Auth: Bearer token (admin)
- ACL:
Rollpix_QrLanding::status - Returns:
{ "enabled", "tracking_enabled", "module_version", "identifier_type" }
REST API β Report (GET /V1/rollpix-qr/report)
- Auth: Bearer token (admin)
- ACL:
Rollpix_QrLanding::report - Query params:
from,to(Y-m-d),sku,page,pageSize - Returns visit aggregations by SKU and daily counts
Behavior When Disabled
/qr/{sku}returns 404 (or redirects to fallback URL if configured)- REST APIs still respond (they report
enabled: false) - No visits are recorded
Technical Architecture
M2-qr-landing/ β repo root
βββ registration.php
βββ composer.json
βββ etc/
β βββ module.xml
β βββ di.xml (interface preferences)
β βββ acl.xml
β βββ config.xml
β βββ db_schema.xml (rollpix_qr_visits table)
β βββ db_schema_whitelist.json
β βββ webapi.xml (status + report endpoints)
β βββ adminhtml/
β β βββ system.xml
β βββ frontend/
β βββ di.xml (custom router registration)
β βββ routes.xml
βββ Api/
β βββ StatusInterface.php
β βββ ReportInterface.php
βββ Block/Adminhtml/System/Config/
β βββ ModuleInfo.php
βββ Controller/Qr/
β βββ Index.php
βββ Helper/
β βββ Config.php
βββ Model/
β βββ Status.php
β βββ Report.php
β βββ Visit.php
β βββ Config/Source/
β β βββ IdentifierType.php
β βββ ResourceModel/
β βββ Visit.php
β βββ Visit/
β βββ Collection.php
βββ Router/
β βββ QrRouter.php
βββ view/frontend/layout/
β βββ qr_qr_index.xml
βββ i18n/
βββ es_AR.csv
| Component | Type | Purpose |
|---|---|---|
QrRouter |
Custom Router | Parses /qr/{sku} into controller params |
Controller\Qr\Index |
HttpGetActionInterface | Landing logic: validate, track, redirect |
Helper\Config |
Config reader | Reads rollpix_qrlanding/general/* |
Model\Status |
API implementation | Returns module status |
Model\Report |
API implementation | Aggregated visit report |
Manual Testing Guide
# 1. Redirect works with existing SKU
curl -sI "https://yourstore.com/qr/EXISTING_SKU"
# β HTTP 302 + Location: product URL
# 2. Tracking records visit (automatic when tracking is enabled)
curl -sI "https://yourstore.com/qr/EXISTING_SKU?utm_source=test"
# β Check rollpix_qr_visits table
# 3. Non-existent SKU returns 404
curl -sI "https://yourstore.com/qr/FAKE_SKU"
# β HTTP 404
# 4. Status API
curl -s -H "Authorization: Bearer $TOKEN" "https://yourstore.com/rest/V1/rollpix-qr/status"
# 5. Report API
curl -s -H "Authorization: Bearer $TOKEN" "https://yourstore.com/rest/V1/rollpix-qr/report?from=2026-01-01"
Uninstall
Via Composer
bin/magento module:uninstall Rollpix_QrLanding
# or
composer remove rollpix/module-qr-landing
bin/magento setup:upgrade
Manual
bin/magento module:disable Rollpix_QrLanding
rm -rf app/code/Rollpix/QrLanding
bin/magento setup:upgrade
The rollpix_qr_visits table will be removed automatically on module uninstall via composer. For manual removal, drop it manually.
License
This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.