https://github.com/macopedia/magento2-omnibusdirective
Implementation of EU Omnibus Directive for Magento 2
https://github.com/macopedia/magento2-omnibusdirective
Last synced: 12 months ago
JSON representation
Implementation of EU Omnibus Directive for Magento 2
- Host: GitHub
- URL: https://github.com/macopedia/magento2-omnibusdirective
- Owner: macopedia
- License: gpl-3.0
- Created: 2022-07-21T13:43:41.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T09:27:44.000Z (over 1 year ago)
- Last Synced: 2025-06-13T16:03:59.694Z (about 1 year ago)
- Language: PHP
- Size: 47.9 KB
- Stars: 15
- Watchers: 6
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Macopedia Magento 2 Omnibus Directive module
Implementation of EU Omnibus Directive for Magento 2.
- [Requirements](#requirements)
- [Main features](#main-features)
- [Not implemented features](#not-implemented-features)
- [Installation](#installation)
- [Prices import](#prices-import)
## Requirements
Magento version > 2.4.x
## Main features
1. Historical prices
1. Adds `Historical price` and `Historical price updated at` product attributes
2. Keeps minimal price from last 30 days - calculated from `price` and `special_price` attributes change after product save in admin panel
3. Cronjob which removes historical prices older than 30 days
4. Displays historical price on product view page
2. Trusted review validation
1. Extends product review form by an additional input `order_number`
2. Validates purchased product by order number (Increment ID) - only validated buyer can add review to product
## Not implemented features
- checking from / to special price date before remove special price value
- calculate historical price after save by Rest API and Soap API
- calculate historical price after product mass action update
- keep all price changes from last 30 days
- keep historical prices per customer groups
- keep historical prices calculated by catalog rules
- keep historical tier prices
## Installation
1. Using composer:
```
composer require macopedia/module-omnibusdirective
```
2. Using zip file:
1. Download zip file
2. Extract module in directory `app/code/Macopedia/OmnibusDirective`
Enable module and install patches:
```
bin/magento module:enable Macopedia_OmnibusDirective
bin/magento setup:upgrade
```
Notice - if you have custom theme and modified review form template file `Magento_Review/templates/form.phtml` you have to add manually `order_id` input (see example in file `view/frontend/templates/review/form.phtml`):
```html
= $block->escapeHtml(__('Order number')) ?>
```
## Prices import
If you have custom script to import prices, you can use method `\Macopedia\OmnibusDirective\Model\Product\HistoricalPrice::getHistoricalPriceUpdateValue` to calculate historical price.
As parameters, you should pass array with original prices `$origData` (before import values):
```php
$origData =
[
'special_price' => xxx,
'historical_price' => xxx,
'price' => xxx
]
```
and updated prices array `$data` (after import values):
```php
$data =
[
'special_price' => xxx,
'price' => xxx
]
```
## Screenshots
### Historical price on product page

### Review validation by order number field
