We are using Magento 2 Enterprise Edition and created some of the custom customer attributes via admin panel (it's one of the feature in enterprise edition though it's not available in community edition).
I can see all the new custom attributes in frontend. However, when I fill in the data and try to save, it's not getting saving but when I do the same process that is saving the data via the admin panel, it's saving without any issues.
So why am I not able to save the data from the frontend?
Any help will be appreciated!
<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->create('Magento\Customer\Model\Session');
$customergroupid = '';
if ($customerSession->isLoggedIn()) {
$customergroupid = $customerSession->getCustomer()->getGroupId();
}
?>
<?php if(($customergroupid == x) || ($customergroupid == y)): ?>
<?php if ($block->hasUserDefinedAttributes()): ?>
<?php if ($block->isShowContainer()): ?>
<fieldset class="fieldset">
<?php endif;?>
<?php foreach ($block->getUserDefinedAttributes() as $attribute):?>
<?php $attributeContent = $block->getAttributeHtml($attribute);?>
<?php if ($attributeContent): ?>
<?= /* @escapeNotVerified */ $attributeContent ?>
<?php endif;?>
<?php endforeach;?>
<?php if ($block->isShowContainer()): ?>
</fieldset>
<?php endif;?>
<?php endif; ?>
<?php endif; ?>