I need the product's EAN13 fields to be validated exactly as the "Reference" fields.
-
First thing I've tried is changing the validate function and size from isEan13 to isReference in Product class:
'ean13' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 64),
It did not work.
-
Then I've tried to change the isEan13() function return value to the same preg_match that isReference() has in Validate class, since isEan13 is being called from different files as well:
public static function isEan13($ean13) { error_log('Validating EAN'); return !$ean13 || preg_match(Tools::cleanNonUnicodeSupport('/^[^<>;={}]*$/u'), $ean13); }
I've actually even added an error_log debug output, which is not in the log at all, as if the function is not triggered at all.
I've also reset the cache after each change. The result is always "This value is not valid." with 400 Bad Request.
I double checked whether I am correctly editing default classes/overrides. I even tried to manually edit those classes in admin/autoupgrade/latest/classes folder, since they are there as well.
What could be the issue?