![]() |
Contact Form - Subject dropdown
I'd like to modify the basic contact form so users can select a subject title from a dropdown form selector list; the subject would then become the subject of the email sent from the form. Can this be done?
This is with the latest X-Cart 5. |
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. |
Re: Contact Form - Subject dropdown
Thank you. I will attempt to make this modification in the next week.
|
Re: Contact Form - Subject dropdown
I have attempted to start this process by following the module creation documentation located here:
http://kb.x-cart.com/display/XDD/Step+1+-+creating+simplest+module http://kb.x-cart.com/display/XDD/Step+2+-+applying+design+changes http://kb.x-cart.com/display/XDD/Step+3+-+applying+logic+changes the problem is I cannot enable my module. It simply will not turn on when I click on "enable" |
Re: Contact Form - Subject dropdown
Quote:
Could you please send it here? |
All times are GMT -8. The time now is 10:22 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.