Skip to content

Commit 7e478f6

Browse files
author
Vadim Zubovich
committed
MAGNSWTC-17: Add ability to change Input type while saving attribute
1 parent 528a394 commit 7e478f6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ public function execute()
167167

168168
$data['attribute_code'] = $model->getAttributeCode();
169169
$data['is_user_defined'] = $model->getIsUserDefined();
170+
if (isset($data['frontend_input'])) {
171+
$model->changeFrontendType($data['frontend_input']);
172+
}
170173
$data['frontend_input'] = $model->getFrontendInput();
171174
} else {
172175
/**

app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,17 @@ public function setDefaultValue($defaultValue)
338338
return $this->setData('default_value', $defaultValue);
339339
}
340340

341+
/**
342+
* Change Attribute Fronted input type
343+
*
344+
* @param string $value
345+
* @return $this
346+
*/
347+
public function changeFrontendType($value)
348+
{
349+
return $this;
350+
}
351+
341352
/**
342353
* @return int
343354
*/

0 commit comments

Comments
 (0)