magenxcommerce/module-msrp

N/A

安装: 126

依赖项: 6

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

公开问题: 0

类型:magento2-module


README

Magento_Msrp 模块负责制造商建议零售价功能。当前模块提供了 msrp 定价渲染、配置和计算的基本功能。

安装

The Magento_Msrp 模块创建了以下属性

实体类型 - catalog_product.

属性组 - 高级定价.

  • msrp - 制造商建议零售价
  • msrp_display_actual_price_type - 显示实际价格

注意 如果在模块删除/禁用时未删除所描述的属性,则会导致错误,因为这些属性使用 Magento_Msrp 模块中的模型和块

  • \Magento\Msrp\Block\Adminhtml\Product\Helper\Form\Type
  • \Magento\Msrp\Model\Product\Attribute\Source\Type\Price
  • \Magento\Msrp\Block\Adminhtml\Product\Helper\Form\Type\Price

有关在 Magento 2 中安装模块的信息,请参阅 启用或禁用模块.

结构

Pricing\ - 目录包含 msrp 定价计算的接口和实现(\Magento\Msrp\Pricing\MsrpPriceCalculatorInterface),价格渲染器和价格模型。

Pricing\Price\ - 目录包含声明 msrp 价格模型接口和实现。

Pricing\Renderer\ - 包含价格渲染器实现。

有关 Magento 2 中模块的典型文件结构的信息,请参阅 模块文件结构.

可扩展性

开发者可以使用 di.xml 使用类型配置传递自定义 msrpPriceCalculators 以供 Magento\Msrp\Pricing\MsrpPriceCalculator 使用。

例如

   <type name="Magento\Msrp\Pricing\MsrpPriceCalculator">
       <arguments>
           <argument name="msrpPriceCalculators" xsi:type="array">
               <item name="configurable" xsi:type="array">
                   <item name="productType" xsi:type="const">Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE</item>
                   <item name="priceCalculator" xsi:type="object">Magento\MsrpConfigurableProduct\Pricing\MsrpPriceCalculator</item>
               </item>
           </argument>
      </arguments>
  </type>

有关 类型配置 的更多信息。

扩展开发者可以与 Magento_Msrp 模块交互。有关 Magento 扩展机制的信息,请参阅 Magento 插件.

Magento 依赖注入机制 允许您覆盖 Magento_Msrp 模块的功能。

事件

此模块观察以下事件

etc/frontend/

  • Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver 文件中的 sales_quote_collect_totals_after

etc/webapi_rest

  • Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver 文件中的 sales_quote_collect_totals_after

etc/webapi_soap

  • Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver 文件中的 sales_quote_collect_totals_after

有关 Magento 2 中事件的信息,请参阅 事件和观察者.

布局

该模块与以下布局处理程序交互

view/base/layout 目录

  • catalog_product_prices
  • cms_index_index

view/frontend/layout 目录

  • catalog_category_view
  • catalog_product_compare_index
  • catalog_product_view
  • catalogsearch_advanced_result
  • catalogsearch_result_index
  • checkout_cart_sidebar_total_renderers
  • checkout_onepage_failure
  • checkout_onepage_success
  • review_product_list
  • wishlist_index_configure_type_downloadable
  • wishlist_index_index
  • wishlist_search_view
  • wishlist_shared_index

此模块引入了以下布局和处理程序

view/frontend/layout 目录

  • msrp_popup

UI 组件

模块提供产品管理表单修改器

Magento\Msrp\Ui\DataProvider\Product\Form\Modifier\Msrp - 如果禁用配置,则从表单中删除 msrp_display_actual_price_type 字段,否则添加 validate-zero-or-greater 验证到该字段。

更多信息

目录属性

当前模块扩展了etc/catalog_attributes.xml并为quote_item组提供了以下属性

  • 建议零售价
  • msrp_display_actual_price_type

扩展属性

Magento_Msrp为Magento\Catalog\Api\Data\ProductRender\PriceInfoInterface提供了扩展属性

  • 属性代码:msrp
  • 属性类型:Magento\Msrp\Api\Data\ProductRender\MsrpPriceInfoInterface