Post by rajeshsangtiani » Mon Jun 11, 2018 11:51 pm

Hello All,

I want to add a phone field in the contact form of opencart 3.0.2.0.

How can I do it ?

go to cialispascherfr24 pharmacy


New member

Posts

Joined
Mon Apr 09, 2018 4:07 am

Post by straightlight » Mon Jun 11, 2018 11:57 pm

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


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rajeshsangtiani » Tue Jun 12, 2018 12:00 am

This is not compitable for opencart 3.0.2.0

go to cialispascherfr24 pharmacy


New member

Posts

Joined
Mon Apr 09, 2018 4:07 am

Post by DigitCart » Tue Jun 12, 2018 12:02 am

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

Image

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by rajeshsangtiani » Tue Jun 12, 2018 5:22 am

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

go to cialispascherfr24 pharmacy


New member

Posts

Joined
Mon Apr 09, 2018 4:07 am

Post by sw!tch » Tue Jun 12, 2018 10:37 am

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.

Code: Select all

$mail->setText($this->request->post['enquiry']);
If you want phone as well, then you need to append something like below.

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);
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.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by Nina_Nelson » Sun Nov 11, 2018 6:10 pm

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.

Newbie

Posts

Joined
Mon Oct 01, 2018 8:58 pm
Who is online

Users browsing this forum: No registered users and 411 guests