{"id":306067,"date":"2021-09-19T16:26:03","date_gmt":"2021-09-19T16:26:03","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=306067"},"modified":"2024-07-24T09:11:35","modified_gmt":"2024-07-24T09:11:35","slug":"display-dependent-fields-on-customer-account-edit-page","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/","title":{"rendered":"Display dependent fields on Customer Account Edit Page"},"content":{"rendered":"\n<p>Hello Friends!<br>In this blog, we will learn how we can display and update the dependent fields&#8217; values on the customer account edit information page.<br>Before continuing on this blog, please check our <a href=\"https:\/\/webkul.com\/blog\/create-dependent-attribute-fields-on-customer-registration-form\/\" target=\"_blank\" rel=\"noreferrer noopener\">Previous Blog<\/a>, in which you will learn its previous steps.<\/p>\n\n\n\n<p>To display the dependent fields on the customer account edit page, please follow the below steps.<br><br><strong>1.<\/strong> Create customer_account_edit.xml file inside the &lt;magento-root-dir&gt;\/app\/code\/Vendor\/CustomModule\/view\/frontend\/layout\/ directory.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;!--\n\/**\n * @author Vendor\n * @copyright Copyright (c) 2021 Vendor\n * @package Vendor_CustomModule\n *\/\n--&gt;\n&lt;page xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd&quot;&gt;\n    &lt;body&gt;\n        &lt;referenceContainer name=&quot;form.additional.info&quot;&gt;\n            &lt;block class=&quot;Vendor\\CustomModule\\Block\\Customer\\Form\\EditCustomerAttributes&quot;\n                   name=&quot;attribute_customer_edit&quot;\n                   template=&quot;Vendor_CustomModule::customer_attributes.phtml&quot;\n                   cacheable=&quot;false&quot; \/&gt;\n        &lt;\/referenceContainer&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;<\/pre>\n\n\n\n<p><strong>2.<\/strong> Create customer_attributes.phtml file inside the &lt;magento-root-dir&gt;\/app\/code\/Vendor\/CustomModule\/view\/frontend\/templates\/ directory.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Webkul_CustomModule\n * @author    Webkul\n * @copyright Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n$customerData = $block-&gt;getCustomerData();\n$aadharNumber = $customerData&#091;&quot;wk_custom_aadhaar_number&quot;] ?? &quot;&quot;;\n$isAadhar = $customerData&#091;&quot;wk_custom_want_to_add_aadhaar&quot;] ?? 0;\n?&gt;\n&lt;legend class=&quot;legend&quot;&gt;&lt;span&gt;Additional Information&lt;\/span&gt;&lt;\/legend&gt;\n&lt;div class=&quot;field&quot;&gt;\n    &lt;label for=&quot;wk_custom_want_to_add_aadhaar&quot; class=&quot;label&quot;&gt;\n    &lt;span&gt;&lt;?= $block-&gt;escapeHtml(__(&#039;Do you want add your aadhar number?&#039;)) ?&gt;&lt;\/span&gt;&lt;\/label&gt;\n    &lt;div class=&quot;control&quot;&gt;\n        &lt;select name=&quot;wk_custom_want_to_add_aadhaar&quot; id=&quot;wk_custom_want_to_add_aadhaar&quot; class=&quot;select&quot;&gt;\n            &lt;option value=&quot;1&quot; &lt;?= \/* @noEscape*\/ ($isAadhar==1)?&#039;selected&#039;:&#039;&#039;;?&gt; &gt;&lt;?= $block-&gt;escapeHtml(__(&#039;Yes&#039;)) ?&gt;&lt;\/option&gt;\n            &lt;option value=&quot;0&quot; &lt;?= \/*noEscape *\/ ($isAadhar==0)?&#039;selected&#039;:&#039;&#039;;?&gt;&gt;&lt;?= $block-&gt;escapeHtml(__(&#039;No&#039;)) ?&gt;&lt;\/option&gt;\n        &lt;\/select&gt;\n    &lt;\/div&gt;\n&lt;\/div&gt;\n&lt;div class=&quot;field&quot;&gt;\n    &lt;label class=&quot;label&quot; for=&quot;Aadhaar Number&quot;&gt;\n        &lt;span&gt;&lt;?= \/** @noEscape *\/ __(&#039;Aadhaar Number&#039;);?&gt;&lt;\/span&gt;\n    &lt;\/label&gt;\n    &lt;div class=&quot;control&quot;&gt;\n        &lt;input type=&quot;text&quot; name=&quot;wk_custom_aadhaar_number&quot; id=&quot;wk_custom_aadhaar_number&quot; \n               title=&quot;&lt;?= \/** @noEscape *\/ __(&#039;Aadhaar Number&#039;);?&gt;&quot; class=&quot;input-text&quot;\n               maxlength=&quot;12&quot;\n        value=&quot;&lt;?= \/* @noEscape *\/ $aadharNumber ?&gt;&quot;&gt;\n    &lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n\n\n\n<p> <strong>3.<\/strong> Create EditCustomerAttributes.php file inside the &lt;magento-root-dir&gt;\/app\/code\/Vendor\/CustomModule\/Block\/Customer\/Form\/ directory.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Vendor\\CustomModule\\Block\\Customer\\Form;\n\nuse Magento\\Backend\\Block\\Template\\Context;\nuse Magento\\Framework\\Registry;\nuse Magento\\Framework\\Data\\FormFactory;\nuse Vendor\\CustomModule\\Block\\Widget\\Form\\Renderer\\Element;\nuse Vendor\\CustomModule\\Block\\Widget\\Form\\Renderer\\Fieldset;\nuse Magento\\Eav\\Model\\Entity\\Attribute;\nuse Magento\\Customer\\Model\\AttributeMetadataDataProvider;\nuse Magento\\Framework\\ObjectManagerInterface;\nuse Magento\\Store\\Model\\StoreManagerInterface;\nuse Magento\\Catalog\\Block\\Adminhtml\\Form;\nuse Magento\\Customer\\Model\\Session;\nuse Magento\\Framework\\DataObjectFactory;\n\nclass EditCustomerAttributes extends Form\n{\n    \/**\n     * @var StoreManagerInterface\n     *\/\n    private $storeManager;\n\n    \/**\n     * @var Session\n     *\/\n    private $session;\n\n    \/**\n     * @var DataObjectFactory\n     *\/\n    private $dataObjectFactory;\n\n    \/**\n     * @var Element\n     *\/\n    private $elementRenderer;\n\n    \/**\n     * @var AttributeMetadataDataProvider\n     *\/\n    private $attributeMetadataDataProvider;\n\n    \/**\n     * @var ObjectManagerInterface\n     *\/\n    private $objectManager;\n\n    \/**\n     * @var  array\n     *\/\n    private $_customerData;\n\n    \/**\n     * @var Fieldset\n     *\/\n    private $fieldsetRenderer;\n\n    \/**\n     * Attributes constructor.\n     *\n     * @param Context $context\n     * @param Registry $registry\n     * @param Session $session\n     * @param FormFactory $formFactory\n     * @param Fieldset $fieldsetRenderer\n     * @param Element $elementRenderer\n     * @param ObjectManagerInterface $objectManager\n     * @param DataObjectFactory $dataObjectFactory\n     * @param AttributeMetadataDataProvider $attributeMetadataDataProvider\n     * @param array $data\n     *\/\n    public function __construct(\n        Context $context,\n        Registry $registry,\n        Session $session,\n        FormFactory $formFactory,\n        Fieldset $fieldsetRenderer,\n        Element $elementRenderer,\n        ObjectManagerInterface $objectManager,\n        DataObjectFactory $dataObjectFactory,\n        AttributeMetadataDataProvider $attributeMetadataDataProvider,\n        array $data = &#091;]\n    ) {\n        parent::__construct($context, $registry, $formFactory, $data);\n        $this-&gt;session           = $session;\n        $this-&gt;fieldsetRenderer  = $fieldsetRenderer;\n        $this-&gt;elementRenderer   = $elementRenderer;\n        $this-&gt;objectManager     = $objectManager;\n        $this-&gt;storeManager      = $context-&gt;getStoreManager();\n        $this-&gt;dataObjectFactory = $dataObjectFactory;\n        $this-&gt;attributeMetadataDataProvider = $attributeMetadataDataProvider;\n    }\n\n    \/**\n     * Check whether attribute is visible on front\n     *\n     * @param Attribute $attribute\n     *\n     * @return bool\n     *\/\n    public function isAttributeVisibleOnFront(Attribute $attribute)\n    {\n        $isVisibleOnFront = $attribute-&gt;getData(&#039;is_system&#039;);\n        return (!$isVisibleOnFront &amp;&amp; $attribute-&gt;getIsVisible());\n    }\n\n    protected function _prepareForm()\n    {\n        \/** @var \\Magento\\Framework\\Data\\Form $form *\/\n        $form = $this-&gt;_formFactory-&gt;create();\n        $type = &#039;customer_account_edit&#039;;\n\n        $attributes = $this-&gt;attributeMetadataDataProvider-&gt;loadAttributesCollection(\n            &#039;customer&#039;,\n            $type\n        );\n\n        if (!$attributes || !$attributes-&gt;getSize()) {\n            return;\n        }\n        $fieldset = $form-&gt;addFieldset(\n            &#039;group-fields-customer-attributes&#039;,\n            &#091;\n                &#039;class&#039; =&gt; &#039;user-defined&#039;,\n                &#039;legend&#039; =&gt; __(&#039;Additional Information&#039;)\n            ]\n        );\n        $fieldset-&gt;setRenderer($this-&gt;fieldsetRenderer);\n\n        $this-&gt;_setFieldset($attributes, $fieldset);\n        $this-&gt;prepareDependentAttributes($attributes, $fieldset);\n\n        $this-&gt;setForm($form);\n    }\n\n    \/**\n     * @inheritdoc\n     *\/\n    protected function _initFormValues()\n    {\n        if ($form = $this-&gt;getForm()) {\n            if ($this-&gt;getCustomerData()) {\n                $form-&gt;addValues($this-&gt;getCustomerData());\n            }\n            \/** @var \\Magento\\Customer\\Block\\Form\\Register $registerForm *\/\n            $registerForm = $this-&gt;getLayout()-&gt;getBlock(&#039;customer_form_register&#039;);\n            if (is_object($registerForm) &amp;&amp; $registerForm-&gt;getFormData() instanceof \\Magento\\Framework\\DataObject) {\n                $form-&gt;addValues($registerForm-&gt;getFormData()-&gt;getData());\n            }\n        }\n\n        return parent::_initFormValues();\n    }\n\n    \/**\n     * Set Fieldset to Form\n     *\n     * @param array|\\Magento\\Customer\\Model\\ResourceModel\\Form\\Attribute\\Collection $attributes\n     * $attributes - attributes that will be added\n     * @param \\Magento\\Framework\\Data\\Form\\Element\\Fieldset $fieldset\n     * @param array $exclude\n     * @return void\n     *\/\n    protected function _setFieldset($attributes, $fieldset, $exclude = &#091;])\n    {\n        $this-&gt;_addElementTypes($fieldset);\n\n        foreach ($attributes as $attribute) {\n            \/** @var $attribute \\Magento\\Eav\\Model\\Entity\\Attribute *\/\n            if (!$this-&gt;isAttributeVisibleOnFront($attribute)) {\n                continue;\n            }\n            $attribute-&gt;setStoreId($this-&gt;storeManager-&gt;getStore()-&gt;getId());\n\n            if ($inputType = $attribute-&gt;getFrontend()-&gt;getInputType()) {\n                $rendererClass = $attribute-&gt;getFrontend()-&gt;getInputRendererClass();\n                \n                if ($inputType == &quot;boolean&quot; || $inputType == &quot;date&quot; || $inputType == &quot;datetime&quot;) {\n                    $fieldType = &#039;Webkul\\CustomModule\\Block\\Data\\Form\\Element\\\\&#039; . ucfirst($inputType);\n                } else {\n                    $fieldType = &#039;Magento\\Framework\\Data\\Form\\Element\\\\&#039; . ucfirst($inputType);\n                }\n                \n                if (!empty($rendererClass)) {\n                    $fieldType = $inputType . &#039;_&#039; . $attribute-&gt;getAttributeCode();\n                    $fieldset-&gt;addType($fieldType, $rendererClass);\n                }\n\n                $data = &#091;\n                    &#039;name&#039; =&gt; $attribute-&gt;getAttributeCode(),\n                    &#039;label&#039; =&gt; $attribute-&gt;getStoreLabel(),\n                    &#039;class&#039; =&gt; $attribute-&gt;getFrontend()-&gt;getClass(),\n                    &#039;required&#039; =&gt; $attribute-&gt;getIsRequired() || $attribute-&gt;getRequiredOnFront(),\n                    &#039;note&#039; =&gt; $attribute-&gt;getNote()\n                ];\n                \n                $element = $fieldset-&gt;addField(\n                    $attribute-&gt;getAttributeCode(),\n                    $fieldType,\n                    $data\n                )-&gt;setEntityAttribute(\n                    $attribute\n                );\n\n                $element-&gt;setValue($attribute-&gt;getDefaultValue());\n                $element-&gt;setRenderer($this-&gt;elementRenderer);\n                $element-&gt;setAfterElementHtml($this-&gt;_getAdditionalElementHtml($element));\n\n                \/* add options format *\/\n                $this-&gt;_applyTypeSpecificConfig($inputType, $element, $attribute);\n            }\n        }\n    }\n\n    \/**\n     * {@inheritdoc}\n     *\/\n    protected function _applyTypeSpecificConfig($inputType, $element, Attribute $attribute)\n    {\n        switch ($inputType) {\n            case &#039;select&#039;:\n                $element-&gt;addElementValues($attribute-&gt;getSource()-&gt;getAllOptions(true, false));\n                break;\n            case &#039;multiselect&#039;:\n                $element-&gt;addElementValues($attribute-&gt;getSource()-&gt;getAllOptions(false, false));\n                $element-&gt;setCanBeEmpty(true);\n                break;\n            default:\n                break;\n        }\n    }\n\n    \/**\n     * @param \\Magento\\Customer\\Model\\ResourceModel\\Form\\Attribute\\Collection $attributes\n     * @param \\Magento\\Framework\\Data\\Form\\Element\\Fieldset $fieldset\n     *\/\n    protected function prepareDependentAttributes($attributes, $fieldset)\n    {\n        $depends = &#091;];\n        $attributeIds = $attributes-&gt;getColumnValues(&#039;attribute_id&#039;);\n        if (empty($attributeIds)) {\n            return;\n        }\n        \/\/you can add array options dynamically as per your need\n        $depends&#091;] = &#091;\n            &#039;parent_attribute_id&#039; =&gt; 163,\n            &#039;parent_attribute_code&#039; =&gt; &#039;wk_custom_want_to_add_aadhaar&#039;,\n            &#039;parent_option_id&#039; =&gt; 1,\n            &#039;depend_attribute_id&#039; =&gt; 162,\n            &#039;depend_attribute_code&#039; =&gt; &#039;wk_custom_aadhaar_number&#039;\n        ];\n        \n        if (!empty($depends)) {\n            $fieldset-&gt;setData(&#039;depends&#039;, $depends);\n        }\n    }\n\n    \/**\n     * @return array\n     *\/\n    private function getCustomerData()\n    {\n        if (!isset($this-&gt;_customerData)) {\n            $this-&gt;_customerData = &#091;];\n            if ($this-&gt;session-&gt;isLoggedIn()) {\n                $this-&gt;_customerData = $this-&gt;session-&gt;getCustomer()-&gt;getData();\n            }\n        }\n\n        return $this-&gt;_customerData;\n    }\n}<\/pre>\n\n\n\n<p><strong>4.<\/strong> Now, see the result in the following image.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1031\" height=\"1024\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-1031x1024.png\" alt=\"Account-Informat-1-1\" class=\"wp-image-306651\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-1031x1024.png 1031w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-300x298.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-250x249.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-768x763.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-1536x1526.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-120x120.png 120w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1.png 1920w\" sizes=\"(max-width: 1031px) 100vw, 1031px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Hope this will be helpful. Thanks \ud83d\ude42<\/p>\n\n\n\n<p><strong>Previous Blog:<\/strong> <a href=\"https:\/\/webkul.com\/blog\/create-dependent-attribute-fields-on-customer-registration-form\/\" target=\"_blank\" rel=\"noreferrer noopener\">Create Dependent Attribute Fields on Customer Registration Form<\/a><\/p>\n\n\n\n<p><strong>Next Blog:<\/strong> <a href=\"https:\/\/webkul.com\/blog\/add-custom-column-in-customer-grid\/\" target=\"_blank\" rel=\"noreferrer noopener\">Add Custom Column in Customer Grid<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello Friends!In this blog, we will learn how we can display and update the dependent fields&#8217; values on the customer account edit information page.Before continuing on this blog, please check our Previous Blog, in which you will learn its previous steps. To display the dependent fields on the customer account edit page, please follow the <a href=\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":249,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121],"tags":[12076,12075,7244,12073,12072],"class_list":["post-306067","post","type-post","status-publish","format-standard","hentry","category-magento-2","tag-customer-custom-attributes","tag-customer-edit-attributes","tag-dependable-field-in-magento2","tag-dependent-attributes","tag-dependent-fields"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Display dependent fields on Customer Account Edit Page - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Display dependent fields on Customer Account Edit Page, how to display dependent field on customer edit page\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Display dependent fields on Customer Account Edit Page - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Display dependent fields on Customer Account Edit Page, how to display dependent field on customer edit page\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-19T16:26:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-24T09:11:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-1031x1024.png\" \/>\n<meta name=\"author\" content=\"Khushboo Sahu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khushboo Sahu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/\"},\"author\":{\"name\":\"Khushboo Sahu\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca\"},\"headline\":\"Display dependent fields on Customer Account Edit Page\",\"datePublished\":\"2021-09-19T16:26:03+00:00\",\"dateModified\":\"2024-07-24T09:11:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/\"},\"wordCount\":153,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-1031x1024.png\",\"keywords\":[\"customer custom attributes\",\"customer edit attributes\",\"dependable field in magento2\",\"dependent attributes\",\"dependent fields\"],\"articleSection\":[\"Magento 2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/\",\"url\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/\",\"name\":\"Display dependent fields on Customer Account Edit Page - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-1031x1024.png\",\"datePublished\":\"2021-09-19T16:26:03+00:00\",\"dateModified\":\"2024-07-24T09:11:35+00:00\",\"description\":\"Display dependent fields on Customer Account Edit Page, how to display dependent field on customer edit page\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1.png\",\"width\":1920,\"height\":1907,\"caption\":\"Account-Informat-1-1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Display dependent fields on Customer Account Edit Page\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca\",\"name\":\"Khushboo Sahu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Khushboo Sahu\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Display dependent fields on Customer Account Edit Page - Webkul Blog","description":"Display dependent fields on Customer Account Edit Page, how to display dependent field on customer edit page","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/","og_locale":"en_US","og_type":"article","og_title":"Display dependent fields on Customer Account Edit Page - Webkul Blog","og_description":"Display dependent fields on Customer Account Edit Page, how to display dependent field on customer edit page","og_url":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-09-19T16:26:03+00:00","article_modified_time":"2024-07-24T09:11:35+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-1031x1024.png","type":"","width":"","height":""}],"author":"Khushboo Sahu","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Khushboo Sahu","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/"},"author":{"name":"Khushboo Sahu","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca"},"headline":"Display dependent fields on Customer Account Edit Page","datePublished":"2021-09-19T16:26:03+00:00","dateModified":"2024-07-24T09:11:35+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/"},"wordCount":153,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-1031x1024.png","keywords":["customer custom attributes","customer edit attributes","dependable field in magento2","dependent attributes","dependent fields"],"articleSection":["Magento 2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/","url":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/","name":"Display dependent fields on Customer Account Edit Page - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1-1031x1024.png","datePublished":"2021-09-19T16:26:03+00:00","dateModified":"2024-07-24T09:11:35+00:00","description":"Display dependent fields on Customer Account Edit Page, how to display dependent field on customer edit page","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/Account-Informat-1-1.png","width":1920,"height":1907,"caption":"Account-Informat-1-1"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/display-dependent-fields-on-customer-account-edit-page\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Display dependent fields on Customer Account Edit Page"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca","name":"Khushboo Sahu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Khushboo Sahu"},"url":"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/306067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/249"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=306067"}],"version-history":[{"count":7,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/306067\/revisions"}],"predecessor-version":[{"id":375133,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/306067\/revisions\/375133"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=306067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=306067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=306067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}