Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Country-State Selector


stevel

Recommended Posts

Ok. In checkout_payment_address.php and checkout_shipping_address.php, make these edits:

 

Try this and let me know how it works for you.

 

stevel,

 

Thanks for the code updates. Sorry it took me a while to get them implemented. So far, initial testing is good so it seems to work as I'd expect. Again, thanks!!

 

Nathan

Link to comment
Share on other sites

I have a create_account.php with an older version of this contrib installed that works on another site, if I paste it into the site I'm having problems with it still doesn't work. It must be another file that create_account.php uses...

Link to comment
Share on other sites

The onChange attribute of the country pulldown causes a "refresh" function in includes/form_check.js.php to be called. This changes the action from "process" to "refresh". Either that's not there or you've got an error in the code at the top of create_account.php that looks for the action value.

Link to comment
Share on other sites

I replaced my create_account.php with the one that came with the contrib and now it works. Strange because in the comparison in CSDiff that I made, the only differences were white space and something to do with the email text.

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Hi, Can anyone help me? I'm going mad trying to figure this out. I installed this contribution this afternoon and when I clicked on create a new account all I got was this:

 

Fatal error: Cannot redeclare tep_show_category() in /home/trixie/trixiecat.com/catalog/includes/boxes/categories.php on line 13

 

I built my entire site and used the forums as a guide on the php. I hate php but I honestly do not get it. I just wanted a pull down menu with all the US states and have the united states as the default. Is that so wrong? :(

Link to comment
Share on other sites

Well, I can't see how this would relate to the contribution. Do you have the categories box included twice in your left column (or wherever it is)?

Link to comment
Share on other sites

Well, I can't see how this would relate to the contribution. Do you have the categories box included twice in your left column (or wherever it is)?

 

No, but thanks for asking. Actually it was tep_show_catagory.... it should have been tep_show_catagories. I cruised through the file and changed it all and now it works just fine. Beautiful contribution.

Link to comment
Share on other sites

To install this contrib, I am right in saying download the version 1.3.3 from the osc contribs page and then add the modifications of post 597 of this thread?

Link to comment
Share on other sites

  • 4 weeks later...

I just noticed that the page no longer refreshes after someone changes the category. According to my backups and the file modified date, I've never touched the file since it was working. I'm pretty sure this has to do with me upgrading to PHP5. Can anyone help?

Link to comment
Share on other sites

Read the README for debugging tips. Basically, view the HTML source in your web browser and make sure that the "refresh" function is there. If you have Firefox, bringing up Tools..Javascript Console is a great help as it will usually tell you exactly what is wrong.

Link to comment
Share on other sites

Update: It was the blank minimum value for the telephone number that caused this. The way to make the telephone number not required (according to someone on the forums) is to set the minimum value to blank and edit a piece of code.

 

On another note, do you know if this mod breaks the error checking on the create account page, particularly if another email already exists, or if the person didnt enter the password correctly in the confirm box? That isnt working for me right now, and I'm trying to figure out if it's this mod or the member approval mod. The whole problem has been giving me hell. I'm losing customers because the page isnt checking for errors like that and it tells the people their account request was submitted, but we hear nothing about it and they never get their account. (It will check minimum values though.)

Edited by yatahaze
Link to comment
Share on other sites

No, it doesn't break that if you added the mod correctly. I use this on my own sites. To make the phone number not required, set the minimum length to 0, not blank.

Link to comment
Share on other sites

The site still gives me an error saying "Your telephone number must be a minimum of 0 characters". Too bad about the breaking though, I was really hoping this is what caused it.. heh.. The member approval mod has almost no support.

Link to comment
Share on other sites

Well, you can always take the "big hammer" approach and comment out the check for telephone number in includes/form_check.js.php

 

And yes, any error in that file may prevent the country-state selector refresh from occurring as browsers will stop running code in the script after an error.

Link to comment
Share on other sites

  • 2 weeks later...

Everything seems to work when I installed this mod, but when trying to access "Customers" menu choice from Admin (or search for customer name), I now get this:

 

Parse error: parse error, unexpected T_CASE in /usr3/home/cupandblade.com/htdocs/store/catalog/admin/customers.php on line 194

 

Here is the code snippet from that location in my customers.php file:

 

} else if ($error == true) {

$cInfo = new objectInfo($HTTP_POST_VARS);

$processed = true;

// +Country-State Selector

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

$cInfo = new objectInfo($HTTP_POST_VARS);

}

// -Country-State Selector

}

 

Any help??

Link to comment
Share on other sites

Everything seems to work when I installed this mod, but when trying to access "Customers" menu choice from Admin (or search for customer name), I now get this:

Here is the code snippet from that location in my customers.php file:

Any help??

 

D'OH!!! I just re-read posts on the previous page and removing the brace between the comment and "break" solved it. Sorry for reposting the problem, I would have deleted the post if I could have.. :wacko:

Link to comment
Share on other sites

  • 2 weeks later...

Hi Steve,

 

After many hours of trying to find a simple fix to the entire Country/State issue when someone signs up for an account, I later realized there is no simple fix. I was hesitant to use your setup because of all the customization I did to my store. However, many of your files do NOT interfere with customized store files.

 

Your contribution is a real asset to the osCommerce cart and I hope they integrate it into the core files. It was easy to setup and solved all my problems. I immediately saw results with my first international order coming just 2 hours after installing your contribution. No wonder I wasn't getting any international orders before. The core files just don't work in the current release.

 

If you're hesitant to use Steve's contrib, just view my cart at: www.stickypod.com/osc/ and you'll see that I'm using multiple style sheets and many customized OSC files.

 

Many thanks for all the hard work and you have my vote for including your contrib in the core files. :thumbsup:

Anyone can buy a camera... it's what you do with it that counts!

Sticky Pod

www.stickypod.com

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...