Jump to content
stevel

Country-State Selector

Recommended Posts

I think it was just some incompatibilities with the member approval mod I have.... I just used the create_account.php that came with this contrib. and made a few edits to make it work with member approval.

Share this post


Link to post
Share on other sites
I recommend going for the current one, which is up to _9.  Make sure that all the edits are included.

 

 

Upgraded and still got the same problem with the Primary address,, Ive added a note for the customer to log out after editing there primary address.

 

Has anyone else tested for this problem?

Share this post


Link to post
Share on other sites

Hi. First of all thank you for suck a great Contribution.

 

I have follow the exact instruction on how to install this.

 

Everything works great. but just 1 last problem.

 

Screen Shot of the Error

 

 

this happens at checkout_shipping_address.php

 

here is the file here

 

I might be wrong..this might not be the error file~

 

can you please tell me how i can fix this??

 

Thank you in advance. :blush:

Share this post


Link to post
Share on other sites
Ching, I don't understand what the error is.  Please point it out.

 

Hi Stevel, Thank you for your reply.

 

As you can see in the screen shot. my page is stretch and There is "Link 1" Link2" and "Link3" when they are suppose to be a title.

"link1" Will be "Special" and so.

 

Please forgive me if i cant decride this in detail (dont know much about computer) :blush:

 

Thank you

Share this post


Link to post
Share on other sites

Ok. That has nothing at all to do with this contribution. These links come from, probably, includes\column_right.php. You may be using some "specials" box that puts that out. Can't help you with that.

Share this post


Link to post
Share on other sites

My apologies if this has been asked before...I've looked though pages of messages to no avail.

 

I've just installed the Country-State Selector Contribution which works great pretty much everywhere (Thank you, Steve!!!), except for this error whenever I try to edit an address.

 

Parse error: parse error, unexpected '}' in /home/xxxxxx/mycompany-www/catalog/address_book_process.php on line 202

 

 

Along with some before & after coding, the code in question is:

 

$messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED, 'success');

 

tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));

}

}

 

// +Country-State Selector

} <<--- THIS IS LINE 202

 

if ($refresh) {

// Recreate $entry from post values collected above

$entry = array(

'entry_firstname' => $firstname,

'entry_lastname' => $lastname,

'entry_street_address' => $street_address,

'entry_postcode' => $postcode,

'entry_city' => $city,

'entry_state' => "",

'entry_zone_id' => (int)0,

'entry_country_id' => (int)$country);

if (ACCOUNT_GENDER == 'true') $entry['entry_gender'] = $gender;

if (ACCOUNT_COMPANY == 'true') $entry['entry_company'] = $company;

if (ACCOUNT_SUBURB == 'true') $entry['entry_suburb'] = $suburb;

}

else

// -Country-State Selector

 

Can anybody help me with this error? Thanks in advance.

 

djms

Share this post


Link to post
Share on other sites

Thanks, Steve. I couldn't visually find the missing open brace so I restored my original address_book_process.php file and made the changes again per the Country-State Selector. Whatever was wrong is now okay and it's working great! Thanks again...great contribution...the first REALLY big one I've got to work!

Share this post


Link to post
Share on other sites
Dandelion, here's what to do.  Replace this code in create_account.php:

<tr>
?<td class="main"><?php echo ENTRY_COUNTRY; ?></td>
?<?php // +Country-State Selector ?>
? <td class="main"><?php echo tep_get_country_list('country',$country,'onChange="return refresh_form(create_account);"') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
?<?php // -Country-State Selector ?>
</tr>

with this:

 ? ? ?<?php echo tep_draw_hidden_field('country', DEFAULT_COUNTRY); ?>

 

You'll need to make a similar change in includes/modules/address_book_details.php

 

 

Steve's reply to Dandelion as quoted above was helpful to me as well. I've changed this info in my store as I too am only selling within the US. The fixes work well in the create account screen and when editing from the address book. Yet, the country box is still showing up when you edit the shipping address and the billing address from the Order Confirmation screen.

 

I tried to find similar code in areas relevant to those screens...no luck so far...probably due to my lack of php coding skills!!! :'( Can someone point me in the right direction?

 

Many thanks!

Share this post


Link to post
Share on other sites
Steve's reply to Dandelion as quoted above was helpful to me as well.  I've changed this info in my store as I too am only selling within the US.  The fixes work well in the create account screen and when editing from the address book.  Yet, the country box is still showing up when you edit the shipping address and the billing address from the Order Confirmation screen. 

 

I tried to find similar code in areas relevant to those screens...no luck so far...probably due to my lack of php coding skills!!!  :'(  Can someone point me in the right direction? 

 

Many thanks!

 

 

Another evening of serching & trying different code...still no luck. Anyone?

 

djms

Share this post


