I have just created a custom attribute (standard text field) on a simple product. I'd like to limit this field to 80 characters as it's to be used as an eBay title to integrate with eBay.
I only want to limit this field though, not all text fields.
Can someone advise how I can do this?
Thanks
Best Answer
To my knowledge Magento does not allow the limiting of lengths for EAV attributes. For a varchar this gets stored in the table
catalog_product_entity_varchar
which has the definitionvalue => varchar(255)
.One option you could do is to add a backend model for this attribute. In this model you could write your own
beforeSave
function that will process the length of given value and trim it to be the desired length. The class should extendMage_Eav_Model_Entity_Attribute_Backend_Abstract