Jump to content
stevel

Country-State Selector

Recommended Posts

Thanks for your contribution, i?m not a programmer and i was having hard times with put an pull down menu in a project that actually i?m working. I appreciate your efforts and time for make oscommerce an better ecommerce solution for all of Us.

 

Thanks again! :D

Share this post


Link to post
Share on other sites

I must have made a mistake somewhere. Exactly where is the question.

All of the address book entry_state tables are empty in the database. The state does not get entered in the data base.

Can anyone provide a clue on where to start troubleshooting?

Share this post


Link to post
Share on other sites

Does the state show properly in the customer record? The order global variable is filled in from this in includes/classes/order.php in function "cart". The actual data record is filled in in checkout_process.php. Note that neither of these files is touched by this contribution.

 

Are you using a payment gateway that processes the address somehow?

 

What I usually do is insert var_dump() calls in pages to see what the value of variables of interest are. var_dump takes an argument that is a variable name, and it writes to the HTML output a formatted dump of the value. Follow the information as it is passed along to see where it disappears.

Share this post


Link to post
Share on other sites

Many thanks for your reply.

The state does not show in the admin "edit" a customer.

Not using a payment gateway.

I am going to expierment with var_dump(customers_state); I don't know that I would see the problem if it jumped out at me however.

Again, thank you.

Share this post


Link to post
Share on other sites

Since the state does not show in admin, then that narrows down the problem to the create account page. Perhaps you should compare your file with the pre-edited version supplied.

Share this post


Link to post
Share on other sites
Since the state does not show in admin, then that narrows down the problem to the create account page. Perhaps you should compare your file with the pre-edited version supplied.

 

Excellant idea!!!

I found one line in a relavant section that had extra line feeds. I need to do some testing now but I am hopeful!

Again, thanks for the kick in rear end on this one.

Dennis

Share this post


Link to post
Share on other sites

I have a problem I installed this contribution everything works great except its not sending out the welcome email after the account is created

 

i already tried the email_test contribution and it worked fine

 

any ideas whats causing this?

Share this post


Link to post
Share on other sites

Well, this contribution doesn't change the code that sends the e-mail, which is this in create_account.php:

	  $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
  tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

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

 

I suppose you'll have to add some debug code to see if this code is being executed, and if not, why not.

Edited by stevel

Share this post


Link to post
Share on other sites

Thanks for the contribution and the easy to follow install instructions. Everything is working great, except when I go to customers in the admin section I get the following error:

Parse error: parse error, unexpected T_CASE in /www/m/myhairoutlet/htdocs/catalog/admin/customers.php on line 193

 

I've narrowed the error down to the following section of code, but I can't figure out what is causing the error. Any advice?

 

} else if ($error == true) {

$cInfo = new objectInfo($HTTP_POST_VARS);

$processed = true;

// BOC added for Country-State Selector **added 12/26/2005

} else if ($refresh == 'true') {

$cInfo = new objectInfo($HTTP_POST_VARS);

}

// EOC added for Country-State Selector }

 

break;

case 'deleteconfirm':

Share this post


Link to post
Share on other sites

Sorry, have been away for a few days. Often this sort of error is due to some line well before the line that it complains about, but in your case, I think it is that the } at the end of the last line you showed should be on its own line. What you have done is comment out the close brace. Insert a newline before that brace and see what happens.

Share this post


Link to post
Share on other sites

Thanks for your contribution, it's very nice and sorry for my poor English. I have a problem with the contribution. When I want to create a new account or modify an account, the program doesn't save the state selected. It's Ok in the Admin but not in the store. I don't know where I did error.

 

If anybody can help me to guide me where I could see. Thanks for your answers.

Share this post


Link to post
Share on other sites

The first thing to do is to compare your version of create_account.php with the already-edited one I provide in the ZIP file. BeyondCompare is a good tool for this and there is a free evaluation download available. This will help you see what may be wrong in your version of the file.

Share this post


Link to post
Share on other sites
The first thing to do is to compare your version of create_account.php with the already-edited one I provide in the ZIP file. BeyondCompare is a good tool for this and there is a free evaluation download available. This will help you see what may be wrong in your version of the file.

 

Thanks for your quick answer, I compared the 2 files with BeyonCompare and I didn't found any difference. It's a mystery for me. I search the error since a few days. :angry:

 

Have you another idea? Thanks for all.

Share this post


Link to post
Share on other sites

When you say that it "doesn't save the state". do you mean in the database or is the changed state not shown on the web page that the user sees? Can you give me a URL of your store so that I can look at it? You can send me a PM if you wish.

Share this post


Link to post
Share on other sites

I have followed your suggest and I am using Beyond Compare and it is excellant by the way.

I have found at least one interesting thing already and wonder if you had any insight or comment. In the file address_book_process.php this line in my original is

$customer_country_id = $country_id;

 

and that line in the country-state version is:

$customer_country_id = $country;

 

First of all is that correct the way it should be and what is the result of that change.

 

Thanks for sharing your know how and knowledge.

 

Dennis

Share this post


Link to post
Share on other sites
I have followed your suggest and I am using Beyond Compare and it is excellant by the way.

I have found at least one interesting thing already and wonder if you had any insight or comment. In the file address_book_process.php this line in my original is

$customer_country_id = $country_id;

 

and that line in the country-state version is:

$customer_country_id = $country;

 

First of all is that correct the way it should be and what is the result of that change.

 

Thanks for sharing your know how and knowledge.

 

Dennis

 

Thanks for your remark , I change this line in address_book_process.php and I compared all the contribution files and I found some little differances in some files, and after correction the save in the datatbase was done correctly. :thumbsup:

 

