Jump to content

Change Size Ean-13 And Upc With Special Caractères


kiamaru

Recommended Posts

  • 9 months later...

Change the isEan13() and isUpc() functions in /classes/Validate.php for special characters.

 

Change values (size' => ...) for the ean13 and upc keys under 'fields' => array(... in /classes/Product.php as well as the ean13 and upc field lengths in the ps_product and ps_product_attribute tables.

 

And of course finally, use a barcode which supports special characters.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
  • 2 years later...
  • 6 months later...

Hello,

i had the same problem with ps 1.7

go to your database, find the ps_product and change the max value of ean13 column to 14

 

in src/PrestaShopBundle/Form/Admin/Product/ProductOptions.php

find

 ->add('ean13', 'Symfony\Component\Form\Extension\Core\Type\TextType', array(
            'required' => false,
            'error_bubbling' => true,
            'label' => $this->translator->trans('EAN-13 or JAN barcode', [], 'Admin.Catalog.Feature'),
            'constraints' => array(
                new Assert\Regex("/^[0-9]{0,13}$/"),
            )
        ))

 

and change new Assert\Regex("/^[0-9]{0,13}$/"), to new Assert\Regex("/^[0-9]{0,14}$/"),

 

 

then go to classes/product.php and modify

array('type' => self::TYPE_STRING, 'validate' => 'isEan13', 'size' => 13),

to

array('type' => self::TYPE_STRING, 'validate' => 'isEan13', 'size' => 14),

 

 

bye!

Matteo

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...

I have already deleted them and it still doesn't work.

 

- I have tried to increase the length in "Validate.php" and "Product.php".

- To change the length in the ps_product and ps_product_attribute tables of the database.

- To increase the length in "ProductOptions.php"

- And finally clear the cache you told me. I do not know what else to do :( 

Link to comment
Share on other sites

  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...