I want to create configurable product with dropdown and textbox field attributes. In frontend product detail page, dropdown can be shown but I also want to show textbox. Can anyone please guide me?

  • Is that your custom field to enter value from frontend? – Rita Jose Jul 5 '17 at 12:39
  • yes, I want to enter value in frontend – jassi Jul 5 '17 at 12:43

In your custom module create an xml file like this,


In that xml file, paste the below code

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="content">
            <referenceBlock name="product.info.options">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Module_Namespace::product/view/options/type/select.phtml</argument>

Then create a template file in this path


Then you can add your custom input text field code in that file.

Eg: First name: <input type="text" name="firstname">

  • Dropdown I can make by using configurable product but problem is with input text field. I want to do using configurable product – jassi Jul 5 '17 at 13:00
  • you can also add text field here.. eg: First name: <input type="text" name="firstname"> – Rita Jose Jul 5 '17 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.