Thank you very much Steve for your contribution and for your suggestion to use Beyond Compare. I wish you a happy new year. :lol:

 

Sincerely

Share this post


Link to post
Share on other sites

Interesting. That line is one of those that I changed as a result of the osCommerce 051113 update. $country is correct, not $country_id. Note that there are two occurrences of that line in address_book_process.php.

Edited by stevel

Share this post


Link to post
Share on other sites

Hi

 

First things first: HAPPY NEW YEAR TO YOU ALL

 

I have tried to use this contribution in the CCGV contribution at: admin/gv_mail.php and am having problems

 

When i use the single email field and type in the email address AND use my HTML editor to include font colours/bold for the text and insert images, it works fine because the email sent contains the correct information

 

However, when i use the country/state selector it doesnt work properly. the dropboxes work fine and i can select who i want to send the email to and it does send the text correctly with font colours/bold but NOT the images

 

Has anyone added this contribution to admin/gv_mail.php? Has anyone gone a step further with HTML editor added?

 

can anyone please advise what i should look out for?

Edited by chooch

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
Eh? I use CCGV and don't see how you would mix Country-State Selector with it. What aspect of C-SS did you add to gv_mail.php?

sorry i was drinking too much wine celebrating the new year

 

got carried away with my imagination

Edited by chooch

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites

I suggested you read the thread to see other people's experience and tips. What have you done so far and what is the problem? Do you understand PHP enough to merge two contributions or are you looking for someone to hand it to you already done?

Share this post


Link to post
Share on other sites

Hi, Steve,

 

I have set it back to the start of create_account3.php & I am using create_account.php, but I would like to have both of these scripts working for me.

 

I understand a lot about PhP, I know how to mod stuff, I have moded my old vBulletin sites, but I don't know enough about the coding & what all the symbols mean in it but I am not a coder.

 

Thank you,

Michael


Michael

Share this post


Link to post
Share on other sites

Hello Stevel,

 

Very nice contrib!

 

Refresh Help Please

 

I am new to php.

I am on a Windows platform using osc2.2ms2 with 051112 and 051113 Updates.

If helps to view any page source the website is at: www.bighawk.net/catalog/index.php

I have Purchase Without Account 0.910 installed which works well.

I am now attempting to install Country State Selector 1.3.3.

I only have one form_check.js.php file and it is in catalog/includes folder. I used the file include with the download since the only change to this file was the CSS changes.

 

Started testing at the login.php page. The page loads and appears to be okay, but I have a problem with page refresh when a country is selected from the country dropdown.

 

I did go through your debugging tips

 

I have not used a template nor made significant changes from the stock osc. Certainly none that should affect page refresh.

 

Using file search/compare I did compare my files to those in the download package searching for refresh_form. As far as I can tell, both, my files and the downloaded files are in sync as far as the PWA and CSS are concerned.

 

As recommended I turned on the JavaScript debugging in Firefox and wouldn't you know it I got an error reported. Now that I have viewed the error I don't know what to do with the information? how to fix? what should the code look like, etc?

 

 

===

This is my error attempting to load login.php:

Error in parsing value for property 'cursor'. Declaration dropped catalog/stylesheet.css line 312.

I believe this has to do with stylesheet.css. Lines 311, 312, and 313 read.

.moduleRow { }
.moduleRowOver { background-color: #D7E9F7; cursor: pointer; cursor: hand; }
.moduleRowSelected { background-color: #E9F4FC; }

I can't see where my problem is and there are no difference when I compare files. I didn't touch this area of code nor imagine why I would ever want to. What could possibly be the problem with this?

 

 

===

I then click on the Create Account button and the create_account.php page loads a looks okay. The debugging report comes back as follows:

Error in parsing value for property 'cursor'. Declaration dropped catalog/stylesheet.css line 312 (same as above).

And

Syntax error catalog/create_account.php line: 119, Column: 27 reads as follows:

check_input("telephone", , "Your Telephone Number must contain a minimum of characters.");

I think this refers to catalog/includes/form_check.js.php line 128 with the code that reads

  check_input("telephone", <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>, "<?php echo ENTRY_TELEPHONE_NUMBER_ERROR; ?>");

and I think to catalog/includes/languges/english.php line 211 with the code that reads

define('ENTRY_TELEPHONE_NUMBER_ERROR', 'Your Telephone Number must contain a minimum of ' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.');

In my osc admin I have left the telephone number minimum field blank (optional for the customer). Once again I am not certain where my problem is. I read in a post in this forum topic dated Sep 3 2005, 04:43 PM that suggested deleting this code? I assume from form_check.js.php, but it didn't really specify. Is this the correct procedure? Please advise how I should deal with this error.

 

 

===

I then select a country from the country drop down. The create_account.php page remains loaded. There are no visible changes in the browser except the selected country in the dropdown has changed as requested. The debugging report comes back as follows:

 

refresh_form is not defined catalog/create_account.php line 1

I am assuming this error message does not simply refer to line 1 in the create_account.php file since it does not define any refesh_form parameter. I am not certain which file(s) this error message refers to.

FYI the code from line 1 in catalog/create_account.php reads

<?php

I have obviously missed defining the refresh_form somewhere from your instructions ? I have failed to located what I have missed. Please advise where and how I am to define this parameter.

 

At this point? if I had hair I would have pull it out! ?if I was E.T. I would go home, but for the moment? until I get a little help from the expert? I'm a gonna trade in this javascript stuff for a cup of java.

 

Any help would be greatly 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

×