Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] STS v4


Guest

Recommended Posts

Hi all,

 

These forums have been an invaluable mine of information for me in setting up osC and STS, but I can't find the answer to this one...

 

I'm having a problem in that STS is putting this:  at the top of all catalog pages. When I view the html source of the page, these characters appear at the top before the document type declaration like this: <!DOCTYPE HTML blah...

 

It is not there if I change "Use Templates?" to "false" in Admin->modules->STS->Default.

 

I've checked sts_template.html in /test/ (the one I'm using): there are no characters before the doctype there.

I've also checked the files that I've most recently edited - replacing them with their original versions. No difference.

 

I'm guessing that some so-called non-printable-characters have found there way into a php file somewhere, but I have no idea which files I should be checking...

 

(I'm using the new osC v2.2 RC1 with the updated STS 4.5.3, and I've imported the database from my previous installation, adding the additional administrators table)

 

Any ideas?

 

Cheers,

Matt.

Matt,

A couple of things could be causing your problem:

  1. Check to be sure your FTP client software is uploading the PHP files in the correct format (rare)
  2. Check to be sure your STS Templates have the proper document encoding (most likely your issue)
    This issue can be resolved by correctly stating the very first line in your STS Templates:
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


     
    The above is the default but this may not work for you. What browser are you using? Check the encoding settings on your browser.

One of the things that you can try to help troubleshoot this issue is the following:

 

Open your includes/classes/sts.php file and comment out the following line of code:

	$this->template['headcontent'] = $this->template['headcontent'].'<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n";

Now view your store in your browser and see if you are still getting those errors. If not, then this is indeed an encoding issue.

 

Send us a link so that we can see if this is a universal encoding problem with your site or just with your browser.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Sorry, one more question:

 

Could I use any contribution with STS? For exemple: I intend to use the Star Product, Feature Products, Loginbox Best, and much more. Is it possible with no problems? Thanks again.

Getting other contributions to work with STS is just like getting other contributions to work with "other contributions.

 

Keep in mind that STS is a contribution just like all of the other contributions. Each one makes modifications to the stock osC code. Since there is only so much code to go around, some contributions make modifications to the "same" lines of code. When this occurs, you will either need to know your way around PHP enough to make a custom modification (or search to see if somebody has already done it for you) or choose which contribution meets your needs more than the other one.

 

A good rule of thumb regarding STS and other contributions is as follows:

  1. Contributions that make changes to the product_info.php file will also need to make those changes in includes/modules/sts_inc/product_info.php if you are using the "content" template feature in STS.
  2. Contributions that display thier own custom infobox such as in includes/boxes will need a STS tag created so that you can insert this tag in your templates where you want this new box to appear. There are instructions on how to do this in the includes/modules/sts_inc/sts_usercode.php file.

:thumbsup: We have created a site (STS4 Power Pack - link in my signature below) that has a lot of the custom modifications to contributions that make code changes to the same code that STS currently uses. This may give you some insight.

 

Hope this helps,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Matt,

A couple of things could be causing your problem:

  1. Check to be sure your FTP client software is uploading the PHP files in the correct format (rare)
  2. Check to be sure your STS Templates have the proper document encoding (most likely your issue)
    This issue can be resolved by correctly stating the very first line in your STS Templates:
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


     
    The above is the default but this may not work for you. What browser are you using? Check the encoding settings on your browser.

One of the things that you can try to help troubleshoot this issue is the following:

 

Open your includes/classes/sts.php file and comment out the following line of code:

	$this->template['headcontent'] = $this->template['headcontent'].'<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n";

Now view your store in your browser and see if you are still getting those errors. If not, then this is indeed an encoding issue.

 

Send us a link so that we can see if this is a universal encoding problem with your site or just with your browser.

 

Also, comment this line in includes/languages/english.php (and other languages):

// charset for web pages and emails
define('CHARSET', 'iso-8859-1');

This is just for troubleshooting a possible character set issue

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Hi Bill,

 

Thanks for the reply. I understood everything and put loginbox in the fronto page: "quicly and easy"

 

Thanks a lot.

 

More doubt:

 

In the index.php.html have a $content and the product.info too. I know that is not the same contente, but using the same tag. How could edit this contents? For example, I would like to get off the new products for "month"in the index. Where is it? Thanks.

Link to comment
Share on other sites

Matt,

A couple of things could be causing your problem:

  1. Check to be sure your FTP client software is uploading the PHP files in the correct format (rare)
  2. Check to be sure your STS Templates have the proper document encoding (most likely your issue)
    This issue can be resolved by correctly stating the very first line in your STS Templates:
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


     
    The above is the default but this may not work for you. What browser are you using? Check the encoding settings on your browser.

One of the things that you can try to help troubleshoot this issue is the following:

 

