Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Hello,

 

Well I am very new to this Template System and I have installed it on one of my websites. Now I don't understand how or why the header does not show what I need it to show. I have 2 contributions installed which are Infobox Admin and Centershop, but for some reason the header is not following code.. :unsure:

 

Has anyone being able to center their shop? Which contribution did you use? I am using the newest version which is centershop 3.0. Has anyone had any problem with the header calling out the old Banner instead of your made banner?

 

Thanks,

 

Please Help!

 

Dark

Link to comment
Share on other sites

TomThumb, thanks for your help! It turned out being a session id added to the end of a link to a product. removed the session id from the link and it seems to work again.

Link to comment
Share on other sites

I followed instructions exactly, and I get the following error now when I visit the store:

 

Template file doesn't exist: [sTS_DEFAULT_TEMPLATE]

Warning: fopen(STS_DEFAULT_TEMPLATE): failed to open stream: No such file or directory in /hsphere/local/home/nmuta/mediabreeze.com/tauienterprises/catalog/includes/sts_display_output.php on line 120

Can't open Template file: [sTS_DEFAULT_TEMPLATE]

Warning: filesize(): Stat failed for STS_DEFAULT_TEMPLATE (errno=2 - No such file or directory) in /hsphere/local/home/nmuta/mediabreeze.com/tauienterprises/catalog/includes/sts_display_output.php on line 124

 

Warning: fread(): supplied argument is not a valid stream resource in /hsphere/local/home/nmuta/mediabreeze.com/tauienterprises/catalog/includes/sts_display_output.php on line 124

 

Warning: fclose(): supplied argument is not a valid stream resource in /hsphere/local/home/nmuta/mediabreeze.com/tauienterprises/catalog/includes/sts_display_output.php on line 125

 

Warning: main(STS_USER_CODE): failed to open stream: No such file or directory in /hsphere/local/home/nmuta/mediabreeze.com/tauienterprises/catalog/includes/sts_display_output.php on line 138

 

Fatal error: main(): Failed opening required 'STS_USER_CODE' (include_path='.:/usr/local/lib/php') in /hsphere/local/home/nmuta/mediabreeze.com/tauienterprises/catalog/includes/sts_display_output.php on line 138

 

 

 

It would seem like one parameter in the sts_display_output.php file is wrong. I tried looking for the [sTS_DEFAULT_TEMPLATE] variable, assuming that maybe this variable is pointing to the wrong file. But I can't find where that variable is defined.

Edited by Shem
Link to comment
Share on other sites

OK...I see....yes. This variable is already defined in configure.php

 

define('STS_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.html');

 

and I already added that line (along with

 

// STS: ADD: Define Simple Template System files

define('STS_START_CAPTURE', DIR_WS_INCLUDES . 'sts_start_capture.php');

define('STS_STOP_CAPTURE', DIR_WS_INCLUDES . 'sts_stop_capture.php');

define('STS_RESTART_CAPTURE', DIR_WS_INCLUDES . 'sts_restart_capture.php');

define('STS_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.html');

define('STS_DISPLAY_OUTPUT', DIR_WS_INCLUDES . 'sts_display_output.php');

// STS: EOADD

 

 

at the end of my configure file. So it should be finding it. ! I have not changed any names.

Link to comment
Share on other sites

OK I FOUND THE PROBLEM... THEY CHANGED VARIABLE NAMES. WHAT USED TO BE

 

STS_DEFAULT_TEMPLATE

 

IS NOW

STS_TEMPLATE. !!

 

SO I changed that. But now there's another variable it cannot find:

 

STS_USER_CODE

 

 

Why so many mis named variables?

Link to comment
Share on other sites

OK I had to add this line of code

define('STS_USER_CODE', DIR_WS_INCLUDES . 'sts_user_code.php');

 

to the configure.php file. (includes/configure.php)

 

AND IT APPEARS TO BE WORKING NOW. Looks great, hope it will continue to look great as I continue to test.

Link to comment
Share on other sites

I recieve a Javascript error on the bottom left of my window when i try "click to enlarge" my image and there is no popup. Clean install of both STS and OSC.

 

Test site starwarscans.com test site

 

sparks

Go to your sts_template.html page. Clear out ALL of the information between your header tags, and add the $header variable. That should take care of it ;) <head>$header</head>

