Jump to content

Disable isbn controller on combinations field


Recommended Posts

good morning, I should be able to insert any value in the isbn field of the combinations. (now it only accepts numeric). Is it possible to know what I am missing? I have already modified the following files but I still have the error if I insert an alphanumeric value.
Thanks

src\PrestaShopBundle\Form\Admin\Product/ProductOptions.php
src\PrestaShopBundle\Form\Admin\Product/ProductCombination.php
classes/Validate.php

 

Immagine 2025-04-08 155055.jpg

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

To allow alphanumeric values in the ISBN field, you need to update the validation regex inside:

 

File Path:

https://github.com/PrestaShop/PrestaShop/blob/8.2.0/src/Core/Domain/Product/ValueObject/Isbn.php 

 

and update the VALID_PATTERN variable.

 

Change:

 

`[0-9]` or `[0-9X]` => `[0-9A-Z]`

 

If you want to allow different characters, you need to update the regex accordingly.

 

Thanks

Link to comment
Share on other sites

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...