Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / NOT Displaying Country on Customer Address(es)

NOT Displaying Country on Customer Address(es)

Views: 998

Results 1 to 8 of 8
29 Jul 2014, 5:47 PM
#1
cyberguybl avatar

cyberguybl

New Zenner

Join Date:
Jul 2014
Location:
Los Angeles, CA
Posts:
4
Plugin Contributions:
0

NOT Displaying Country on Customer Address(es)

Hi!

I do not know if this has been talked in the forum. If it has, then please give me the link to that thread.

Below is my problem:

  1. Do not display the country information in "Step 1 of 3 - Delivery Information" page.
  2. Do not display the country information in "Change the Shipping Address" page and also under the "Or Choose From Your Address Book Entries" list of other addresses.
  3. Do not display the country information in "Step 2 of 3 - Payment Information" page.
  4. Do not display the country information in "Change the Billing Information" page and also under the "Or Choose From Your Address Book Entries" list of other addresses.
  5. Do not display the country information in "Step 3 of 3 - Order Confirmation" page.

I tried to customize or modify a copy of the "functions_customers.php" "zen_address_label" function and take out the "entry_country_id". But when I ran the update, it broke the checkout page.

Which function should I go to exclude the country information from being displayed?

Thanks,

Ben

Sample Screenshot below:

Attachment 14340

29 Jul 2014, 6:18 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: NOT Displaying Country on Customer Address(es)

I'd guess you would have to modify several template files to do that. An explanation of why you want that information not to display would possibly help someone come up with another solution.

29 Jul 2014, 6:31 PM
#3
cyberguybl avatar

cyberguybl

New Zenner

Join Date:
Jul 2014
Location:
Los Angeles, CA
Posts:
4
Plugin Contributions:
0

Re: NOT Displaying Country on Customer Address(es)

Stevesh, the only reason why I need to do this is that my boss just wants me to take it out.

29 Jul 2014, 6:56 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: NOT Displaying Country on Customer Address(es)

Hmmm - The sort of thing that led me to swear off bosses years ago.

The best I can offer is to suggest that you use the Admin - Tools - Developers Tool Kit to search for country_id for a list of module and template files which contain it.

29 Jul 2014, 7:17 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: NOT Displaying Country on Customer Address(es)

You could change the address_format table but then you would affect Canada as well ...

You could add a new address_format and setup Canada and the US to use their own, unique formats but you would need to update the countries table to use the new address_format_id for which ever country you make the new address format for ...

29 Jul 2014, 8:18 PM
#6
cyberguybl avatar

cyberguybl

New Zenner

Join Date:
Jul 2014
Location:
Los Angeles, CA
Posts:
4
Plugin Contributions:
0

Re: NOT Displaying Country on Customer Address(es)

Ajeh, I am actually leaning towards that. My thoughts is that I just backup the original "functions_customers.php" and in the "functions_customers.php" copy, I will just add my new functions that would facilitate query and displaying of the address(es). Then I just need to direct the address function calls to the new function in the "tpl_checkout_shipping_default.php" and "tpl_checkout_shipping_address_default.php". This approach will have a lower risk of causing the cart to fail, I hope!
I may have to modify other PHP files but so far these are the only ones I see that need to be modified.
I will let you know how it goes.
Thanks again.

29 Jul 2014, 11:26 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: NOT Displaying Country on Customer Address(es)

I am not sure what else may need to be changed without testing, but you can try changing the file:
/includes/functions/functions_customers.php

and add the code in RED:

    if ($country == '') {
      if (is_array($address['country'])) {
        $country = zen_output_string_protected($address['country']['countries_name']);
      } else {
      $country = zen_output_string_protected($address['country']);
      }
    }
[B]    // bof: turn off country for matching country
    if ($address['country_id'] == STORE_COUNTRY) {
      $country = '';
    }
    // eof: turn off country for matching country
[/B]    if ($state != '') $statecomma = $state . ', ';

Then try a making a test cart and check the Shipping Estimator, checkout_blah_pages, Admin orders, My Account pages and see if this one change manages everything on new orders ...

I am thinking this is not going to manage everything off the top of my head and that perhaps the new address_format on Canada and editing the address_format used for the United States might be the better choice ...

But, again, I have not tested this to tell you what all might need to be done ...

30 Jul 2014, 2:51 PM
#8
cyberguybl avatar

cyberguybl

New Zenner

Join Date:
Jul 2014
Location:
Los Angeles, CA
Posts:
4
Plugin Contributions:
0

Re: NOT Displaying Country on Customer Address(es)

Thanks for the input. I will update this post when I get it done. Got another task to do.