Post by Purebeads » Sat Mar 05, 2011 8:30 am

I had to help a customer on the phone today who couldn't place her order because the cart wouldn't validate her email address. It turned out that she was typing zeros in place of O's. My old shopping cart didn't validate email addresses, and I never had a problem. Can someone tell me how to disable email address validation in OpenCart? I have version 1.4.8b.

I'm guessing that there's an IF statement in there that says IF address is valid, continue checkout ELSE display error message END IF. If that's the case, then all I need to do is to copy the first part of the statement over the second part of the statement so that in each case the checkout process continues. I have found IF statements in the appropriate file, but I'm not confident enough that I have the right one. Can anyone advise me?

I searched the forum before posting this thread but didn't find an answer.

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by openmycart.com » Sat Mar 05, 2011 9:33 am

Find ind Your reg files controller .php as follows:

private function validate()

then commenting the email validation only.

Find and get many various of opencart modules, themes, mods, etc for your opencart store at http://www.openmycart.com/oc/, OPENCART SITE customization and Maintenance supports at here


User avatar
Active Member

Posts

Joined
Tue Oct 12, 2010 4:47 am


Post by Purebeads » Sat Mar 05, 2011 12:36 pm

I understand what you're saying, but I need more specific guidance. I don't understand PHP code very well.

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by openmycart.com » Sun Mar 06, 2011 1:36 am

Open e.g.
catalog\controller\checkout\guest_step_1.php
catalog\controller\account\create.php
catalog\controller\account\edit.php

find:

Code: Select all

	private function validate() {
if You fine the line look like:

Code: Select all

		if ((strlen(utf8_decode($this->request->post['email'])) > 96) || (!preg_match(EMAIL_PATTERN, $this->request->post['email']))) {
			$this->error['email'] = $this->language->get('error_email');
		}
or

Code: Select all

    	if (!preg_match(EMAIL_PATTERN, $this->request->post['email'])) {
      		$this->error['email'] = $this->language->get('error_email');
    	}
Change it become:

Code: Select all

/*		if ((strlen(utf8_decode($this->request->post['email'])) > 96) || (!preg_match(EMAIL_PATTERN, $this->request->post['email']))) {
			$this->error['email'] = $this->language->get('error_email');
		}*/
or

Code: Select all

 /*   	if (!preg_match(EMAIL_PATTERN, $this->request->post['email'])) {
      		$this->error['email'] = $this->language->get('error_email');
    	} */

Find and get many various of opencart modules, themes, mods, etc for your opencart store at http://www.openmycart.com/oc/, OPENCART SITE customization and Maintenance supports at here


User avatar
Active Member

Posts

Joined
Tue Oct 12, 2010 4:47 am


Post by Purebeads » Sun Mar 06, 2011 3:49 am

Thank you so much! I appreciate it!

I gather that there are no ENDIF statements in PHP, so I don't have to worry about removing them to balance out the IF statements.

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by SXGuy » Sun Mar 06, 2011 7:21 am

No need to balance out anything because you just commented out the code before the first open bracket, and after the last closing bracket

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by openmycart.com » Sun Mar 06, 2011 8:47 am

Purebeads wrote:Thank you so much! I appreciate it!

I gather that there are no ENDIF statements in PHP, so I don't have to worry about removing them to balance out the IF statements.
to complete it You also should open:

catalog\controller\checkout\guest_step_1.php
catalog\controller\account\create.php
catalog\controller\account\edit.php

Code: Select all

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

Code: Select all

	/*	if (isset($this->error['email'])) {
			$this->data['error_email'] = $this->error['email'];
		} else {
			$this->data['error_email'] = '';
		} */
and then open:

catalog\view\theme\YOUR_THEME\template\account\create.tpl
catalog\view\theme\YOUR_THEME\template\account\edit.tpl
catalog\view\theme\YOUR_THEME\template\checkout\guest_step_1.tpl

Find:

Code: Select all

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

Code: Select all

              <?php //if ($error_email) { ?>
              <!--span class="error"><?php //echo $error_email; ?></span-->
              <?php //} ?>

Find and get many various of opencart modules, themes, mods, etc for your opencart store at http://www.openmycart.com/oc/, OPENCART SITE customization and Maintenance supports at here


User avatar
Active Member

Posts

Joined
Tue Oct 12, 2010 4:47 am


Post by Purebeads » Sun Mar 06, 2011 10:57 am

Thanks so much, but now the modifications have gotten too extensive. I don't like to make so many changes to the code.

It seems to me that there should be a way to simply direct the program away from the command that initiates the validation routine -- you know, something that just tells the program to skip over it. But I see that it is much more complicated than that.

So far, only one customer has made the mistake of typing a zero in the .com part of her email address, so obviously it doesn't happen too often.

Openmycart, I appreciate all the trouble you went to. This thread will be useful to other people who want to disable email validation.

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by rocketero » Fri Mar 11, 2011 12:58 pm

I found this thread a bit silly,
Many Store Owners are complaining because fake customers are creating fake email addresses and buying a bunch of products that probably will not be delivered once the client doesn't pay for them.

So store owners are looking for email-validation or email-confirmation so that at least they know is coming from a real email address.

respects.

New member

Posts

Joined
Tue Feb 01, 2011 9:22 pm

Post by Purebeads » Fri Mar 11, 2011 5:33 pm

rocketero wrote:I found this thread a bit silly,
Many Store Owners are complaining because fake customers are creating fake email addresses and buying a bunch of products that probably will not be delivered once the client doesn't pay for them.

So store owners are looking for email-validation or email-confirmation so that at least they know is coming from a real email address.

respects.
It's not for you to dismiss the needs of other merchants. The items I sell are not attractive to thieves. For 7 years before I installed OpenCart on my site, my shopping cart had no email verification, and I had no problems. Such things as email validation, or requiring a customer to type at least 3 letters into every field, simply cause problems for me.

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by rocketero » Mon Mar 14, 2011 5:59 am

This was the post I was looking for,
I have been searching for a while about:

Email-Validation VS. Email-Confirmation

Email Validation has been covered pretty much in all the angles, when having foreign-characters in the email address or because the domain name is too long or other varieties of problems have already been resolved.

But about Email-Confirmation there is not much out here. When one create an account at the store, can use any fake email addresses and fake domain names. then purchase 100 items and make a mess for the administrator without the store-owner even been able to send an email back to the perpetrator, and other havoc that this bad fake-customer is able to perform on the store.

Is there any way to change the files responsible for email-validation to do also email-confirmation on the newly signed customers?

New member

Posts

Joined
Tue Feb 01, 2011 9:22 pm

Post by DMJY » Mon Mar 14, 2011 3:15 pm

but I don't know how to do it,it is a problem,I need your help

Buy Maplestory Mesos Cheap Maplestory Mesos Buy RS Gold Runescape Gold


Newbie

Posts

Joined
Mon Mar 14, 2011 11:26 am
Who is online

Users browsing this forum: No registered users and 67 guests