Implementation of EU Omnibus Directive for Magento 2.
Magento version > 2.4.x
Historical price
and Historical price updated at
product attributesprice
and special_price
attributes change after product save in admin panelorder_number
composer require macopedia/module-omnibusdirective
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>
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
]