Link to post
Share on other sites
Is catalog/includes/modules/address_book_details.php what you want?

 

No, I don't think so. I changed it there when I made the changes per your instructions to Dandelion.

 

It works perfectly except when you try to edit either the shipping address or billing address from the Order Confirmation page. Clicking edit for the shipping address at that point takes you to catalog/checkout_shipping_address.php. Clicking edit for the billing address at the Order Confirmation page takes you to catalog/checkout_payment_address.php. In both instances, the country box is still there. I've looked in both files but can't figure out what to comment out or delete and replace with <?php echo tep_draw_hidden_field('country', DEFAULT_COUNTRY); ?> or even if that's the correct place to do it.

 

Any ideas? Thanks in advance for any help you can give me.

 

Djms

Share this post


Link to post
Share on other sites

Hi Steve - I've installed the most recent version of your contrib (it's fab btw) but I am having a problem - and I'm not entirely sure it's because of this contrib, but I've only installed a few others, and I went back and double-checked which pages were modified, and there are no apparent conflicts.

 

Here's what's happening - everything works great with a user creating an account, etc. however, when logged in and attempting to acces the "My Account --> View or change entries in my address book" link, I get the following error:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /usr/local/apache/htdocs/catalog/includes/functions/database.php:13) in /usr/local/apache/htdocs/catalog/includes/functions/database.php on line 13

 

I've read all posts re: your mod, and have not seen this issue pop up for anyone else, but thought you might have some insight on it anyway. Is this related? Any suggestions?

 

I appreciate your contribution, and any light you might be able to shine on this issue.

Share this post


Link to post
Share on other sites

betagirl,

 

I see a number of other reports of this problem, but with random contributions. There is a knowledge base article http://www.oscommerce.info/kb/Catalog_Guid...on_Problems/198 on the topic. I suggest you check your english.php file and make sure that it does not contain references to other include files. Since you say that it only affects some pages, then look also at includes/languages/english/account.php and account_edit.php to make sure they just have defines in them.

 

Let me know what you find.

Share this post


Link to post
Share on other sites
Well, I'm away from my sources for a couple of days.  But you're looking for references to tep_get_country_list, so just search your sources for it.

 

Steve,

 

Thanks for your replies and help.

 

Picking up from my question a few days ago...

As you suggested, I've searched for tep_get_country_list...unfortunately I've been unsuccessful. I've tested changing other code that looks like it might do the trick...again unsuccessfully. I'm at my wits end. Would you share a bit more of your time and help me find the code to change? I'm guessing that I'll use the same replacement code you shared with Dandelion. Correct?

 

Thank you,

djms

Share this post


Link to post
Share on other sites

Hi Steve -

 

Thanks so much for getting back to me so quickly. Just now getting back to this issue myself as I was out of town. Your link to the osCommerce docs was right on track - I had posted the wrong file in the wrong directory. D'oh!! Good lesson learned.

 

Again, love your contribution - is working great!

 

betagirl,

 

I see a number of other reports of this problem, but with random contributions.  There is a knowledge base article http://www.oscommerce.info/kb/Catalog_Guid...on_Problems/198 on the topic.  I suggest you check your english.php file and make sure that it does not contain references to other include files. Since you say that it only affects some pages, then look also at includes/languages/english/account.php and account_edit.php to make sure they just have defines in them.

 

Let me know what you find.

Share this post


Link to post
Share on other sites

Hello Steve,

 

I just tried your latest contribution of Country-State Selector and like it very much!

 

Meanwhile, I also noticed a minor issue while using the selector to add a new address during checkout process in both checkout_shipping_address.php and checkout_payment_address.php pages, that is, if I switch from a country with sub-zones using the country pull-down list (e.g. 'United States' with 'Alabama' on the top of the state pull-down list) to a country that has no zones pre-set (e.g. 'United Kingdom'), after page refreshed, the state pull-down list becomes a regular text input field (which works fine), however, the 'pre-entry' (e.g. 'Alabama') will still remain in the input field.

 

There's NO such problems when applying the selector in create_account.php and address_book_process.php pages where any "pre-entries" are removed automatically after the page refreshed.

 

Just wonder if there's any way to automatically clear such a "pre-entry" from the STATE input field after page refreshing? Thanks in advance for your advise!

 

See the screeshots below:

 

selector.gif

Edited by orverda

Share this post


Link to post
Share on other sites

Steve, I was wondering if you could tell me teh advantages of your contribution over the following one:

 

http://www.oscommerce.com/community/contributions,2148

 

Reason being, it only mods 3 files. I currently have a seperate pricing per customer contrib. installed, and im half afraid yours may interfere. I was modding the first file in your install list, and its already dealing with some of the same lines modded in the seperate pricing contribute.

 

Your input is appreciated, thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×