Open your includes/classes/sts.php file and comment out the following line of code:

	$this->template['headcontent'] = $this->template['headcontent'].'<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n";

Now view your store in your browser and see if you are still getting those errors. If not, then this is indeed an encoding issue.

 

Send us a link so that we can see if this is a universal encoding problem with your site or just with your browser.

Thanks Bill,

 

I didn't think think to try looking at it through another browser, as I assumed they would all get the same source code (which shows my lack of understanding of character encoding, I guess...)

 

I can now tell you that there is no problem when the page is displayed in IE6 or IE7. In IE, if I go to: View -> Encoding ->, it shows it is using UTF-8.

 

The characters show in Firefox (on 3 different PCs). If I go to (in Firefox): View -> Character Encoding -> I see that it is using ISO-8859-1. If I change this to UTF-8, the characters disappear... then refreshing the page switches back to ISO-8859-1 and the characters reappear.

 

I don't understand what's happening there: In all cases the "charset", in the source <head> is being set:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

but IE is selecting UTF-8 instead (and has no problem), but Firefox is using the correct encoding, but displaying those  characters!

 

Temporarily commenting out the content-type line from includes/classes/sts.php (effectively removing the meta-tag line above from the doc head) does fix it for firefox. It shows the page using UTF-8. (I can bring the characters back if I specifically tell Firefox to use ISO-8859-1)

 

So. I guess this means that it is an "encoding issue". But where do I go from here?

 

Cheers,

Matt.

Link to comment
Share on other sites

(for some reason I was unable to edit my last post..?)

I meant to mention that I'm currently using the unedited /includes/sts_templates/test/sts_template.

... and that for FTP, I'm using FileZilla on WinXP and have been using it for a while with no problems.

Matt.

Link to comment
Share on other sites

STS and Featured Products

 

:thumbsup: For those who may be interested, I just uploaded a new contribution on the Featured Products site to assist STS 4.5.3 users with the installation of Featured Products 1.5.9.

 

All files have been provided to make an easy merge into your existing store. Manual edits have been given as well.

 

Here is the link:

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

 

Hope this makes things easier for everyone. :lol:

 

Enjoy,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Thanks Bill,

 

I didn't think think to try looking at it through another browser, as I assumed they would all get the same source code (which shows my lack of understanding of character encoding, I guess...)

 

I can now tell you that there is no problem when the page is displayed in IE6 or IE7. In IE, if I go to: View -> Encoding ->, it shows it is using UTF-8.

 

The characters show in Firefox (on 3 different PCs). If I go to (in Firefox): View -> Character Encoding -> I see that it is using ISO-8859-1. If I change this to UTF-8, the characters disappear... then refreshing the page switches back to ISO-8859-1 and the characters reappear.

 

I don't understand what's happening there: In all cases the "charset", in the source <head> is being set:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

but IE is selecting UTF-8 instead (and has no problem), but Firefox is using the correct encoding, but displaying those  characters!

 

Temporarily commenting out the content-type line from includes/classes/sts.php (effectively removing the meta-tag line above from the doc head) does fix it for firefox. It shows the page using UTF-8. (I can bring the characters back if I specifically tell Firefox to use ISO-8859-1)

 

So. I guess this means that it is an "encoding issue". But where do I go from here?

 

Cheers,

Matt.

 

Matt,

You can either add the encoding directly to your template so that all browsers will display it correctly or do it within osCommerce modifying the files that I posted earlier.

 

Hope I have been of some help to you,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Hi Bill,

 

Thanks for the reply. I understood everything and put loginbox in the fronto page: "quicly and easy"

 

Thanks a lot.

 

More doubt:

 

In the index.php.html have a $content and the product.info too. I know that is not the same contente, but using the same tag. How could edit this contents? For example, I would like to get off the new products for "month"in the index. Where is it? Thanks.

Renato,

I suggest that you use the Featured Products contribution to replace your New Products for month box. This will give you complete control over those products.

 

Check it out here:

 

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

 

Have fun,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Matt,

You can either add the encoding directly to your template so that all browsers will display it correctly or do it within osCommerce modifying the files that I posted earlier.

 

Hope I have been of some help to you,

Yes, you have. :) Thanks very much Bill.

 

What I have now done is this: I've edited includes/languages/english.php ... changing this:

// charset for web pages and emails
define('CHARSET', 'iso-8859-1');

to this:

// charset for web pages and emails
define('CHARSET', 'utf-8');

which now makes Firefox use UTF-8 encoding, whilst I assume IE continues doing its own thing and uses UTF-8 anyway.

 

This is now working for me :D ... But can you foresee this causing me any problems later, when I add other contributions, for instance? (I can see that iso-8859-1 appears in the code elsewhere) ... and I'm still unsure why it was happening anyway...

 