Link to comment
Share on other sites

I am looking for a way to exclude some html from STS capture. I am using PrintOrder with StoreLogo v2 which creates a printable order form for the customer as well as an invoice and packing slip for the seller. The packing slip and invoice work great because STS does not capture the admin information. However, the printable order form is captured and effectively rendered useless by STS when it is re-formatted within my template. Is there a way to exlude printorder.php from STS capture or can I place it in a different location?

Link to comment
Share on other sites

I am looking for a way to exclude some html from STS capture.  I am using PrintOrder with StoreLogo v2 which creates a printable order form for the customer as well as an invoice and packing slip for the seller.  The packing slip and invoice work great because STS does not capture the admin information.  However, the printable order form is captured and effectively rendered useless by STS when it is re-formatted within my template.  Is there a way to exlude printorder.php from STS capture or can I place it in a different location?

In sts_display_output.php change these lines:

 

// This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly
if (strpos($scriptname, "popup") !== false || strpos($scriptname, "info_shopping_cart") !== false) {
 $display_normal_output = 1;
 $display_template_output = 0;
}

 

to this:

 

// This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly

if (strpos($scriptname, "popup") !== false || strpos($scriptname, "info_shopping_cart") !== false || strpos($scriptname, "printorder.php") !== false) {

  $display_normal_output = 1;

  $display_template_output = 0;

}

 

That should keep STS from using the template on the printorder file.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Hi, i am new to oscommerce & STS and hope that anyone can help me with the following: I installed the latest STS with OScommerce 2.2

everything is working but i would like to modify as follows:

 

1. can i modify box looks in STS? or do i need to do it from OSC side?

2. can i remove "add to cart" and "buy now" from OSC using STS? i read that there is a contribution in OSC but didnt try it yet.. anyone used it before?

 

Thanks.

Link to comment
Share on other sites

Hi Brian ,

I Simply LOVE your contribution - In my eyes I really think its THE most important contribution out there and it should be standard in the next release of OSCommerce!!!

 

Here is the URL to the site

 

It's almost up and running, and as you see, I've totaly changed the whole 'look and feel' you'd never guess it's OsCommerce!

Anyway I see 1 little problem at the moment. When you first visit the page the following is visible right at the bottom of the page:

</

 

This is because for some reason the word 'html' is s stripped from the last tag on the page so instead of the closing </html> tag you just get </ .

On an Macintosh I've found that (although the source code is screwed up) the browser doesn't display it and seems to process the page correctly even without the closing </html> tag, but on a Windows OS </ is clearly visible.

Even more interesting is the fact that if refreshed the problem will disappear!

 

Any idea what to do?

Link to comment
Share on other sites

Please help me...

 

I installed the new Version of STS and everything work fine - but the loginbox does not work. There is only the code $loginbox visible - but not the box.

 

In my old version (1.8) the loginbox works without problems.

 

What can I do?

Link to comment
Share on other sites

Pixelsoul,

 

Try looking and Brian's Post and changing the printorder.php to popup_image.php

