mar-pod / module-dynamic-product-data
Customer-context dynamic product data for Magento 2 storefront and quote flows.
Package info
gitlab.com/mar-pod/module-dynamic-product-data
Type:magento2-module
pkg:composer/mar-pod/module-dynamic-product-data
Requires
- php: ^8.5
- magento/framework: ^103.0
- magento/module-bundle: ^101.0
- magento/module-catalog: ^104.0
- magento/module-customer: ^103.0
- magento/module-grouped-product: ^100.4
- magento/module-inventory-api: ^1.2
- magento/module-quote: ^101.2
- magento/module-search: ^101.1
- magento/module-webapi: ^100.4
- mar-pod/module-core: ^2.0.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-08-16 08:32:15 UTC
README
Magento 2 module for customer-context product pricing, availability, delivery data, and quote validation.
The module keeps public HTML customer-neutral. Customer-specific values are loaded after the page through Magento customer-data and private REST responses, preserving compatibility with Full Page Cache and Varnish.
Requirements
- PHP 8.5
- Magento Open Source or Adobe Commerce 2.4.9
- Magento Bundle, Catalog, Customer, Grouped Product, Inventory API, Quote, Search, and Web API modules
The package does not require MageSuite or Smile ElasticSuite.
Installation
After publishing the repository on Packagist, install the package from the Magento root:
composer require mar-pod/module-dynamic-product-data:^2.0
bin/magento module:enable Marpod_DynamicProductData
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
The module is disabled by default. Enable it at Stores > Configuration > Marpod > Marpod Configuration > Dynamic Catalog.
Configuration
Configuration supports default, website, and store-view scope:
- Enabled — activates storefront and quote integrations; default:
No. - Debug Logging —
Disabled,Basic, orVerbose; default:Disabled. - Log Retention Days — removes older database debug entries during the daily cron run; default:
30. Set0to retain entries until manual cleanup. - Clear Dynamic Cache — invalidates only customer-specific data generated by this module.
Debug entries are stored in local_dynamic_catalog_debug_log. File logging uses var/log/local_dynamic_catalog.log.
The cache can also be cleared from the command line:
bin/magento local:dynamic-catalog:cache:clear --all
Supported storefront behavior
- product pages and native category/search listings;
- simple, configurable, grouped, and bundle products;
- customer-specific prices, availability, and delivery data;
- dynamic quote prices and quantity validation;
- targeted invalidation after relevant catalog or inventory changes;
- admin debug log listing and scheduled cleanup.
Connect a production data source
The included Model/TestProductDataProvider reads development data from local_dynamic_catalog_customer_price_test and falls back to Magento product data. A production integration should implement:
\Marpod\DynamicProductData\Api\ProductDataProviderInterface
Configure the implementation in the consuming module's etc/di.xml:
<preference for="Marpod\DynamicProductData\Api\ProductDataProviderInterface"
type="Vendor\Module\Model\ErpProductDataProvider"/>
Implementations may use an ERP, PIM, remote API, or project-owned database. They must return ProductContextInterface values for SKU/customer and product-ID/customer lookups. TestProductDataProviderInterface remains available as a deprecated compatibility alias.
Development fixture
Test/Fixture/customer_product_prices.sql creates customer-specific development prices for existing customer/product pairs. It is never loaded automatically. See Test/Fixture/README.md before use.
Example for a Docker project when this repository is installed as a Composer path package:
docker compose exec -T db mariadb -uroot -proot magento \
< packages/module-dynamic-product-data/Test/Fixture/customer_product_prices.sql
REST endpoints
POST /V1/local/dynamic-catalog/product-data/current-customerPOST /V1/local/dynamic-catalog/product-data/by-product-id/current-customerPOST /V1/local/dynamic-catalog/grouped-product-data/current-customerPOST /V1/local/dynamic-catalog/bundle-base-data/current-customerPOST /V1/local/dynamic-catalog/bundle-product-data/current-customer
Responses contain private customer data and must not be stored in shared caches.
Tests
The repository contains unit, Magento integration, and Playwright smoke tests:
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist \
vendor/mar-pod/module-dynamic-product-data/Test/Unit
For a path repository, replace the test path with packages/module-dynamic-product-data/Test/Unit.
See PORTABILITY_PLAN.md for the extraction scope and compatibility checklist.