Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Country-State Selector


stevel

Recommended Posts

  • 3 weeks later...
Hi

 

Thanks to everyone who "helped" but I managed to get it working on my self. I forgot to add the css info. :blush: The image still spins anti-clockwise but I can live with that.

 

Is it possible to collapse the div? At the moment it is leaving a gap the height of the image on the page

 

Cheers

 

ian

 

Me again. Solved this too. I googled ajax images and found some that rotate anti clockwise, I've only seen clockwise versions. Anyway, solved, I downloaded a horiz bar and all is OK

 

Cheers

 

Ian

Link to comment
Share on other sites

Hi

This is a great contribution, the only trouble i have is that the page doesn't refresh after selecting another country

 

The error points to line 43 of create_account.php, which seems all ok as per the contribution

$city = tep_db_prepare_input($HTTP_POST_VARS['city']);

 

I've also checked the form_check.js which seems the same as the latest contribution files

 

Here is My Website

 

Thank you in advance

Regards

Steve

Link to comment
Share on other sites

The "line 43" refers to the rendered HTML page, not the PHP source. On your page, it is this line:

 

getObject("indicator").style.visibility = 'visible';

 

You're using the AJAX version so I can't help other than to note that the error is that there seems to be no object "indicator".

Link to comment
Share on other sites

im getting this error in admin/customers.php, can anyone shed any light on this - i have checked and double checked the install files and only see the wrong // which i corrected as per latest in this contribution (strangely when the comments are in the wrong place it loads the page but still errors the rest of page

 

Parse error: syntax error, unexpected T_CASE in /home/*****/public_html/admin/customers.php on line 199

 

thanks

steve

Link to comment
Share on other sites

Well, you'll just have to triple-check admin/customers.php as you've made an error. Most likely a missing or extra curly-brace.

 

thats the comment out part;