Thanks again.

Matt.

Link to comment
Share on other sites

Renato,

I suggest that you use the Featured Products contribution to replace your New Products for month box. This will give you complete control over those products.

 

Check it out here:

 

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

 

Have fun,

 

Bill thanks for making this contrib more STS friendly, was looking for just the thing when I came across your post.

 

 

 

BTW thanks for STS

Powered By osC 2.2RC2a STS 4.5.8 - HTC 2.6.3 - FP 1.5.9 - BCH 1.0.0

Link to comment
Share on other sites

Hi,

 

I have also installed the fresh new Online Merchant version and STS 4.5.3 and I'm having the same problem ( <!DOCTYPE HTML blah... ) in Firefox.

In IE also the scandinavian special characters don't show up, only small square instead. In Firefox they are displayed correctly...

 

I have checked everything couple of times and can't find out the reason for this...

 

Greets,

Rauno

Link to comment
Share on other sites

With such a simple install instructions I do not know where I could have messed up at.

 

I just installed LIGHTBOX Image for STS 4+ and whenever I click on an image on my test store it is a regular pop-up and not the Lightbox image,

 

Is there more to the contribution that what is in the download file located here?

 

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

Powered By osC 2.2RC2a STS 4.5.8 - HTC 2.6.3 - FP 1.5.9 - BCH 1.0.0

Link to comment
Share on other sites

Hi,

 

I have also installed the fresh new Online Merchant version and STS 4.5.3 and I'm having the same problem ( <!DOCTYPE HTML blah... ) in Firefox.

In IE also the scandinavian special characters don't show up, only small square instead. In Firefox they are displayed correctly...

 

I have checked everything couple of times and can't find out the reason for this...

 

Greets,

Rauno

OK...This is a shot in the dark:

 

I'm not sure why a lot of users are having charset issues all of a sudden since nothing in STS or osCommerce has changed regarding this. I am leaning towards server side issues that is to blame for the sudden onslaught of charset problems. I see that users have had issues with Charset settings long before STS even came on the scene so this is NOT a specific STS problem but a problem for many users none the less.

 

Here is my two cents (hope it helps you out). :-

 

Try this:

 

If you're are on an Apache server you can put a .htaccess file in your root directory that just contains one line:

AddType "text/html; charset=utf-8" .php

 

If that doesn't work, try adding this instead:

"AddType "text/html; charset=utf-8" .html .php"

With the changes above, the users browser should use the charset specified above and not the one set in the page.

 

You are by no means limited to setting the charset to every PHP or HTML file. There are a lot of good options that you should check out for yourself.

Read up on this using the following link from this VERY EASY TO READ article regarding setting Charset via a .htaccess file:

 

http://www.w3.org/International/questions/...taccess-charset

 

The above article gives detailed examples of how to set your Charset either for entire web sites, folders, files of a certain type (yourfile.php, yourtemplate.html), or even just a single file.

 

:thumbsup: If all else fails, contact your host and get their spin on things.

 

Hope this has helped all of you,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Yes, you have. :) Thanks very much Bill.

 

What I have now done is this: I've edited includes/languages/english.php ... changing this:

// charset for web pages and emails
define('CHARSET', 'iso-8859-1');

to this:

// charset for web pages and emails
define('CHARSET', 'utf-8');

which now makes Firefox use UTF-8 encoding, whilst I assume IE continues doing its own thing and uses UTF-8 anyway.

 

This is now working for me :D ... But can you foresee this causing me any problems later, when I add other contributions, for instance? (I can see that iso-8859-1 appears in the code elsewhere) ... and I'm still unsure why it was happening anyway...

 

Thanks again.

Matt.

 

I was having same issue as Matt. Used english.php encoding change above, too, with good results.

So thanks everyone and I love your contribution.

Amy

Link to comment
Share on other sites

I was having same issue as Matt. Used english.php encoding change above, too, with good results.

So thanks everyone and I love your contribution.

Amy

 

OK...Since I do not want to make any assumptions here...

 

:thumbsup: TIP: If you are using an editor such as Dreamweaver, FrontPage, MS Expression Web, etc., Be sure you have the Default HTML Encoding set correctly. This is very important and could be the cause to most everyone's problem.

 

If not, Check the posts above for a possible solution.

 

Hoping to get positive feedback from all those involved,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Hi Bill,

 

 

Thank you Bill for a quick answer but I don't think it can be server side issue, because I have osC 2.2 + STS2.01 and osC 2.2 + STS4.4 test shops under the same domain working properly without problems.

 

The problem with IE is that it seems to use that 'utf-8' instead of 'iso-8859-1' already but it drops out scandinavian characters from the text, so I think 'iso-8859-1' should be used here.

 

