Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Contact Form - Subject dropdown

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 02-17-2016, 02:56 PM
 
slenderfungus slenderfungus is offline
 

Advanced Member
  
Join Date: Jul 2004
Posts: 31
 

Default 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.
__________________
Brian
X-Cart Business 5.2.10
Reply With Quote
  #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
  #3  
Old 03-11-2016, 03:32 PM
 
slenderfungus slenderfungus is offline
 

Advanced Member
  
Join Date: Jul 2004
Posts: 31
 

Default Re: Contact Form - Subject dropdown

Thank you. I will attempt to make this modification in the next week.
__________________
Brian
X-Cart Business 5.2.10
Reply With Quote
  #4  
Old 05-19-2016, 02:54 PM
 
slenderfungus slenderfungus is offline
 

Advanced Member
  
Join Date: Jul 2004
Posts: 31
 

Default 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"
__________________
Brian
X-Cart Business 5.2.10
Reply With Quote
  #5  
Old 05-22-2016, 03:30 PM
  razortw's Avatar 
razortw razortw is offline
 

X-Cart team
  
Join Date: Feb 2015
Posts: 807
 

Default Re: Contact Form - Subject dropdown

Quote:
Originally Posted by slenderfungus
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"
Are you sure you are not missing anything in Main.php file?
Could you please send it here?
__________________
Best regards,
Igor Pudovkin
X-Cart hosting team
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:01 AM.

   

 
X-Cart forums © 2001-2020