| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Contact Form - Subject dropdown | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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.
__________________
Brian X-Cart Business 5.2.10 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() 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 |
|||||||||
#3
|
|||||||
|
|||||||
![]() Thank you. I will attempt to make this modification in the next week.
__________________
Brian X-Cart Business 5.2.10 |
|||||||
#4
|
|||||||
|
|||||||
![]() 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"
__________________
Brian X-Cart Business 5.2.10 |
|||||||
#5
|
|||||||||
|
|||||||||
![]() Quote:
Could you please send it here?
__________________
Best regards, Igor Pudovkin X-Cart hosting team |
|||||||||
|
|||
X-Cart forums © 2001-2020
|