Skip to content
5.0 Upwork, 100+ reviews Adobe Certified since 2021 New: become your own Magento developer Learn more →
Catalog & Product Extensions

Custom Product Options for Magento 2 (Hyva + Luma)

Restyles Magento 2 product custom options on Hyvä and Luma: card-style radio buttons and checkboxes with price badges, a drag-and-drop file upload area and native HTML5 date pickers. Colors and spacing are CSS variables.

  • Free
  • Themes listed: Hyvä + Luma
Free $0.00, in stock
Check requirementsSee the versions and themes listed for this package. Details Ask about setupInclude the package name and your Magento and PHP versions. Ask
$0.00
In stock
SKU
panth-custom-options
Links
composer require mage2kishan/module-custom-options
SKU
panth-custom-options
  • Package requirementsRead the source documentation
  • Developer profileView Upwork profile
  • Themes listedHyvä + Luma
  • PHP versions listed8.1, 8.2, 8.3, 8.4
  • Installation questionsDiscuss your store setup

What it does for your store

The main features, as listed in the module documentation.

  • Modern, Accessible UI

    Styled text inputs and textareas, clean borders, focus rings, floating hints, character counters

  • Theming and Branding

    CSS custom properties, every color, radius, spacing, and font is a CSS variable - override in one place

  • Hyva and Luma Support

    Hyva, templates use Alpine.js and Tailwind utility classes, zero external JS

  • Admin Control

    Single master toggle, turn styled rendering on or off from Stores > Configuration > Panth Extensions > Custom Options

  • Performance and Quality

    Zero external JS dependencies, everything uses Alpine.js (bundled with Hyva) or vanilla CSS

Installation

Example commands from the Magento root. Follow the package instructions and your staging and deployment process.

  1. 1Check the releaseMatch Magento, PHP, theme and dependency requirements.
  2. 2Install on stagingReview Composer changes and follow the package instructions.
  3. 3Configure and verifyUse the documented settings and test the affected features.
magento-root
$ composer require mage2kishan/module-custom-options
$ bin/magento setup:upgrade
$ bin/magento setup:di:compile
$ bin/magento setup:static-content:deploy -f
$ bin/magento cache:clean

Listed requirements

These are the details supplied in this listing. Confirm the selected release supports your Magento edition, PHP and storefront.

Magento versions listed2.4.6, 2.4.7, 2.4.8
PHP versions listed8.1, 8.2, 8.3, 8.4
Themes listedHyvä, Luma
Composer packagemage2kishan/module-custom-options

Read package requirements and license

Documentation

Product details and setup guidance. Check the package repository for release-specific instructions.

Overview

Panth Custom Product Options is a UI upgrade for Magento 2 and Adobe Commerce that re-skins native custom options into accessible, themable form controls. It restyles every option type without changing how Magento stores, prices, or validates the option data, so cart and checkout behavior stays untouched.

The Custom Product Options module ships styled text inputs and textareas with focus rings, floating hints, and character counters; drag-and-drop file upload zones with filename preview, size validation feedback, and a remove button; polished <select> dropdowns with custom chevrons; card-style radio buttons and checkboxes with price-delta badges instead of tiny native radios; and native HTML5 date, time, and datetime-local pickers with no external date libraries.

Accessibility is in by default: real <label> bindings, ARIA attributes, keyboard navigation, and visible focus states on every control. CSS custom properties cover every color, radius, spacing, and font, so brand tokens change in one place per store view. Hyva templates use Alpine.js and Tailwind utility classes with zero external JS, while Luma gets a lightweight CSS layer over default templates. Auto theme detection runs through Panth\Core\Helper\Theme, so the right markup ships without manual switching.

  • Hyva merchants who want option styling that matches their Tailwind tokens.
  • Luma stores upgrading the dated native option UI without ripping out core.
  • Configurable, simple, virtual, and downloadable products with custom options.

What you get

Custom Product Options upgrades the native option behavior on every product type:

  • Styled inputs, textareas, dropdowns, and accessible focus rings.
  • Card-style radios and checkboxes with price-delta badges.
  • Drag-and-drop file upload zone with size and filename feedback.
  • Native HTML5 date, time, and datetime-local pickers, zero JS libs.
  • CSS custom properties for color, radius, and font theming.
  • Hyva and Luma compatible on Magento 2.4.4-2.4.9 and PHP 8.1-8.4.

