Jump to content

validation problem


Graphics Back Label

Recommended Posts

hi i just had to activate a private shop module i found on my prestashop but i have a problem...

 

it uses prestashop's validation files so i can't set my camps as not required, how can i fix this?

Hi Graphics Back Label,

 

You can edit the "Private Shop" module and you can remove the validation for particular field. Prestashop validation will refer the "Validate.php" class file only So remove validation for particular field

Link to comment
Share on other sites

Hi Graphics Back Label,

 

You can edit the "Private Shop" module and you can remove the validation for particular field. Prestashop validation will refer the "Validate.php" class file only So remove validation for particular field

yea that was my intention but i can't find where the module wrote to get the validation from prestashop...

Link to comment
Share on other sites

Ok, i will check for you in that private shop module for validation part. So pls share those private shop modules files and share the screenshot of exactly which field doesn't need the validation.

thank you... really  just knowing where it's wrote to get prestashop validations would be enough cause my intention was to create a second validation file and link the private shop to that one instead of the original...

PrivateShop.php

index.php

PrivateShopForm.php

Link to comment
Share on other sites

thank you... really  just knowing where it's wrote to get prestashop validations would be enough cause my intention was to create a second validation file and link the private shop to that one instead of the original...

attachicon.gifPrivateShop.php

attachicon.gifindex.php

attachicon.gifPrivateShopForm.php

Hi Graphics Back Label,

 

Which field are you referring as "camps" field. can you post me the screenshot with that field.

Link to comment
Share on other sites

basically all the fields beside the first 4 needs to be removed and not validated but only on this page not the official login...

attachicon.gifSchermata 2016-09-29 alle 10.18.05.png

In privateshop.php file i have find only email field and i have set those field 'required' => false and i don't find any fields like firstname, lastname except e-mail field So may be those fields will be called from core validation file so you can set those fields 'required' => false to remove validation for fields like firstname and lastname.

 

public static $definition = array(

        'table'          => 'privateshop',

        'primary'        => 'id',

        'multilang'      => false,

        'multilang_shop' => false,

        'fields'    => array(

            'email'          => array('type' => self::TYPE_STRING    , 'validate' => 'isMessage', 'required' => false, 'size' => 255),

            'datas'          => array('type' => self::TYPE_STRING, 'required' => false),

            'active_code'    => array('type' => self::TYPE_STRING    , 'validate' => 'isMessage', 'size' => 255),

            'id_guest'       => array('type' => self::TYPE_STRING    , 'validate' => 'isMessage', 'size' => 255),

            'id_customer'    => array('type' => self::TYPE_STRING    , 'validate' => 'isMessage', 'size' => 255),

            'id_connections' => array('type' => self::TYPE_STRING    , 'validate' => 'isMessage', 'size' => 255),

            'is_valid'       => array('type' => self::TYPE_BOOL        , 'validate' => 'isBool'),

            'is_valid_mail'  => array('type' => self::TYPE_BOOL        , 'validate' => 'isBool'),

            'is_active'      => array('type' => self::TYPE_BOOL        , 'validate' => 'isBool'),

            'is_active_mail' => array('type' => self::TYPE_BOOL        , 'validate' => 'isBool'),

            'id_shop'        => array('type' => self::TYPE_INT        , 'validate' => 'isUnsignedId'),

            'id_shop_group'  => array('type' => self::TYPE_INT        , 'validate' => 'isUnsignedId'),

            'date_add'       => array('type' => self::TYPE_DATE        , 'validate' => 'isDate', 'copy_post' => false),

            'date_upd'       => array('type' => self::TYPE_DATE        , 'validate' => 'isDate', 'copy_post' => false)

        )

    );

 

So please try the above solution and you can also remove validation for other fields by setting 'required' => false

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