Post by InfiniteDezigns » Sun Apr 03, 2011 7:34 am

InfiniteDezigns wrote:QPhoria:

Although it's added, there still doesn't show a red asterix next to the zipcode at all and the customers aren't filling it out. I need to change the word from post code to Zip code and also need the Asterix next to it. Any suggestions?


http://www.dyelyfe.com/Store

I just ended up hacking it with the red Astrix. And changed the word post code to zip code. It looks perfect. But I hope this will be fixed in the upcoming 1.5 v of Opencart.

New member

Posts

Joined
Mon Jun 21, 2010 5:18 am

Post by i2Paq » Mon Apr 04, 2011 12:04 am

InfiniteDezigns wrote:
Qphoria wrote:YOU DO NOT NEED TO APPLY THIS MOD IN 1.4.9 OR LATER AS IT HAS ALREADY BEEN ADDED AND AUTOMATICALLY REQUIRES BASED ON THE COUNTRY!

QPhoria:

Although it's added, there still doesn't show a red asterix next to the zipcode at all and the customers aren't filling it out. I need to change the word from post code to Zip code and also need the Asterix next to it. Any suggestions?


http://www.dyelyfe.com/Store

I just ended up hacking it with the red Astrix. And changed the word post code to zip code. It looks perfect. But I hope this will be fixed in the upcoming 1.5 v of Opencart.

That has nothing to do with Opencart but with the custom template your using!

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by i2Paq » Mon Apr 04, 2011 12:08 am

YOU DO NOT NEED TO APPLY THIS MOD IN 1.4.9 OR LATER AS IT HAS ALREADY BEEN ADDED AND AUTOMATICALLY REQUIRES BASED ON THE COUNTRY!

IF YOU USE A CUSTOM THEME YOU MAY HAVE TO MODIFY SOME OF THE THEME FILES!!!

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by InfiniteDezigns » Tue Apr 05, 2011 1:28 am

i2Paq wrote:YOU DO NOT NEED TO APPLY THIS MOD IN 1.4.9 OR LATER AS IT HAS ALREADY BEEN ADDED AND AUTOMATICALLY REQUIRES BASED ON THE COUNTRY!

IF YOU USE A CUSTOM THEME YOU MAY HAVE TO MODIFY SOME OF THE THEME FILES!!!
Then post once again what has to change in the Theme files?

New member

Posts

Joined
Mon Jun 21, 2010 5:18 am

Post by ImogenLockhart123 » Thu Aug 11, 2011 10:45 am

Thanks for the help, I have had the same problem, your solution worked perfectly (1.4.7). O0

Tomorrow is another day.
Tera Gold
Tera Money



Posts

Joined
Thu Aug 11, 2011 10:43 am

Post by jimquim » Mon Aug 15, 2011 4:37 am

ok how would i get rid of the Your Address field altogether and have them not required is this possible?

Your Address
Company:
* Address 1:
Address 2:
* City:
* Post Code:
* Country:
* Region / State:

Newbie

Posts

Joined
Sun Aug 14, 2011 11:28 pm

Post by webfeetdesign » Mon Aug 22, 2011 9:34 pm

Hi, ages ago I did this process for a client but only did it for new account register. I forgot to do it for the guest checkout. Is there a way of doing this? What are the files I would need to change?

