|
| 1 | +# Magento_Msrp module |
| 2 | + |
| 3 | +The Magento_Msrp module is responsible for Manufacturer’s Suggested Retail Price functionality. |
| 4 | +A current module provides base functional for msrp pricing rendering, configuration and calculation. |
| 5 | + |
| 6 | +## Installation |
| 7 | +The Magento_Msrp module creates the following attributes: |
| 8 | + |
| 9 | +Entity type - `catalog_product`. |
| 10 | + |
| 11 | +Attribute group - `Advanced Pricing`. |
| 12 | + |
| 13 | +- `msrp` - Manufacturer's Suggested Retail Price |
| 14 | +- `msrp_display_actual_price_type` -Display Actual Price |
| 15 | + |
| 16 | +Before disabling or uninstalling this module, note that the following modules depends on this module: |
| 17 | + |
| 18 | +- `Magento_MsrpConfigurableProduct` |
| 19 | +- `Magento_MsrpGroupedProduct` |
| 20 | +- `Magento_ConfigurableProduct` |
| 21 | + |
| 22 | +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). |
| 23 | + |
| 24 | +## Structure |
| 25 | +`Pricing\` - directory contains interfaces and implementation for msrp pricing calculations |
| 26 | + (`\Magento\Msrp\Pricing\MsrpPriceCalculatorInterface`), price renderers |
| 27 | + and price models. |
| 28 | + |
| 29 | +`Pricing\Price\` - the directory contains declares msrp price model interfaces and implementations. |
| 30 | + |
| 31 | +`Pricing\Renderer\` - contains price renderers implementations. |
| 32 | + |
| 33 | +For information about a typical file structure of a module in Magento 2, |
| 34 | + see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). |
| 35 | + |
| 36 | +## Extensibility |
| 37 | + |
| 38 | + Extension developers can interact with the Magento_Msrp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). |
| 39 | + |
| 40 | +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Msrp module. |
| 41 | + |
| 42 | +### Events |
| 43 | + |
| 44 | +This module observes the following event: |
| 45 | + |
| 46 | +`etc/frontend/` |
| 47 | + |
| 48 | + - `sales_quote_collect_totals_after` in the `Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver` file. |
| 49 | + |
| 50 | +`etc/webapi_rest` |
| 51 | + - `sales_quote_collect_totals_after` in the `Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver` file. |
| 52 | + |
| 53 | +`etc/webapi_soap` |
| 54 | + - `sales_quote_collect_totals_after` in the `Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver` file. |
| 55 | + |
| 56 | +For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). |
| 57 | + |
| 58 | +### Layouts |
| 59 | + |
| 60 | +This module introduces the following layouts: |
| 61 | + |
| 62 | +`view/base/layout` directory: |
| 63 | + |
| 64 | +- `catalog_product_prices` |
| 65 | +- `cms_index_index` |
| 66 | + |
| 67 | +`view/frontend/layout` directory: |
| 68 | + |
| 69 | +- `catalog_category_view` |
| 70 | +- `catalog_product_compare_index` |
| 71 | +- `catalog_product_view` |
| 72 | +- `catalogsearch_advanced_result` |
| 73 | +- `catalogsearch_result_index` |
| 74 | +- `checkout_cart_sidebar_total_renderers` |
| 75 | +- `checkout_onepage_failure` |
| 76 | +- `checkout_onepage_success` |
| 77 | +- `msrp_popup` |
| 78 | +- `review_product_list` |
| 79 | +- `wishlist_index_configure_type_downloadable` |
| 80 | +- `wishlist_index_index` |
| 81 | +- `wishlist_search_view` |
| 82 | +- `wishlist_shared_index` |
| 83 | + |
| 84 | +### UI components |
| 85 | + |
| 86 | +Module provides product admin form modifier: |
| 87 | + |
| 88 | +`Magento\Msrp\Ui\DataProvider\Product\Form\Modifier\Msrp` - removes `msrp_display_actual_price_type` field from the form if config disabled else adds `validate-zero-or-greater` validation to the fild. |
| 89 | + |
| 90 | +## Additional information |
| 91 | + |
| 92 | +### Catalog attributes |
| 93 | + |
| 94 | +A current module extends `etc/catalog_attributes.xml` and provides following attributes for `quote_item` group: |
| 95 | +- `msrp` |
| 96 | +- `msrp_display_actual_price_type` |
| 97 | + |
| 98 | +### Extension Attributes |
| 99 | +The Magento_Msrp provides extension attributes for `Magento\Catalog\Api\Data\ProductRender\PriceInfoInterface` |
| 100 | +- attribute code: `msrp` |
| 101 | +- attribute type: `Magento\Msrp\Api\Data\ProductRender\MsrpPriceInfoInterface` |
0 commit comments