Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Works for some languages but not others? Solved.


Justin

Recommended Posts

I installed this contribution, as noted earlier in this thread, and I eventually got it working just the way I wanted. I then added a few other contributions and made some spelling, grammar, and punctuation changes to many English strings.

 

During final testing before moving the site from the test server to the production server, I noticed that none of the relevant pages were refreshing when the country was changed, even though this worked flawlessly after the original install.

 

Moreover, as noted by others in this thread, this behavior changed depending on the language. In my case, the refresh worked for every language except English (which is in my case the most important). The other contributions I installed did not seem to change anything relevant to this mod, and the English changes are about content -- not logic. I was very puzzled as to what I might have done to break this mod, particularly because it was only happening in English.

 

But given that I had made extensive changes to the English language files, and that's the language that didn't work, I suspected that might be where the problem was. I took Steve's suggestion and looked at Firefox's JavaScript console while creating a new account in English mode. Sure enough, I saw the following error:

 

Error: missing ) after argument list
Source File: https://shibuya.agiledigital.com/shinza/create_account.php?language=en
Line: 150, Column: 67
Source Code:
 check_select("country", "", "You must select a country from the "Country" pull-down menu.");

I stared at this for a few minutes before it finally dawned on me: the quotation marks in the text string were causing a syntax error, which in turn was preventing the JavaScript refresh function from doing its job. At some point, I must have added those double quotation marks to the text string. I removed them in english.php as follows:

 

define('ENTRY_COUNTRY_ERROR', 'You must select a country from the Country pull-down menu.');

 

Moral of the story:

 

If this contribution works for you in one language and not another, and Steve's aforementioned fixes don't work for you, make sure you are careful about how you are using quotation marks in the text strings. The JavaScript console made this easy to catch.

 

Hope this helps someone else!

 

Best,

 

Justin

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