The version of my opencart got removed (Don't ask me how!) is there a way of finding out? This will help me decide which code to use.

Cheers

It's sorted now, backtracked. Still not sure how to find the version though.

Active Member

Posts

Joined
Fri Feb 05, 2010 1:28 am
Location - Dubai

Post by netpaydays » Tue Mar 13, 2012 2:32 pm

This works on the "initial" customer setup BUT If you add extra or multiple locations to that users account the zip code field is "not" a required field in that situation. Can you revise this post to make the zip code a required field when adding multiple locations to a user account as well?

Newbie

Posts

Joined
Tue Mar 13, 2012 2:29 pm


Post by javabean » Fri Sep 07, 2012 1:10 pm

i'm currently running 1.5.4.1 and it postcode isn't a requirement for USA and Canada but in real operations this is definitely needed. it does apply the requirement if the country is united kingdom. any ideas on how to fix this so it is required for USA and Canada? Thanks

Newbie

Posts

Joined
Wed Aug 29, 2012 2:11 am

Post by JohnOC » Fri Sep 07, 2012 10:33 pm

@javabean: Select YES in your Admin -> System -> Localization -> Country -> United States -> Zip Code Required.

Do the same for Canada.

Newbie

Posts

Joined
Fri Aug 10, 2012 2:19 am

Post by javabean » Fri Sep 07, 2012 10:48 pm

AWESOME! fixed it. thanks for the heads up. i should've looked closer. :)

Newbie

Posts

Joined
Wed Aug 29, 2012 2:11 am

Post by robzcuy » Sat Nov 24, 2012 1:24 pm

Hi i have a question about "postal code" or something about it.. right now i'm developed an online shop using open cart, and when i try to use menu register, the register step is success but i cant login with my account that i previously made.. its on : http://www.netoneshop.com/index.php?rou ... t/register

And theres something strange, when my browser ask me to remember my password, it didnt remember my email, instead its remember my POSTAL CODE.. :-\
Image

and when i try to logging in...... :(
Image

i cant logging in even i input my correct email address and password, looks like the browser remember my postal code, not my email, or theres something broken on my open cart controller?? :-[ :-[ :-[ :-[ :-[

anybody can help me? please im a dead man walking now -____________-

Newbie

Posts

Joined
Sat Nov 24, 2012 1:03 pm

Post by vntgeclassified » Mon Jan 07, 2013 9:31 am

I recently purchased the Shoppa Theme and the Post codd shows as mandatory for the UK but not for the US, I'm using version 1.5.4, can you tell me how to correct this.


Posts

Joined
Mon Jan 07, 2013 3:23 am

Post by sunster » Fri Jan 18, 2013 3:48 am

@vntgeclassified Not sure if you are still looking for an answer, but it's a few posts above yours.

Thanks @JohnOC I came here looking for that answer

New member

Posts

Joined
Thu Sep 27, 2012 3:25 am

Post by vntgeclassified » Wed Jan 30, 2013 7:34 am

SOLVED Thank You, Overlooked option in System/Localization/Countries in the Admin Panel.


Posts

Joined
Mon Jan 07, 2013 3:23 am

Post by admin0902 » Mon Mar 11, 2013 2:04 pm

This is the fast way:

Just add <font color="red">*</font>, in the php!

Newbie

Posts

Joined
Sat Feb 09, 2013 10:57 pm

Post by innocrea » Tue May 07, 2013 4:56 am

All you guys are doing so difficult with editing source files etc. You don't have to do ANYTHING of this.

If you want to set postcode required the only thing you have to do is run the following SQL command:

Code: Select all

UPDATE oc_country SET `postcode_required` =1;
That's it!
Last edited by innocrea on Thu Sep 26, 2013 11:52 pm, edited 2 times in total.

Newbie

Posts

Joined
Thu Oct 11, 2012 1:00 am

Post by rangerfans » Tue Sep 17, 2013 10:59 am

Qphoria wrote:Going to write this one and sticky it:

YOU DO NOT NEED TO APPLY THIS MOD IN 1.4.9 OR LATER AS IT HAS ALREADY BEEN ADDED AND AUTOMATICALLY REQUIRES BASED ON THE COUNTRY!

1. EDIT: catalog/controller/account/create.php
(If using v1.3.2 or newer)
FIND:

Code: Select all

if (isset($this->error['city'])) {
	$this->data['error_city'] = $this->error['city'];
} else {
	$this->data['error_city'] = '';
}
(If using v1.3.0 or older)
FIND:

Code: Select all

$this->data['error_city'] = @$this->error['city'];
AFTER, ADD: (ALL VERSIONS)

Code: Select all

if (isset($this->error['postcode'])) {
	$this->data['error_postcode'] = $this->error['postcode'];
} else {
	$this->data['error_postcode'] = '';
}

2. In that same file
FIND:

Code: Select all

if ((strlen(utf8_decode($this->request->post['city'])) < 3) || (strlen(utf8_decode($this->request->post['city'])) > 128)) {
      	$this->error['city'] = $this->language->get('error_city');
}
AFTER, ADD:

Code: Select all

if ((strlen(utf8_decode($this->request->post['postcode'])) < 1) || (strlen(utf8_decode($this->request->post['postcode'])) > 10)) {
      	$this->error['postcode'] = $this->language->get('error_postcode');
}
3. EDIT: catalog/language/english/account/create.php
FIND:

Code: Select all

$_['error_city']           = 'City must be greater than 3 and less than 128 characters!';
AFTER, ADD:

Code: Select all

$_['error_postcode']       = 'Postcode must be greater than 1 and less than 10 characters!';
4. EDIT: catalog/view/theme/default/template/account/create.tpl
FIND:

Code: Select all

<tr>
  <td><?php echo $entry_postcode; ?></td>
  <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" /></td>
</tr>
REPLACE WITH:

Code: Select all

<tr>
  <td><span class="required">*</span> <?php echo $entry_postcode; ?></td>
  <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" />
  <?php if ($error_postcode) { ?>
  <span class="error"><?php echo $error_postcode; ?></span>
  <?php } ?></td>
</tr>
thanks for share. this is usefull. many customers on my online shop do not to fill the postcode. so there is a big problem for us to shipping.we must to email customer,but some customers do not reply us with their postcode. we have to search their postcode in google.but this is very inaccurate. i have updated my code with this post, i think i will never meet this problem now. thanks very much

Newbie

Posts

Joined
Tue Sep 17, 2013 10:45 am


Post by ahmad.alattar » Tue Nov 12, 2013 3:28 am

Qphoria wrote:Going to write this one and sticky it:

YOU DO NOT NEED TO APPLY THIS MOD IN 1.4.9 OR LATER AS IT HAS ALREADY BEEN ADDED AND AUTOMATICALLY REQUIRES BASED ON THE COUNTRY!

1. EDIT: catalog/controller/account/create.php
(If using v1.3.2 or newer)
FIND:

Code: Select all

if (isset($this->error['city'])) {
	$this->data['error_city'] = $this->error['city'];
} else {
	$this->data['error_city'] = '';
}
(If using v1.3.0 or older)
FIND:

Code: Select all

$this->data['error_city'] = @$this->error['city'];
AFTER, ADD: (ALL VERSIONS)

Code: Select all

if (isset($this->error['postcode'])) {
	$this->data['error_postcode'] = $this->error['postcode'];
} else {
	$this->data['error_postcode'] = '';
}

2. In that same file
FIND:

Code: Select all

if ((strlen(utf8_decode($this->request->post['city'])) < 3) || (strlen(utf8_decode($this->request->post['city'])) > 128)) {
      	$this->error['city'] = $this->language->get('error_city');
}
AFTER, ADD:

Code: Select all

if ((strlen(utf8_decode($this->request->post['postcode'])) < 1) || (strlen(utf8_decode($this->request->post['postcode'])) > 10)) {
      	$this->error['postcode'] = $this->language->get('error_postcode');
}
3. EDIT: catalog/language/english/account/create.php
FIND:

Code: Select all

$_['error_city']           = 'City must be greater than 3 and less than 128 characters!';
AFTER, ADD:

Code: Select all

$_['error_postcode']       = 'Postcode must be greater than 1 and less than 10 characters!';
4. EDIT: catalog/view/theme/default/template/account/create.tpl
FIND:

Code: Select all

<tr>
  <td><?php echo $entry_postcode; ?></td>
  <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" /></td>
</tr>
REPLACE WITH:

Code: Select all

<tr>
  <td><span class="required">*</span> <?php echo $entry_postcode; ?></td>
  <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" />
  <?php if ($error_postcode) { ?>
  <span class="error"><?php echo $error_postcode; ?></span>
  <?php } ?></td>
</tr>
hi,
I made postcode required for my country, it works, i now cant submit the form unless i enter a postcode, but it doesnt dhow any text telling uts required, its only showing the standard red star. any help on this?

Addition: im using OC 1.5.5.1

Newbie

Posts

Joined
Tue Sep 17, 2013 8:22 pm

Post by dakhoco2 » Mon May 19, 2014 1:11 pm

Has anyone tried this on OC 1.4.8b??

Thanks

Công ty TNHH khí công nghiệp Minh Tâm sản xuất và kinh doanh đá khô CO2 hàng đầu Việt Nam


Newbie

Posts

Joined
Mon May 19, 2014 1:06 pm
Who is online

Users browsing this forum: No registered users and 80 guests