The strange  don't appear in top of the page with Firefox when using previous STS versions, so I assume this bug has to be related either Online Merchant rc1 or STS4.5.3. Probably the same thing (  ) though unseen in IE prevents it choosing the charset right...?

 

Greets,

Rauno

Link to comment
Share on other sites

I've found another solution to our  problem...

 

Open (/includes/sts_templates/test/)sts_template.html with a text editor, select all of the text and copy it to the clipboard (<ctrl>c).

(now either delete the original file or move to another directory)

Create a new (empty) file and (re)name it 'sts_template.html'.

Open the new file with a text editor and paste in the content from the clipboard (<Ctrl>v). Save it and upload it.... Annoying characters gone!!

 

Matt.

Link to comment
Share on other sites

I've found another solution to our  problem...

 

Open (/includes/sts_templates/test/)sts_template.html with a text editor, select all of the text and copy it to the clipboard (<ctrl>c).

(now either delete the original file or move to another directory)

Create a new (empty) file and (re)name it 'sts_template.html'.

Open the new file with a text editor and paste in the content from the clipboard (<Ctrl>v). Save it and upload it.... Annoying characters gone!!

 

Matt.

This would be caused by the original editor that you opened the template in originally and then uploaded to your server, not neccessarily the actual template file (many are using the same sample templates with no issues).

 

The thought here would be that the editor is changing the coding because it is setup that way.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

This would be caused by the original editor that you opened the template in originally and then uploaded to your server, not neccessarily the actual template file (many are using the same sample templates with no issues).

 

The thought here would be that the editor is changing the coding because it is setup that way.

I wish it was. But I tried this with a completely fresh installation.

 

Matt.

Link to comment
Share on other sites

I've found another solution to our  problem...

 

Open (/includes/sts_templates/test/)sts_template.html with a text editor, select all of the text and copy it to the clipboard (<ctrl>c).

(now either delete the original file or move to another directory)

Create a new (empty) file and (re)name it 'sts_template.html'.

Open the new file with a text editor and paste in the content from the clipboard (<Ctrl>v). Save it and upload it.... Annoying characters gone!!

 

Matt.

 

 

Great, that solves the problem. Making new templates in Dreamweaver works also perfectly...:) But also templates under folder 'full' have the same issues, at least index.php.html and index.php.html have to be fixed if used...Maybe others too.

 

At least I haven't opened these files in editor before putting them to server...

 

Greets,

Rauno

Link to comment
Share on other sites

Great, that solves the problem. Making new templates in Dreamweaver works also perfectly...:) But also templates under folder 'full' have the same issues, at least index.php.html and index.php.html have to be fixed if used...Maybe others too.

 

At least I haven't opened these files in editor before putting them to server...

 

Greets,

Rauno

 

 

Correction, sts_template.html and index.php.html

Link to comment
Share on other sites

I wish it was. But I tried this with a completely fresh installation.

 

Matt.

 

OK. After tracking this down, I found out that at some point a few of the sample templates were opened in Microsoft Expression Web. This editor added  to the begining of these files on the first line. I could not view them using a file comparison program so I opened them in my PHP Editor and there they were.

Matt first brought this to my attention. Thanks Matt!

 

I took some time to research MS Expression Web Editor and it appears that this program has encoding options that could be (but were not) used so the program added that code. Thanks Microsoft!! :angry: :angry:

 

I do not "usually" bash MS products but this is a bunch of non-sense!

 

Bottom line....You will need to open each sample template in a good solid PHP editor such as PHP Designer 2007 and delete the strange code on the first line "". You could also do it Matt's way if you do not have a good PHP editor. The reason I suggest a PHP editor is because a lot of HMTL editors out there are doing the same thing as MS Expression Web.

 

Microsoft blames this on how PHP handles "includes" but I say "whatever"!!

 

Here are the templates involved:

  • full/index.php.html
  • full/index.php_1_9.html
  • full/index.php_mfr.html
  • full/index.php_mfr_4.html
  • full/popup_image.php.html
  • full/product_info.php_3.html
  • full/sts_template.html
  • full/content/product_info.php_26.html
  • test/sts_template.html

I will upload a new version of STSV4.5.3 with the corrected templates. Sorry for the trouble folks! :blush:

Edited by bkellum

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

This question is regarding the CONTENT templates.

 

These are working fine for categories. I have a nice set of templates per category, and when the user approaches the catalog from a category standpoint, the category template is displayed.

 

I'm not having any success building a CONTENT template for MANUFACTURER. When the user picks a manufacturer to browse, product information is displayed in the ugly default format and without any of the defined variables I want.

 

How do I set up CONTENT template per MANUFACTURER? Perhaps it is the naming convention I have wrong??

 

If it's not possible to do this, could somebody please tell me that rather than just ignoring?

 

Thanks,

 

Anne

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