| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Change widget class of some field in Checkout | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Change widget class of some field in Checkout
I want to change the Field City widget class from
\XLite\View\FormField\Input\Text into \XLite\View\FormField\Select\MyCustomClass(). Is there a way to do this job ?
__________________
alex |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Change widget class of some field in Checkout
Hi @Alex,
Try to update 'schemaClass' column in the xc_address_field MySQL table for 'city' field. These values are defined by the sql/xlite_data.yaml file, which is loaded during installation, so the new value should not be overwritten by store re-deployment. Tony Quote:
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#3
|
|||||||
|
|||||||
Re: Change widget class of some field in Checkout
Quote:
Yes, this is was the solution that i found and use but still remains a problem because when i finish my module i want to install in an production env and there i don't have the access to go and hard-code the yaml file. I need a solution if can be posible to do this task when i deploy the module.
__________________
alex |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Change widget class of some field in Checkout
Quote:
There are several ways how to overcome the problem. 1) Decorate \XLite\Model\AddressField class and define its getSchemaClass() method as follows: Code:
2) In your module's Main.php file create runBuildCacheHandler() method that will change 'schemaClass' property of the Address Field. Here is an example script that shows how you can change 'schemaClass' property for 'city' address field: Code:
So, in your module you should define 'schemaClass' as your own value, if the module is enabled: Code:
or if your module is inactive, then you define 'schemaClass' as usual '\XLite\View\FormField\Input\Text'. Please, let me know if it makes sense to you. Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|