macopedia / module-omnibusdirective
Implementation of EU Omnibus Directive for Magento 2
Installs: 6 582
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 7
Forks: 2
Open Issues: 4
Type:magento2-module
README
Implementation of EU Omnibus Directive for Magento 2.
Requirements
Magento version > 2.4.x
Main features
- Historical prices
- Adds
Historical price
andHistorical price updated at
product attributes - Keeps minimal price from last 30 days - calculated from
price
andspecial_price
attributes change after product save in admin panel - Cronjob which removes historical prices older than 30 days
- Displays historical price on product view page
- Adds
- Trusted review validation
- Extends product review form by an additional input
order_number
- Validates purchased product by order number (Increment ID) - only validated buyer can add review to product
- Extends product review form by an additional input
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
- Using composer:
composer require macopedia/module-omnibusdirective
- Using zip file:
- Download zip file
- 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
):
<div class="field review-field-order-id required"> <label for="order_id_field" class="label"><span><?= $block->escapeHtml(__('Order number')) ?></span></label> <div class="control"> <input type="text" name="order_id" id="order_id_field" class="input-text" data-validate="{required:true}" data-bind="value: review().order_id" /> </div> </div>
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):
$origData = [ 'special_price' => xxx, 'historical_price' => xxx, 'price' => xxx ]
and updated prices array $data
(after import values):
$data = [ 'special_price' => xxx, 'price' => xxx ]