:( No it doesnt seem to work..

 

// This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly

if (strpos($scriptname, "popup") !== false || strpos($scriptname, "info_shopping_cart") !== false || strpos($scriptname, "popup_image.php") !== false) {

? $display_normal_output = 1;

? $display_template_output = 0;

}

 

The strange thing is it is working ok on my testing server??? Could it be the server settings that are wrong ?

Edited by pixelsoul
Link to comment
Share on other sites

Got STS working just fine over the weekend, then I checked it this morning and am now reciveing the following error...

Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /usr/local/apache2/htdocs/sandbox/includes/sts_display_output.php on line 31

at Test Site

 

Any help would be much appreciated.

Link to comment
Share on other sites

Pixelsoul,

 

Try looking and Brian's Post and changing the printorder.php to popup_image.php

:( No it doesnt seem to work..

 

// This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly

if (strpos($scriptname, "popup") !== false || strpos($scriptname, "info_shopping_cart") !== false || strpos($scriptname, "popup_image.php") !== false) {

  $display_normal_output = 1;

  $display_template_output = 0;

}

 

The strange thing is it is working ok on my testing server??? Could it be the server settings that are wrong ?

Try commenting out the second "$scriptname" line here in sts_display_output:

 

Change

 

// Override if we need to show a pop-up window

$scriptname = $_SERVER['PHP_SELF'];

$scriptname = getenv('SCRIPT_NAME');

 

to

 

// Override if we need to show a pop-up window

$scriptname = $_SERVER['PHP_SELF'];

// $scriptname = getenv('SCRIPT_NAME');

 

I've seen this problem when testing on a Linux server, but running on a Windows server.

 

Let me know if this fixes it.

 

- Brian

Edited by DiamondSea

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

I really like the easy way I can deploy templates with STS, but I am having a problem in the checkout. When you reach payment page in the process, running the mouse over the area that contains the payment options, be it one choice or many, produces a javascript error, as if there's a broken mouseover function on that payment table.

 

In playing with the debug mode, I find that if I turn on normal mode with the template mode in sts_display_output.php, the problem goes away. I almost suspsect it might be something with the CSS, but I can't figure what. Can anybody help with this? I've got to get this thing up and running asap.

Link to comment
Share on other sites

Hi Brian ,

I Simply LOVE your contribution - In my eyes I really think its THE most important contribution out there and it should be standard in the next release of OSCommerce!!!

 

Here is the URL to the site

 

It's almost up and running, and as you see, I've totaly changed the whole 'look and feel' you'd never guess it's OsCommerce!

Anyway I see 1 little problem at the moment. When you first visit the page the following is visible right at the bottom of the page:

</

 

This is because for some reason the word 'html' is s stripped from the last tag on the page so instead of the closing </html> tag you just get </ .

On an Macintosh I've found that (although the source code is screwed up) the browser doesn't display it and seems to process the page correctly even without the closing </html> tag, but on a Windows OS </ is clearly visible.

Even more interesting is the fact that if refreshed the problem will disappear!

 

Any idea what to do?

From the STS Faq here ( http://www.diamondsea.com/sts/sts_faq.html ) :

 

3) At the bottom of each page, I see the characters "</".

 

Answer: You need to upgrade your server's version of PHP. This was a subtle bug in older versions. Updating your PHP will fix it. You should upgrade it anyway, since if you are running a version with this problem, there are also security fixes that have been added to later versions of PHP that you need to secure your system.

 

Enjoy!

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Pixelsoul,

 

Try looking and Brian's Post and changing the printorder.php to popup_image.php

:( No it doesnt seem to work..

 

// This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly

if (strpos($scriptname, "popup") !== false || strpos($scriptname, "info_shopping_cart") !== false || strpos($scriptname, "popup_image.php") !== false) {

? $display_normal_output = 1;

? $display_template_output = 0;

}

 

The strange thing is it is working ok on my testing server??? Could it be the server settings that are wrong ?

Try commenting out the second "$scriptname" line here in sts_display_output:

 

Change

 

// Override if we need to show a pop-up window

$scriptname = $_SERVER['PHP_SELF'];

$scriptname = getenv('SCRIPT_NAME');

 

to

 

// Override if we need to show a pop-up window

$scriptname = $_SERVER['PHP_SELF'];

// $scriptname = getenv('SCRIPT_NAME');

 

I've seen this problem when testing on a Linux server, but running on a Windows server.

 

Let me know if this fixes it.

 

- Brian

:lol: Yeaaah brian your the best man it seems to be fixed now B) thx alot for the help, and your great work on the templating system.. :D :D :D

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