VOOZH about

URL: https://deepwiki.com/MahoCommerce/maho/8.5-product-options-and-customization

⇱ Product Options and Customization | MahoCommerce/maho | DeepWiki


Loading...
Last indexed: 15 May 2026 (ea8ab8)
Menu

Product Options and Customization

This page documents the technical implementation of product customization in Maho, covering custom product options, configurable product selections, and downloadable product links. These systems allow for per-product flexibility beyond standard EAV attributes.


1. Custom Product Options

Custom options are per-product configurations (e.g., text engraving, file uploads) defined individually for each product rather than at the attribute set level.

Option Type Architecture

Options are categorized into groups, each handled by a specific type model. The Mage_Catalog_Model_Product_Option class acts as the entity, while specialized type classes handle validation and formatting.

Group ConstantInput TypesType Model Reference
OPTION_GROUP_TEXTfield, areaMage_Catalog_Model_Product_Option_Type_Default
OPTION_GROUP_FILEfileMage_Catalog_Model_Product_Option_Type_File
OPTION_GROUP_SELECTdrop_down, radio, checkbox, multipleMage_Catalog_Model_Product_Option_Type_Select
OPTION_GROUP_DATEdate, date_time, timeMage_Catalog_Model_Product_Option_Type_Date

The mapping between types and groups is defined in Mage_Catalog_Model_Product_Option::getGroupByType().

Data Flow: Frontend to Cart

When a customer configures options on the product page, the Product.Options JavaScript class manages the state and price updates.

Title: Custom Option Interaction Flow


Sources: app/design/frontend/base/default/template/catalog/product/view/options.phtml28 app/design/frontend/base/default/template/catalog/product/view/options/type/text.phtml23 app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php109-110

File Option Handling

File uploads require complex state management to handle new uploads, deletions, and existing files (e.g., during cart editing or reordering).

Key Logic:

Sources: app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php81-179 app/design/frontend/base/default/template/catalog/product/view/options/type/file.phtml12-92 app/code/core/Mage/Catalog/Block/Product/View/Options/Type/File.php20-51


2. Configurable Product Options

Configurable products allow customers to select variants based on attributes (e.g., Size, Color).

Implementation Blocks and Models

Frontend Configuration Logic

The getJsonConfig() method builds a complex object containing:

  1. Attributes: IDs, codes, and labels app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php141-146
  2. Options: Label, price, and associated simple product IDs app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php177-183
  3. Stock Status: Whether the specific variant is in stock app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php122

Title: Configurable Product Data Resolution


Sources: app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php20-186 app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php13-113


3. Composite Product Relationships

Composite products (Configurable, Bundle, Grouped) represent a collection of other products.

Abstract Type Behavior

The Mage_Catalog_Model_Product_Type_Abstract provides the foundation for all product types:

Validation Modes

Product types support different processing modes during cart addition:

Sources: app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php13-221 app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php190-198


4. Technical Reference: Code to Entity Mapping

This diagram maps the internal Maho code symbols to the functional customization components.

Title: Code Entity Mapping


Sources: app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php20-105 app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php16-109 app/design/frontend/base/default/template/catalog/product/view/options/js.phtml15


5. Downloadable and Date Options

Date and Time Options

Handled via Mage_Catalog_Block_Product_View_Options_Type_Date.

Text and Select Options

Sources: app/design/frontend/base/default/template/catalog/product/view/options/type/date.phtml12-53 app/design/frontend/base/default/template/catalog/product/view/options/js.phtml14-16 app/design/frontend/base/default/template/catalog/product/view/options/type/text.phtml12-31 app/design/frontend/base/default/template/catalog/product/view/options/type/select.phtml12-29