Post by aaron1988 » Sat Aug 13, 2011 5:08 am

Hi everyone i thought i would post that i have added a new field called Confirm Email so if they put an email in Email field but they put the wrong email in confirm email it will say something like "Doesnt Match" i am using Jquery for this :).

EDIT: OOPS forgot to add attachments :) so here they are at bottomof post

Also i have only tested this on OC 1.5.1.1 but i believe should work on all the 1.5 releases or even below but it hasnt been tested so you could download something called Winmerge and compare the files to see if matches or what changes need to be made.

So here we go :)

Step 1: EDIT: catalog/controller/information/contact.php

Find:

Code: Select all

$this->data['entry_email'] = $this->language->get('entry_email');
then

Add After:

Code: Select all

$this->data['entry_confirm_email'] = $this->language->get('entry_confirm_email');
Then find:

Code: Select all

if (isset($this->error['email'])) {
         $this->data['error_email'] = $this->error['email'];
      } else {
         $this->data['error_email'] = '';
      }  
Add After:

Code: Select all

if (isset($this->error['confirm_email'])) {
         $this->data['error_confirm_email'] = $this->error['confirm_email'];
      } else {
         $this->data['error_confirm_email'] = '';
      }  
Find:

Code: Select all

if (isset($this->request->post['email'])) {
         $this->data['email'] = $this->request->post['email'];
      } else {
         $this->data['email'] = '';
      }
Add After:

Code: Select all

if (isset($this->request->post['confirm_email'])) {
         $this->data['confirm_email'] = $this->request->post['confirm_email'];
      } else {
         $this->data['confirm_email'] = '';
      } 
Find:

Code: Select all

if (!preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['email'])) {
            $this->error['email'] = $this->language->get('error_email');
       }
Add After:

Code: Select all

if (!preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['confirm_email'])) {
            $this->error['confirm_email'] = $this->language->get('error_confirm_email');
       }
	    if ($this->request->post['confirm_email']!=$this->request->post['email']) {
            $this->error['confirm_email'] = $this->language->get('error_format_confirm_email');
       }
Now Edit: catalog/language/english/information/contact.php

Find:

Code: Select all

$_['text_email']     = 'E-Mail:';
Add After: $_['text_confirm_email'] = 'Confirm E-Mail:';

Find:

Code: Select all

$_['entry_email']    = 'E-Mail Address:<span class="required">*</span>';
Add After:

Code: Select all

$_['entry_confirm_email']    = 'Confirm E-Mail Address:<span class="required">*</span>';
Find:

Code: Select all

$_['error_email']    = 'E-Mail Address not in valid format!';
Add After:

Code: Select all

$_['error_confirm_email'] = 'E-mail Address not in valid format!';
$_['error_format_confirm_email'] = 'E-mail Address does not match!';
Edit: catalog/view/theme/default/template/information/contact.tpl

Find:

Code: Select all

<b><?php echo $entry_email; ?></b><br />
Replace with:

Code: Select all

<label for="email"><?php echo $entry_email; ?></label><br />
Find:

Code: Select all

<input name="email" type="text" value="<?php echo $email; ?>" />
add id to it so looks like:

Code: Select all

<input id="email" name="email" type="text" value="<?php echo $email; ?>" />
Add After:

Code: Select all

<span id="emailInfo">Valid E-mail please, you will need it to progress</span>
Find:

Code: Select all

<?php if ($error_email) { ?>
    <span class="error"><?php echo $error_email; ?></span>
    <?php } ?>
    <br />
Add After:

Code: Select all

<label for="confirm_email"><?php echo $entry_confirm_email; ?></label><br />
    <input id="confirm_email" name="confirm_email" type="text" value="<?php echo $confirm_email; ?>" />
    <span id="confirm_emailInfo">Confirm Email Address</span>
    <br />
    <?php if ($error_confirm_email) { ?>
    <span class="error"><?php echo $error_confirm_email; ?></span>
    <?php } ?>
Find:

Code: Select all

<?php echo $content_bottom; ?></div>
Add After:

Code: Select all

<script type="text/javascript" src="catalog/view/javascript/jquery.js"></script>	
<script type="text/javascript" src="catalog/view/javascript/validation.js"></script>
Please find attached the two .js files and upload them to catalog/view/javascript/ also the file validation.js as all the information into it to add all the the same sort of styles for Name, Enquiry and even adding Subject and Phone. all you do is repeat the above steps but change to subject or phone etc. If you want me to post a full tutorial on adding all these please ask :)

If this doesn't work for you please let me know :)

EDIT: i will also try and post a VQmod of this so its easier and quicker for people just need to get used to it first lol

Kind Regards,
Aaron

Active Member

Posts

Joined
Thu Jan 27, 2011 10:03 am

Post by Jeremy Fisk » Fri Oct 14, 2011 3:25 pm

