Hello All,
I want to add a phone field in the contact form of opencart 3.0.2.0.
How can I do it ?
I want to add a phone field in the contact form of opencart 3.0.2.0.
How can I do it ?
See this extension: https://www.opencart.com/index.php?rout ... n_id=27735 . It can be easily adapted with OC v3.x releases by using the template switcher extension from the Marketplace.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hi,
You need to edit these files:
catalog\controller\information\contact.php
catalog\view\theme\default\template\information\contact.twig
You can learn from/duplicate the "name" field.
Also I have a commercial extension that can do this:
https://www.opencart.com/index.php?rout ... n_id=32828
You need to edit these files:
catalog\controller\information\contact.php
catalog\view\theme\default\template\information\contact.twig
You can learn from/duplicate the "name" field.
Also I have a commercial extension that can do this:
https://www.opencart.com/index.php?rout ... n_id=32828
I was follow your instructions & successfully add phone field in contact us but when I sent inquiry to store owner I did not receive phone number in my admin email address
Kindly help me how I get customer mobile number in inquiry mail
Thanks
Kindly help me how I get customer mobile number in inquiry mail
Thanks
The default contact form only sends post-> enquiry as the message body.
(e.g You can see the default $mail method is like below in the contact controller.
If you want phone as well, then you need to append something like below.
The above assumes phone is required if its not required then you may need to work conditional logic in. You should probably sanitize it as well in your validate function.
Untested, backup try at your own risk.
(e.g You can see the default $mail method is like below in the contact controller.
Code: Select all
$mail->setText($this->request->post['enquiry']);
Code: Select all
// Construct Message
$message = $this->request->post['enquiry']."\n"; // enquiry field here
$message .= $this->request->post['phone']."\n"; // phone here
$mail->setText($message);
Untested, backup try at your own risk.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Hey.
Try to add Elfsight Form Builder to your site: https://elfsight.com/online-form-builder.
I had no problems with its customization and use.
All data is always sent to the specified email address.
Try to add Elfsight Form Builder to your site: https://elfsight.com/online-form-builder.
I had no problems with its customization and use.
All data is always sent to the specified email address.
Who is online
Users browsing this forum: No registered users and 411 guests