| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Extend registration form | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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 |
|||||||
#4
|
|||||||
|
|||||||
Re: Extend registration form
Quote:
Any idea how to set parameters in this case, to filter only US states, for instance? Thanks!
__________________
X-cart 5.3.2.9 Multivendor |
|||||||
#5
|
|||||||||
|
|||||||||
Re: Extend registration form
Look in the class - it has filter for country I believe
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#6
|
|||||||
|
|||||||
Re: Extend registration form
Quote:
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 |
|||||||
#7
|
|||||||||
|
|||||||||
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 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|