Usage
How It Works
Price Tracking Logic
The module implements logic to determine when to update historical prices:
- Price Increases: When a product's regular price increases, the previous price is stored as the historical price
- Special Price Removal: When a special price is removed and the regular price is higher than the previous special price, the special price becomes the historical price
- Price Decreases: When prices decrease, the historical price is not updated (maintains the lowest price)
- 30-Day Window: Historical prices are tracked within a 30-day rolling window
Frontend Display
On product pages, when the historical price feature is enabled, customers will see: - The current price prominently displayed - A secondary line showing "The lowest price in the last 30 days:" followed by the historical price - This information helps customers make informed purchasing decisions
Technical Implementation
Core Components
- Configuration Model: Manages module settings and feature flags
- Historical Price Model: Handles price tracking logic and updates
- Observer: Monitors product save events to update historical prices
- Pricing Renderer: Displays historical prices on the frontend
- Setup Patch: Creates necessary product attributes during installation
Event Integration
The module integrates with Magento's product save events to automatically track price changes:
- Listens to
catalog_product_save_after
events - Compares original and new product data
- Updates historical prices based on configured logic
EU Compliance
Omnibus Directive Requirements
This module helps merchants comply with EU Directive 2019/2161 (Omnibus Directive), which requires:
- Display of the lowest price from the previous 30 days
- Transparency in pricing practices
- Clear labeling of price information
Legal Considerations
- Merchants are responsible for ensuring full compliance with all applicable regulations
- The module provides technical implementation but does not guarantee legal compliance
- Consult with legal professionals for specific compliance requirements in your jurisdiction