Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Extend registration form

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 05-15-2017, 05:01 AM
 
mm23456 mm23456 is offline
 

Member
  
Join Date: May 2017
Posts: 11
 

Default Extend registration form

Hi,

I'd like to extend vendor registration form with address details and some custom attributes. I can redefine form schema but cannot create valid State field which would include list of US states.

I tried setting a new field as:

$this->mainSchema['state'] = array(

self::SCHEMA_CLASS=>'\XLite\View\FormField\Listbox \State',
self::SCHEMA_LABEL => 'State',
self::SCHEMA_REQUIRED => false,
self::SCHEMA_MODEL_ATTRIBUTES => array(
\XLite\View\FormField\Input\Base\StringInput::PARA M_MAX_LENGTH => 'length',
);

);

But somehow, this is what I get:

http://i.imgur.com/A5tEl9O.jpg

Any ideas?

Thanks!
__________________
X-cart 5.3.2.9
Multivendor
Reply With Quote
  #2  
Old 05-15-2017, 05:20 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Extend registration form

Listbox will have that. Try \XLite\View\FormField\Select\State
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
mm23456 (05-15-2017)
  #3  
Old 05-15-2017, 05:37 AM
 
xim xim is offline
 

X-Cart team
  
Join Date: Nov 2004
Posts: 677
 

Default Re: Extend registration form

533 version will have "become a vendor" registration page. 533 will be released on June 1st.
__________________
Sincerely yours, Max Vydrin
Reply With Quote

The following user thanks xim for this useful post:
mm23456 (05-15-2017)
  #4  
Old 05-15-2017, 10:30 AM
 
mm23456 mm23456 is offline
 

Member
  
Join Date: May 2017
Posts: 11
 

Default Re: Extend registration form

Quote:
Originally Posted by cflsystems
Listbox will have that. Try \XLite\View\FormField\Select\State

Any idea how to set parameters in this case, to filter only US states, for instance?

Thanks!
__________________
X-cart 5.3.2.9
Multivendor
Reply With Quote
  #5  
Old 05-15-2017, 11:30 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Extend registration form

Look in the class - it has filter for country I believe
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #6  
Old 05-15-2017, 11:34 AM
 
mm23456 mm23456 is offline
 

Member
  
Join Date: May 2017
Posts: 11
 

Default Re: Extend registration form

Quote:
Originally Posted by cflsystems
Look in the class - it has filter for country I believe

It does, it has a parameter country, but I am not sure how to set it if I am instantiating class in schema. I tried to add it to model attributes, but it does not make a lot of sense:

$this->mainSchema['state'] = array(

self::SCHEMA_CLASS => '\XLite\View\FormField\Select\State',
self::SCHEMA_LABEL => 'State',
self::SCHEMA_REQUIRED => false,
self::SCHEMA_MODEL_ATTRIBUTES => array(
\XLite\View\FormField\Input\Base\StringInput::PARA M_MAX_LENGTH => 'length',
\XLite\View\FormField\Select\State::PARAM_COUNTRY => new \XLite\Model\WidgetParam\TypeString('Country', 'US')
)

);
__________________
X-cart 5.3.2.9
Multivendor
Reply With Quote
  #7  
Old 05-15-2017, 11:47 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Extend registration form

try

\XLite\View\FormField\Select\State::PARAM_COUNTRY => 'US'

I would actually create new class based on State.php within your module and either hardcode the country in there or search for active countries to get states for them.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:09 PM.

   

 
X-Cart forums © 2001-2020