// +Country-State Selector	  
//}   End if (!$refresh)	
  if (($error == false) && ($refresh != 'true')) {
// -Country-State Selector

 

but if i leave it as before, ignoring the contribution latest fix of moving the comments;

// +Country-State Selector	  
}//   End if (!$refresh)	
  if (($error == false) && ($refresh != 'true')) {
// -Country-State Selector

 

 

i get this error;

Fatal error: Call to undefined function tep_hide_session_id() in /home/pcrepair/public_html/admin/customers.php on line 742

 

Line 742 is this (which is same as the contribution);

<?php echo tep_hide_session_id(); ?></form></tr>

 

could you give me a hint as to what i need to do in that 'no object indicator' as i wouldnt know where to start

 

many thanks

steve

Link to comment
Share on other sites

I can't help with the AJAX issues. My guess is that the syntax error is earlier in the file. That error about tep_hide_session_id is odd as that's a standard function.

 

I don't know if the AJAX version, which I didn't write, comes with pre-edited files. If it does, then use a file comparison program to compare yours with the pre-edited version.

Link to comment
Share on other sites

I can't help with the AJAX issues. My guess is that the syntax error is earlier in the file. That error about tep_hide_session_id is odd as that's a standard function.

 

I don't know if the AJAX version, which I didn't write, comes with pre-edited files. If it does, then use a file comparison program to compare yours with the pre-edited version.

 

interestingly i just loaded the actual file supplied by the contribution and the same errors!!!!

Link to comment
Share on other sites

You may want to check include/require files then.

 

 

no idea now as the includes/require are ok and standard stuff, infact also the header, footer, column are all loading as well. just that error???????? checked the install files against mine and cant get anywhere

Link to comment
Share on other sites

no idea now as the includes/require are ok and standard stuff, infact also the header, footer, column are all loading as well. just that error???????? checked the install files against mine and cant get anywhere

 

i've simply commented out the hide session id that was the error and all works but dont know if commenting it out will cause probs? but even the original customers.php from a clean download of osc was bringing up the same error...??

 

just need to get the page refreshing when different country selected in account, now

 

any pointers for this please

 

thanks

steve

Link to comment
Share on other sites

Hi

I know i still get the error with page not refreshing but i have just installed Purchase Without Account 2.0f which upgraded me from a very old version i had (years old)

 

Now - create_account.php page continuously tells me to select a state from the dropdown list - when i already have and this just repeats and goes round in circles

 

the code it may be could be this;

if ($zone_id == 0) {

which is required by the Country State Selector, however, Purchase without account 2 requires this added to create_account.php in the same place;

$zone_id = 0;

 

so is there any way they can be integrated so both work because if i use the first code create_account.php gives an unexpected $ error and with second code i get the repeated 'state' error above

 

many thanks in advance

steve

Link to comment
Share on other sites

I'm sure it can be integrated - I did this once upon a time - but as with most combinations of contributions, you're on your own for merging them. Without examining the code, I'd think that the two lines of code you reference are NOT supposed to be the same place.

 

That's one of the drawbacks of osCommerce. If you do not have at least a basic understanding of PHP and the ability to sort out conflicts such as this, you're going to be hopelessly lost.

Link to comment
Share on other sites

  • 3 weeks later...

Anyone having problem with Country-State Selector v1.5.5 (AJAX) since upgraded to PHP 5.2.8 and MySQL 5.1.30 or maybe when using mysqli? The country list is displayed, I can change country, but nothing happen on State list.

Link to comment
Share on other sites

Turn on JavaScript error checking in your web browser and see if there are any errors.

 

Line: 163

Error: Prohibed access

URL: create_account.php

 

Here's what's on line 163 (in HTML result)

 

		request.open("POST", 'create_account.php', true);

Link to comment
Share on other sites

  • 2 weeks later...

Hello.

 

I've been testing the AJAX 1.5.5 version, and would like to have the address input fields conditionally formatted, based on Country selected. I've reordered the fields, setting Country as the first item. My default country is United States. If the selected country remains (or gets changed back to) United States, I would like the remaining input fields to be listed as :

 

Street Address

City

State (from AJAX List)

Zip/Post Code

 

For other countries, until I can possibly code for them as well, I would like it to revert/remain to the standard layout of

 

Street Address

Suburb

Post Code

City

State/Province

 

I have the HTML layout content coded, but can't figure out how to test for the selected country from the list. Is it a new or existing Javascript function???

 

Thank you in advance

Link to comment
Share on other sites

  • 2 weeks later...

Hey - I just came across this contribution and it looks like exactly what I am looking for. One question though... When setting up tax zones, I noticed there is already a database of provinces/states etc. Does this contrib use the same database? Also, will whatever the customer enters in this contrib trigger the appropriate tax zone?

Link to comment
Share on other sites

thanks Stevel for a wonderful contibution !

 

I just upgraded your contribution on one of my stores from version 1.0.5 to 1.4.1.-

 

Its great ! - but, I much prefer the zone code (AL) not being shown along with the zone name (Alabama (AL) ) in the dropdown (as it was on previous versions.)

 

Would it be possible to advise what code and files I would need to change to remove the additional 2 letter abbreviation to the drop down ?

 

(I am imagining it is just a small part of code in a couple of files)

 

I have gone through all 50 + pages in the forum here and couldn't locate the info

Link to comment
Share on other sites

Glenn,

 

It uses the standard Zones table. All this contrib does is change the way the customer enters the state.

 

Deb,

 

I've been on vacation and am away from my sources, but I think it is in a function with a name such as tep_get_zone_list in includes/functions/general.php. If you read through the contrib instructions you'll find it.

Link to comment
Share on other sites

Deb,

 

I've been on vacation and am away from my sources, but I think it is in a function with a name such as tep_get_zone_list in includes/functions/general.php. If you read through the contrib instructions you'll find it.

 

Thanks Steve, I think you may have misunderstood....In vers 1.4.1 - the file you reference (includes/functions/general.php) is not touched by this contribution.

 

This is what I am looking for :

In the dropdown list of States (on all customers pages) - I would like just the State name listed (as it was previously in ver 1.0.5 - you added this functionality in ver 1.4.0 according to your 'Change History') not the State name AND the two digit State abbreviation (zone code) in parantheses.

 

I have looked through the forum and all through the files, but I dont feel comfortable attempting a change without a bit of direction. If you get a moment to look at your sources, if you could give me a hint please.

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...