How can I add extra input fields in OpenCart contact form (under information)? Specially I want to add a telephone number field in my contact form and I've followed a tutorial but it didn't work for me. Is there any alternative?
相关问题
- PHP / OpenCart 2.2.0 - Creating custom theme
- How to clear cache in Opencart from PHP
- Opencart Fatal error: Call to a member function ge
- how to set HTTP only flag in XAMPP
- How do I save a PDF to my root file? DOMPDF
相关文章
- Is it possible to have PayPal standard expand the
- How to solve a Linux permission issue for opencart
- How can I change the original price on OpenCart pr
- How to set language through url in opencart
- OpenCart: Fatal Error: Class 'Mysqli' Line
- Adding New Modules Positions to OpenCart 2
- Fatal error: Call to undefined method Action::exec
- Specific template for category and product page in
In OC 2.x the telephone number is available to the contact template by default. I'm guessing you upgraded from an older version and kept your old theme?
To add your telephone number open up: catalog/view/theme/YOUR THEME/template/information/contact.tpl
And use the following to add telephone info (which will come from the phone # assigned in store settings).
Display the language string for "Telephone":
Display the telephone number from settings:
I know it's possible that you already resolved this issue, but this is for those who still want to add custom field to contact form.
In OpenCart 2.0 default Contact Us page (/index.php?route=information/contact) - Contact Form has only 3 fields: Your Name, E-Mail Address, and Enquiry
To add custom fields to Contact Form, you can
To add custom Telephone field to "Contact Form" in OpenCart 2.0, you would need to edit 3 files:
[YourThemeName] = Whatever theme that you selected for your store, default is "default" (You can verify or set it here: /Admin => Systems => Settings => Select your store and click Edit => Store tab => Default Layout)
1. Edit language file: \catalog\language\english\information\contact.php
a. Under line:
Add code:
b. Under line
Add code:
2. Edit control file: \catalog\controller\information\contact.php
a. Under code:
Add code:
b. Under code
Add code
c. Under code:
Add code:
d. FIND code
UPDATE code to
3. Edit template file: \catalog\view\theme[YourThemeName]\template\information\contact.tpl
a. Under line:
Add code:
After update above 3 files, just upload to your server and test. Good luck!
so edit it and make it clear.
Under File - \catalog\controller\information\contact.php : NEW CODES ADDED TO FIX Undefined variable: phone
Under Code :
Add code: