View Single Post
  #2  
Old 03-09-2016, 07:27 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Contact Form - Subject dropdown

Hello Brian,

You can do this by creating a custom module (or implementing the change via Custom Skin module).

The steps to create the module are:

1. In your module add a new class, make it extended from \XLite\View\FormField\Select\Regular and define your subject options there with their short key names.

2. Copy the skins/default/en/modules/CDev/ContactUs/contact_us/fields/field.subject.tpl template to a directory in your custom module and make it replace the default one. You can do it by adding a new "theme" from your module (http://kb.x-cart.com/display/XDD/Basic+guide+to+theme+creation), or by using the moveTemplatesInLists() method in your Main.php file.

3. The default template uses the \XLite\View\FormField\Input\Text class to render the field. In your template you should change this class to the one that you created on the first step.

4. Decorate the \XLite\Module\CDev\ContactUs\Controller\Customer\C ontactUs class from your module and make it use the real subject instead of the short key name passed by the browser to the server (see the getValue() method).

5. Re-deploy the store to make the custom module appear in the list of installed modules and enable the module.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote