← All modules

Magento 2 module · foundation

Catalog Product Option Price

Calculates and stores the share of custom options in each cart and order item price, including tax, so other Infrangible option modules can show and process option prices separately.

Magento adds the prices of selected custom options to the item price but does not keep track of how much of an item’s price comes from its options. This module calculates the options share of every cart item, per unit and per row, with and without tax, and carries these amounts over into the order. When an order is placed, the price of each selected option, and its share of any discount, is stored with the order item and is also returned by the order API.

Features

  • Calculates the options price of each cart item per unit and for the full row, excluding and including tax and in base and store currency.
  • Copies these amounts to the order item when the order is placed.
  • Stores the price of each selected option with the order item, plus the original price and the discount share if the item was discounted.
  • Adds the option price, original price and discount to the custom options returned by the order API, which helps when passing orders to an ERP or other external systems.
  • Lets other modules add option prices that are charged once per cart item instead of per unit.

Configuration

There is nothing to configure. The module works right after installation.

Good to know

This is a building block. It is installed automatically by Catalog Product Option Cart, which uses the stored amounts to show option prices separately in the cart, and by Catalog Product Option Composite.

Installation

Install the module with Composer in your Magento root directory:

composer require infrangible/m2-catalog-product-option-price

Then enable it and update the store as described in the installation guide. Composer installs the required modules listed on this page automatically.