Magento 2 Custom Options

"Panth Custom Options" (module Panth_CustomOptions) replaces the templates that Magento uses to render product customizable options on the product page. The options themselves are still defined per product in the admin under Catalog > Products > Customizable Options; the module only changes the front-end markup and styling: one bordered row per option, the option price shown as a badge next to the title, styled text inputs, textareas and selects, card-style radio and checkbox rows, a drop-zone style file upload area, and native HTML5 date, time and datetime-local inputs in the Hyva template set.

The module ships two template sets, one written for Hyva (Alpine.js and Hyva view models) and one for Luma (Magento's priceOptions widget and RequireJS). It is meant for stores whose products carry customizable options (engraving text, gift messages, uploaded artwork, delivery dates) and that want those fields to match the rest of the theme without rewriting the option templates.

Product page: Custom Product Options for Magento 2 (Hyva + Luma)

Features

  • Replaces the product.info.options container template and the text, select, file and date option-type templates of Magento_Catalog on the product page.
  • Hyva template set: styled option rows, a price badge on each option that Alpine.js keeps in sync with the product final price (including the incl./excl. tax display modes handled by Hyva\Theme\ViewModel\ProductPrice), data-price-amount and data-price-type attributes on every input, native date, time and datetime-local inputs that fill Magento's hidden day, month, year, hour, minute and day-part fields, and a mobile breakpoint at 640px.
  • Luma template set: a styled container that initialises Magento's standard priceOptions widget, the standard remaining-characters counter for options with a maximum length, radio and checkbox values wrapped into card rows by the module's card-options.js, and file, date and time controls rendered by Magento's own option blocks inside the styled wrapper.
  • Required options are marked with an asterisk; text inputs get a placeholder built from the option title.
  • File options display the allowed extensions and the maximum image width and height configured on the option, and show the already uploaded file with a "Change" link (Hyva) or "Change" and "Delete" controls (Luma) when a cart item is edited.
  • Colours, border radius and font of the Hyva template set are CSS custom properties (--custom-options-*). Their defaults ship in etc/theme-config.json and are printed into :root on every frontend page by Panth_Core; a theme can override them in its own web/tailwind/theme-config.json or in CSS.
  • One admin setting that switches both template sets on or off; when it is off the active theme's own option templates render.
  • No database tables, cron jobs, plugins, observers, controllers, routes or web API endpoints.

Usage

Which templates render

Two layout files assign the module templates to the existing Magento_Catalog option blocks, each through an ifconfig action on panth_customoptions/general/enabled. catalog_product_view.xml assigns the Luma set:

Block Template
product.info.options Panth_CustomOptions::product/view/options/luma/options.phtml
product.info.options.text Panth_CustomOptions::product/view/options/luma/type/text.phtml
product.info.options.select Panth_CustomOptions::product/view/options/luma/type/select.phtml
product.info.options.file Panth_CustomOptions::product/view/options/luma/type/file.phtml
product.info.options.date Panth_CustomOptions::product/view/options/luma/type/date.phtml

hyva_catalog_product_view.xml is only loaded on Hyva themes and runs after every catalog_product_view file, including the theme's, so on Hyva it replaces those assignments with the Hyva set (and loads css/hyva-options.css):

Block Template
product.info.options Panth_CustomOptions::product/view/options/options.phtml
product.info.options.text Panth_CustomOptions::product/view/options/type/text.phtml
product.info.options.select Panth_CustomOptions::product/view/options/type/select.phtml
product.info.options.file Panth_CustomOptions::product/view/options/type/file.phtml
product.info.options.date Panth_CustomOptions::product/view/options/type/date-html5.phtml

The Hyva set therefore works on any Hyva theme, not only on themes that ship their own copies of these templates. The options wrapper block keeps the theme's wrapper.phtml.

The templates apply wherever the catalog_product_view layout handle is used, which includes the product page and the page that opens when a cart item is edited. Nothing changes in the cart or checkout; option values are submitted with the same field names Magento expects, so cart and order display are Magento's own.

Option types

Magento option type Hyva template set Luma template set
Field Text input with maxlength and a "Maximum N characters" note Text input with Magento's remaining-characters counter
Area Textarea, 4 rows, same length note Textarea, 4 rows, same counter
File Drop-zone style area with an upload icon and "Drag & drop or browse" text; after a file is chosen, a preview row with an image thumbnail (or file icon), the file name and size, and a 44px "Remove file" button that clears the input and returns focus to it; extension and size hints below Drop-zone style area showing the chosen file name; "Allowed files", "Max width" and "Max height" notes
Drop-down, Multiple Select Rendered by Hyva\Theme\ViewModel\CustomOption::getOptionHtml() inside the styled row Magento's getValuesHtml() output; selects get the panth-input class from card-options.js
Radio Buttons, Checkbox Rendered by Hyva\Theme\ViewModel\CustomOption::getOptionHtml() inside a radiogroup or group labelled by the option title; each choice row is at least 44px high Each .field.choice is rewrapped into a .panth-choice-card label by card-options.js
Date, Date & Time, Time Native date, datetime-local or time input that fills Magento's hidden date and time fields on change Magento's own getDateHtml() and getTimeHtml() output inside a fieldset labelled by the option title; date-labels.js gives each select an accessible name (Month, Day, Year, Hour, Minute, AM/PM)

Overriding templates

All templates are ordinary .phtml files and can be overridden in a theme under app/design/frontend/<Vendor>/<theme>/Panth_CustomOptions/templates/product/view/options/.

Documentation

USER_GUIDE.md covers installation, checking that the module is active, the admin setting, the CSS custom properties, the supported option types and a troubleshooting table.

Changelog

See CHANGELOG.md.

Compatibility

Requirement Supported
Magento Open Source / Adobe Commerce 2.4.4 to 2.4.9 (as published on the product page)
PHP 8.1, 8.2, 8.3, 8.4 (~8.1.0||~8.2.0||~8.3.0||~8.4.0 in composer.json)
Themes Hyva and Luma (separate template sets, see Usage)

Composer constraints on Magento packages: magento/framework ^103.0, magento/module-catalog ^104.0, magento/module-config ^101.2, magento/module-store ^101.1.

Requirements

  • Magento Open Source or Adobe Commerce 2.4.4 to 2.4.9.
  • PHP 8.1, 8.2, 8.3 or 8.4.
  • mage2kishan/module-core ^1.0 (Magento module Panth_Core), required in composer.json and listed in the module sequence. It provides the "Panth Extensions" configuration tab and the Panth\Core\ViewModel\ThemeConfig view model that turns etc/theme-config.json into CSS variables.
  • For the Hyva template set: a Hyva theme, because those templates use Hyva\Theme\Model\ViewModelRegistry, Hyva\Theme\ViewModel\ProductPrice and Hyva\Theme\ViewModel\CustomOption. Hyva is not declared as a Composer dependency.
  • composer.json has no suggest section.

Installation

composer require mage2kishan/module-custom-options
bin/magento module:enable Panth_Core Panth_CustomOptions
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush
  • setup:di:compile is only needed in production mode; in developer mode Magento compiles on demand.
  • setup:static-content:deploy -f is needed because the module ships view/frontend/web/js/card-options.js, view/frontend/web/js/date-labels.js and view/frontend/requirejs-config.js, which the Luma template set loads through RequireJS.

Check the result:

bin/magento module:status Panth_CustomOptions

Configuration

Admin path: Stores > Configuration > Panth Extensions > Custom Options. The section is available at default, website and store view scope and is protected by the ACL resource Panth_CustomOptions::config.

General Settings

Setting Default What it does
Enable Custom Options Styling Yes Controls whether the module assigns its templates. The layout files set every option template through <action method="setTemplate" ifconfig="panth_customoptions/general/enabled">, so with Yes the Hyva set renders on Hyva themes and the Luma set on Luma, and with No the blocks keep the templates of the active theme (for a Hyva child theme, its Magento_Catalog copies; for Luma, Magento's own). The value is read at store view scope, so website and store view overrides apply.

Config path: panth_customoptions/general/enabled (default 1 in etc/config.xml).

There is no admin grid, admin form or product-form addition. Visual defaults are not admin settings; they are the keys of etc/theme-config.json:

Key Default CSS variable
custom-options-primary #0D9488 --custom-options-primary
custom-options-border #E5E7EB --custom-options-border
custom-options-border-focus #0D9488 --custom-options-border-focus
custom-options-bg #FFFFFF --custom-options-bg
custom-options-input-bg #F9FAFB --custom-options-input-bg
custom-options-text #171717 --custom-options-text
custom-options-text-muted #6B7280 --custom-options-text-muted
custom-options-label #374151 --custom-options-label
custom-options-price #0D9488 --custom-options-price
custom-options-required #EF4444 --custom-options-required
custom-options-radius 10px --custom-options-radius
custom-options-font 'DM Sans', sans-serif --custom-options-font

These variables are consumed by the Hyva template set. The Luma template set defines its own --pco-* variables inline in luma/options.phtml and does not read theme-config.json.

Uninstallation

bin/magento module:disable Panth_CustomOptions
composer remove mage2kishan/module-custom-options
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

The module creates no tables. A saved value of panth_customoptions/general/enabled remains in core_config_data. Panth_Core (mage2kishan/module-core) is left installed; remove it separately if no other Panth module needs it.

License

Free and open source under the MIT License. See LICENSE.

Developer Notes

  • Module name: Panth_CustomOptions. Composer package: mage2kishan/module-custom-options. PHP namespace: Panth\CustomOptions (the module contains no PHP classes besides registration.php).
  • Module sequence: Magento_Catalog, Panth_Core.
  • etc/frontend/di.xml adds Panth_CustomOptions to the registeredModules argument of Panth\Core\ViewModel\ThemeConfig, which is how etc/theme-config.json is picked up.
  • view/frontend/web/js/card-options.js (RequireJS module Panth_CustomOptions/js/card-options, initialised from luma/type/select.phtml for radio and checkbox options) clones each radio or checkbox input into a .panth-choice-card label, moves the text of Magento's .price-notice element (the formatted option price, in any currency) into a .panth-choice-price span, and adds the panth-input class to select.product-custom-option elements. Titles and prices are inserted as text, not HTML.
  • view/frontend/web/js/date-labels.js (RequireJS module Panth_CustomOptions/js/date-labels, initialised from luma/type/date.phtml) sets a translatable aria-label on each date and time select from the last part of its field name (month, day, year, hour, minute, day_part).
  • CSS hooks: .panth-custom-options, .panth-opt-row, .panth-opt-label, .panth-opt-price, .panth-choice-row, .panth-file-zone (Hyva set); .panth-options-container, .panth-option-group, .panth-option-label, .panth-price-badge, .panth-choice-card, .panth-file-zone, .panth-input (Luma set).
  • ACL resource: Panth_CustomOptions::config ("Panth Custom Options") under Magento_Config::config.
  • Database: no db_schema.xml, no tables.
More information
Module Category Catalog & Products
Best For All Sizes

Changelog

  1. 1.0.0, Initial release

    • Styled text inputs: <input type="text"> and <textarea> with focus rings, placeholder text, and character-count notes.
    • File upload drop-zone: drag-and-drop area with file-type and dimension hints, replacing the plain <input type="file">.
    • Select / radio / checkbox styling: drop-down selects, card-style radio rows, and card-style checkbox rows with custom indicators.
    • Native HTML5 date & time pickers: uses <input type="date">, <input type="time">, and <input type="datetime-local"> instead of legacy JS date-picker widgets.
Full history on GitHub

FAQ

Does this module change how Magento calculates custom option prices?

No. All price-delta logic continues to flow through Magento's standard priceBox and price-option JS components. This module only replaces the visual rendering.

Will it work with my existing product custom options?

Yes. All your existing custom options (set up under Admin > Catalog > Products > [Product] > Customizable Options) automatically render in the new styled UI. No migration required.

Does it support file upload validation?

Yes. Magento's native file type and size validation continues to work, with better visual feedback for the customer (file name preview, size check, remove button, error states).

Can I disable styling on specific products?

The master toggle is global. For per-product control, you can override the layout on a single product page using the standard Magento layout update XML.

Does it support Hyva child themes?

Yes. The module uses the Hyva theme parent chain - any Hyva child theme automatically inherits the styled templates.

Does it work on configurable products with custom options?

Yes. Custom options on configurable products (the parent product, not the simple variants) render with the new UI. Configurable variant selection remains Magento-native.

Is the source code available?

Yes. Full source on GitHub at github.com/mage2sk/module-custom-options.

Does it support multi-store setups?

Yes. Settings respect Magento's standard scope hierarchy (default > website > store view). Different store views can have different primary colors or even disable the styling entirely.


Kishan Savaliya

Questions before you install?

Send me your composer.json and I will check for conflicts first. Free. Installation is +$45, custom work is quoted first.

Ask on WhatsApp