test-magenx / module-msrp
N/A
Requires
- php: ~7.3.0||~7.4.0
- magento/framework: 103.0.*
- magento/module-catalog: 104.0.*
- magento/module-downloadable: 100.4.*
- magento/module-eav: 102.1.*
- magento/module-store: 101.1.*
- magento/module-tax: 100.4.*
Suggests
- magento/module-bundle: 101.0.*
- magento/module-msrp-sample-data: Sample Data version: 100.4.*
This package is auto-updated.
Last update: 2024-09-13 07:59:04 UTC
README
Magento_Msrp 模块负责制造商建议零售价功能。当前模块提供了msrp定价渲染、配置和计算的基本功能。
安装
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
msrp_display_actual_price_type
扩展属性
Magento_Msrp 为 Magento\Catalog\Api\Data\ProductRender\PriceInfoInterface
提供了扩展属性
- 属性代码:
msrp
- 属性类型:
Magento\Msrp\Api\Data\ProductRender\MsrpPriceInfoInterface