macopedia/module-omnibusdirective

欧盟综合指令在Magento 2中的实现

安装次数: 6,252

依赖项: 0

建议者: 0

安全: 0

星标: 13

关注者: 7

分支: 2

开放问题: 4

类型:magento2-module

1.0.8 2022-12-14 13:55 UTC

This package is auto-updated.

Last update: 2024-09-16 14:00:17 UTC


README

欧盟综合指令在Magento 2中的实现。

要求

Magento版本 > 2.4.x

主要特性

  1. 历史价格
    1. 添加 历史价格历史价格更新时间 产品属性
    2. 保持过去30天的最低价格 - 从 价格特别价格 属性在管理员面板中保存产品后的更改计算得出
    3. 定时任务,删除30天前的历史价格
    4. 在产品查看页面上显示历史价格
  2. 可信评论验证
    1. 通过额外的输入 order_number 扩展产品评论表单
    2. 通过订单号(增量ID)验证购买的产品 - 只有验证过的买家才能为产品添加评论

未实现的功能

  • 在删除特别价格值之前检查特别价格日期的范围
  • 通过Rest API和Soap API保存后计算历史价格
  • 在产品批量操作更新后计算历史价格
  • 保留过去30天内的所有价格变更
  • 按客户组保留历史价格
  • 保留由目录规则计算的历史价格
  • 保留历史层价格

安装

  1. 使用composer
composer require macopedia/module-omnibusdirective
  1. 使用zip文件
    1. 下载zip文件
    2. 在目录 app/code/Macopedia/OmnibusDirective 中解压缩模块

启用模块并安装补丁

   bin/magento module:enable Macopedia_OmnibusDirective
   bin/magento setup:upgrade

注意 - 如果您有自定义主题和修改过的评论表单模板文件 Magento_Review/templates/form.phtml,您需要手动添加 order_id 输入(请参阅文件 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>

价格导入

如果您有导入价格的自定义脚本,您可以使用方法 \Macopedia\OmnibusDirective\Model\Product\HistoricalPrice::getHistoricalPriceUpdateValue 来计算历史价格。作为参数,您应传递包含原始价格数组的数组 $origData(导入值之前)

$origData = 
[
    'special_price' => xxx,
    'historical_price' => xxx,
    'price' => xxx
]

和更新后的价格数组 $data(导入值之后)

$data = 
[
    'special_price' => xxx,
    'price' => xxx
]

屏幕截图

产品页面的历史价格

product-page-historical-price

通过订单号字段进行评论验证

product-page-trusted-review