Prevent whitespace on classifaction attribute fileds in hybris

39 Views Asked by At

I have a string classification attribute field as shown in the image

enter image description here

I need to prevent whitespaces to be saved through the field which will be affected in my pdp page and facets. Is there any way to achieve this in hybris?

1

There are 1 best solutions below

0
Adam Badura On
  1. You could create a PrepareInterceptor for ProductFeatureModel that could just remove the whitespaces from selected attribute.
  2. If the attribute has predefined set of possible values then you could consider defining them using ClassificationAttributeValue and this way preventing users from inserting invalid values