Skip to content

Commit 1fd0e08

Browse files
committed
Suggestions by justing, adding color also for products attributes
1 parent ad626dc commit 1fd0e08

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

app/code/core/Mage/Catalog/Helper/Product.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,14 @@ public function getAttributeInputTypes($inputType = null)
253253
* @todo specify there all relations for properties depending on input type
254254
*/
255255
$inputTypes = [
256-
'multiselect' => [
257-
'backend_model' => 'eav/entity_attribute_backend_array'
258-
],
259256
'boolean' => [
260257
'source_model' => 'eav/entity_attribute_source_boolean'
258+
],
259+
'color' => [
260+
'backend_model' => 'eav/entity_attribute_backend_color'
261+
],
262+
'multiselect' => [
263+
'backend_model' => 'eav/entity_attribute_backend_array'
261264
]
262265
];
263266

app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public function toOptionArray()
3737
['value' => 'date', 'label' => Mage::helper('eav')->__('Date')],
3838
['value' => 'boolean', 'label' => Mage::helper('eav')->__('Yes/No')],
3939
['value' => 'multiselect', 'label' => Mage::helper('eav')->__('Multiple Select')],
40-
['value' => 'select', 'label' => Mage::helper('eav')->__('Dropdown')]
40+
['value' => 'select', 'label' => Mage::helper('eav')->__('Dropdown')],
41+
['value' => 'color', 'label' => Mage::helper('eav')->__('Color')]
4142
];
4243
}
4344
}

app/code/core/Mage/Eav/Model/Entity/Attribute.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ public function getBackendTypeByInput($type)
232232
case 'text':
233233
case 'gallery':
234234
case 'media_image':
235+
case 'color':
235236
$field = 'varchar';
236237
break;
237238

app/code/core/Mage/Eav/etc/config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
<boolean>boolean</boolean>
142142
<multiselect>multiselect</multiselect>
143143
<select>select</select>
144+
<color>color</color>
144145
</input_types>
145146
</validator_data>
146147
</general>

0 commit comments

Comments
 (0)