Heia Aaron,

Thanks for the great post...

I have had a go at puting it into a vqmod, but please check this out... it isn't working for some reason... i'm pretty new to vQmod so i have probabily stuffed it up... but have a look anyway...

Thanks Dude

O0 O0

Jem

Attachments

Please don't anyone else use this vQmod untill it is checked out.


Hand Dryers

Bookstore Mod
QuickShop Module
Restricted Access - Compulsory Login
Template Override - Category Specific (vQmod)
Template Override - Brand Specific (vQmod)
How did you find out about us register question mod
Compulsory Login vQmod
Brands In Top Menu
zoom - Product Image - Auto on hover


User avatar
Active Member

Posts

Joined
Thu Nov 11, 2010 6:11 pm
Location - New Zealand (Tokomaru, Palmerston North)

Post by uksitebuilder » Fri Oct 14, 2011 10:27 pm

Test my vqmod Generator out if you want

http://1513.designs.org.uk/vqgen/vqgen.php

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by aaron1988 » Sat Oct 15, 2011 4:19 pm

Hi Jem,

Try Simons vQmod Generator :).

and if that doesnt work then i will take a further look :).

Kind Regards,
Aaron

Active Member

Posts

Joined
Thu Jan 27, 2011 10:03 am

Post by Jeremy Fisk » Sat Oct 15, 2011 5:13 pm

Hiya Aaron...

Thanks for your reply
Try Simons vQmod Generator :).
I have... see attached

Please note that i am trying on 1.5.0.2 and 1.4.9.5

Good luck

Jemz

Attachments

Email validation vQmod


Hand Dryers

Bookstore Mod
QuickShop Module
Restricted Access - Compulsory Login
Template Override - Category Specific (vQmod)
Template Override - Brand Specific (vQmod)
How did you find out about us register question mod
Compulsory Login vQmod
Brands In Top Menu
zoom - Product Image - Auto on hover


User avatar
Active Member

Posts

Joined
Thu Nov 11, 2010 6:11 pm
Location - New Zealand (Tokomaru, Palmerston North)

Post by spirit » Wed Nov 23, 2011 10:42 am

It didn't work for me in 1.5.1.3 :/
Any help?

Active Member

Posts

Joined
Sat Oct 02, 2010 7:40 am

Post by aaron1988 » Fri Nov 25, 2011 5:11 am

Hi ok :) i will look in the next few days when not at work lol

Thanks
Aaron

Active Member

Posts

Joined
Thu Jan 27, 2011 10:03 am

Post by spirit » Fri Nov 25, 2011 6:15 am

aaron1988 wrote:Hi ok :) i will look in the next few days when not at work lol

Thanks
Aaron
Thanks man!
I think that OC team need add this function officially because is very very useful :)

Active Member

Posts

Joined
Sat Oct 02, 2010 7:40 am

Post by spirit » Tue Nov 29, 2011 8:41 am

Don't forget it :)

Active Member

Posts

Joined
Sat Oct 02, 2010 7:40 am

Post by spirit » Mon Dec 12, 2011 7:29 pm

Somebody can help in this way?
It's very useful, no doubt :)

Active Member

Posts

Joined
Sat Oct 02, 2010 7:40 am

Post by remcofaasse » Wed Jan 11, 2012 12:11 am

Hi,
I'm also interested in vqmod for v 1.5.1.3.
Is this available? Thanks for the reply. Kind regards, Remco

New member

Posts

Joined
Mon Dec 05, 2011 2:20 am

Post by Klimskady » Thu Jan 26, 2012 8:49 pm

Another vote for this for 1.5.1.3 as I have tried another similar to this but it didn't work so this would be great if it did..

Active Member

Posts

Joined
Tue Jun 07, 2011 7:57 am

Post by khalilm » Tue Feb 07, 2012 8:51 am

Hi Everyone,

I saw the requests to have this functionality in 1.5.1.3 and thought it was a good idea so I added it to my code and would like to share with the community.

However, I have added it to Simon's "Better Contact Form" (BCF) which I believe is a must have to prevent spamming. You can find his code here:

http://forum.opencart.com/viewtopic.php?f=131&t=35286

I have been using BCF (2.0 with editable inputs) for a while, so I don't know if I have the latest version, but I have clearly marked my modifications in the code so if needed the changes could be copied.

If you find any errors, please post here and I will fix them. I will pass my changes along to Simon to see if he can add it in his code.

Hope this helps,
Khalil

Attachments

"Better Contact Form" with confirm email


Newbie

Posts

Joined
Sun Sep 18, 2011 1:32 am

Post by matte2k » Sun Mar 04, 2012 3:44 am

Does this fix work with 1.4.9.5 ?

Active Member

Posts

Joined
Thu Mar 01, 2012 7:07 pm
Who is online

Users browsing this forum: No registered users and 6 guests