Post by krneki » Tue Jan 14, 2014 2:14 am

I'd like to have mandatory telephone field in contact form, so customers who'd like to contact me would also have to insert their telephone number.

Would that be hard to implement?
Last edited by krneki on Tue Jan 14, 2014 10:24 pm, edited 1 time in total.

Active Member

Posts

Joined
Tue Jul 17, 2012 9:58 pm

Post by pedro1993 » Tue Jan 14, 2014 10:19 am

I couldn't find an extension that does this, however you could do this:

http://forum.opencart.com/viewtopic.php?f=29&t=2648

All the best,
Peter

For professional OpenCart, HTML/CSS & PHP/MySQL support feel free to PM me :)
Click here for my extentions
Did I help you? Donate here to show support
Follow me on Twitter!
Catch me on Facebook!
Watch YouTube OpenCart Tutorials and Extension Demos

Image


User avatar
Active Member

Posts

Joined
Tue Oct 18, 2011 4:31 am
Location - Glasgow, Scotland

Post by pedro1993 » Tue Jan 14, 2014 11:11 am

Sorry that link won't actually do it I misread. I will work on an extension like this starting tomorrow :)

Peter

For professional OpenCart, HTML/CSS & PHP/MySQL support feel free to PM me :)
Click here for my extentions
Did I help you? Donate here to show support
Follow me on Twitter!
Catch me on Facebook!
Watch YouTube OpenCart Tutorials and Extension Demos

Image


User avatar
Active Member

Posts

Joined
Tue Oct 18, 2011 4:31 am
Location - Glasgow, Scotland

Post by pprmkr » Tue Jan 14, 2014 5:32 pm

krneki wrote:I'd like to have mandatory telephone field in contact form, so customers who'd like to contact me would also have to insert their telephone number.

Would that be hard to implement?
Hardest thing is validating phone number.

Try attached vQmod, it:

- add input field to form
- checks input, allowed: digits, countrycode with () or + and digits seperated by -
- adds phonenumber to mail->text
- tested on 1.5.3.1 and 1.5.6.1

Attachments


User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by krneki » Tue Jan 14, 2014 6:53 pm

Thanks a lot for this extension! I actually wouldn't even need phone number validation, but if it's there, let it be. I would just need to allow one more sign: /

So how should I edit this line?

Code: Select all

if (!preg_match('/^[\d|\+|\(]+[\)|\d|\s|-]*[\d]$/', $this->request->post['phonenumber'])) {
Are spaces between numbers allowed?

Active Member

Posts

Joined
Tue Jul 17, 2012 9:58 pm

Post by pprmkr » Tue Jan 14, 2014 7:35 pm

Change into:

Code: Select all

if (!preg_match('/^[\d|\+|\(]+[\)|\d|\s|\W|-]*[\d]$/', $this->request->post['phonenumber'])) {
Added \W - Any non-word character

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by krneki » Tue Jan 14, 2014 10:24 pm

Thanks a lot, it works perfectly fine ;) ! What a pleasant surprise to get free support here.

Active Member

Posts

Joined
Tue Jul 17, 2012 9:58 pm

Post by pedro1993 » Wed Jan 15, 2014 7:49 am

I'm about to start an extension where you can add contact fields :)

For professional OpenCart, HTML/CSS & PHP/MySQL support feel free to PM me :)
Click here for my extentions
Did I help you? Donate here to show support
Follow me on Twitter!
Catch me on Facebook!
Watch YouTube OpenCart Tutorials and Extension Demos

Image


User avatar
Active Member

Posts

Joined
Tue Oct 18, 2011 4:31 am
Location - Glasgow, Scotland

Post by Gilmore » Thu Jan 23, 2014 5:30 am

This one will add the phone number, but what people really need on the contact form is their Order Number.
http://forum.opencart.com/viewtopic.php?f=131&t=35286

IT would be nice if they started typing their name and then it would fill it out for them and let them pick an order number! Like it does in the Admin when you look for a Customer.

Thanks!

Gilmore


User avatar
Active Member

Posts

Joined
Thu Aug 12, 2010 7:33 am

Post by Harlekijntje » Fri Jan 24, 2014 3:52 pm

Great extension but it does not work for me...

Hope that someone can help.

I get the error: SEARCH NOT FOUND (ABORTING MOD): <b><?php echo $entry_enquiry; ?></b><br />

Thanks, Henri

Newbie

Posts

Joined
Sat Jan 18, 2014 1:32 am

Post by pprmkr » Fri Jan 24, 2014 9:55 pm

Compare contact.tpl form used theme with default contact.tpl

Search for

Code: Select all

<?php echo $entry_enquiry; ?>
Copy line where you find the code.

Edit xml

Code: Select all

<search position="before"><![CDATA[<b><?php echo $entry_enquiry; ?></b><br />]]></search>
Replace code

Code: Select all

<search position="before"><![CDATA[NEW_CODE_HERE]]></search>

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by luizeduardo » Tue May 20, 2014 1:31 am

pprmkr wrote:
krneki wrote:I'd like to have mandatory telephone field in contact form, so customers who'd like to contact me would also have to insert their telephone number.

Would that be hard to implement?
Hardest thing is validating phone number.

Try attached vQmod, it:

- add input field to form
- checks input, allowed: digits, countrycode with () or + and digits seperated by -
- adds phonenumber to mail->text
- tested on 1.5.3.1 and 1.5.6.1
Hi pprmkr!

Thanks for the file! It worked for me. I just got a initial error cause on the begginig i had double translation where you put version for english and dutch, this was causing a problem to not send the telephone on the message.

Well for portugue-se only i have made a change for brazilian guys.

Is on this Link: http://www.brasilnaweb.com.br/contribui ... ormcontato

"Adicionar campo de telefone no formulário de contato"

New member

Posts

Joined
Tue Jul 03, 2012 4:01 am
Who is online

Users browsing this forum: No registered users and 9 guests