Accessories, services or extended warranties are often products in their own right, with their own price and tax class. This module adds the custom option type “Product”. Instead of typing a title and a price, you link an existing catalog product. On the product page the add-on appears as a checkbox with the linked product’s name and its current price. If the linked product is a configurable product, the shopper chooses the variant with swatches right inside the option, and the variant’s price is used.
Features
- New option type “Product” in the product’s Customizable Options section, linked to another catalog product by its ID.
- The option price is taken from the linked product’s final price, so price changes and special prices are picked up automatically; a fixed option price can still be set.
- Configurable add-on products are shown with swatches; the price follows the selected variant.
- “Attribute Option Mapping”: selecting a swatch on the main product can automatically select a matching swatch on the add-on (for example the same colour). “Attribute Option Preselect” sets initial swatch values for the add-on.
- “Unattached”: the add-on price is charged once per cart item instead of being multiplied by the quantity.
- Tax for the add-on is calculated with the linked product’s own tax class.
- “Product Code”: the value of a chosen product attribute of the add-on (for example its SKU) is saved with the order as the option value code.
- Works on simple, configurable and bundle product pages.
Configuration
Open a product in the admin, go to Customizable Options, add an option and choose the type “Product”. Enter the ID of the linked product and, if needed, the further settings described above. There are no global settings.
Good to know
Combine it with Catalog Product Option Cart to show add-ons as separate price lines in the cart, with Catalog Product Option Qty to let shoppers order several pieces of an add-on, and with Catalog Product Option Code to pass the “Product Code” to connected systems. Catalog Product Option Composite Product makes the option type available on the bundle edit page in the cart.
Installation
Install the module with Composer in your Magento root directory:
composer require infrangible/m2-catalog-product-option-productThen enable it and update the store as described in the installation guide. Composer installs the required modules listed on this page automatically.