- Members
- 0
- 21 messaggi
Solution:
//////////////////////////////////////////////////////////////////////
make the following changes
FILE: classes/Validate.php
public static function isEan13($ean13) { return !$ean13 || preg_match('/^[0-9]{0,13}$/', $ean13); }
it becomes
public static function isEan13($ean13)
{
return !$ean13 || preg_match('/^[a-zA-Z0-9]{0,13}$/', $ean13);
}
//////////////////////////////////////////////////////////////////////
FILE: src\PrestaShopBundle\Form\Admin\Product/ProductOptions.php
->add('ean13', FormType\TextType::class, [
'required' => false,
'error_bubbling' => true,
'label' => $this->translator->trans('EAN-13 or JAN barcode', [], 'Admin.Catalog.Feature'),
'constraints' => [
new Assert\Regex('/^[0-9]{0,13}$/'),
],
'empty_data' => '',
])
it becomes
->add('ean13', FormType\TextType::class, [
'required' => false,
'error_bubbling' => true,
'label' => $this->translator->trans('EAN-13 or JAN barcode', [], 'Admin.Catalog.Feature'),
'constraints' => [
new Assert\Regex('/^[a-zA-Z0-9]{0,13}$/'),
],
'empty_data' => '',
])
//////////////////////////////////////////////////////////////////////