View Single Post
  #2  
Old 07-13-2019, 10:09 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: Required Option/Attribute

This is about 5.3, and I don't know about in other versions. A quick look at the php code shows that there is an array defined in classes/XLite/View/FormModel/Product/Info.php called
Code:
$schema
So if you want to make required, for example, images, then you would want to set

Code:
$schema[self::SECTION_DEFAULT]['images']['required'] = true; $schema[self::SECTION_DEFAULT]['images']['constraints']['Symfony\Compon ent\Validator\Constraints\NotBlank'] = [ 'message' => static::t('This field is required'), ];
Now, unfortunately I don't know if there is a method defiend somewhere for changing this array.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote