Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

I had version 1.3 working perfectly, but that was done weeks ago, when I temporarily stopped working on the cart. Today when I went back to it, I decided to install v 1.8 -- to be at the latest version.

 

I used beyond compare to update all of the sts files which had changed. I uploaded the changed files -- when I ran the catalog, I got the following message:

 

Template file doesn't exist: [includes/sts_template.html]

Warning: fopen(STS_DEFAULT_TEMPLATE): failed to open stream: No such file or directory in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 82

Can't open Template file: [sTS_DEFAULT_TEMPLATE]

Warning: filesize(): Stat failed for STS_DEFAULT_TEMPLATE (errno=2 - No such file or directory) in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 86

 

Warning: fread(): supplied argument is not a valid stream resource in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 86

 

Warning: fclose(): supplied argument is not a valid stream resource in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 87

 

Anyone have an idea what I have done wrong?

thanks,

Murray

Did you change the STS_TEMPLATE to STS_DEFAULT_TEMPLATE in .../catalog/includes/configure.php ?

 

The define's changed a bit to support multiple templates.

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 have a quick question. If I wanted to install new infoboxes on my site that uses the STS system, Do I still need to add the infoboxes to the Column_left or Column_right php files, or do I just make a referance to them in the STS html file?

Update on this. I tried to install the Banner in a Box contrib just as I did on my site that does not run STS, following the exact instruction provided in the contrib.

 

That did nothing. Then I added $box-ad to the STSTemplate.html file and it did make the banner box show up, but it also messed up the location of the other banners. I put it on the left hand side of the template and it made half of my infoboxes that are supposed to be on the right hand side appear on the left underneath the banner box.

 

Has anyone successfully used both of these contributions? If so, what do you have to do differently from the normall instructions?

Infoboxes usually put a <tr><td> before their content and a </td></tr> after it. STS strips these tags off with the strip_unwanted_tags() function. It may be that your box doesn't have these tags in a way that STS expects to see them.

 

Turn on debugging and look at the $sts_block[yourboxname] and the $template[yourboxname] variables to see what STS has captured (the sts_block variable) and what it is outputting after it attempts to strip the TR and TD tags off.

 

You'll probably find your problem there. If you do, try changing your boxes's code to output the TR and TD tags in a way that STS expects them.

 

Hope this helps...

 

- 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'm now running into the same problem for Purchase Without Account (PWA). When I turn on $display_normal_output for debugging the Order_Info.php page displays below the sts_template.html. So I guess what's happening is STS doesn't know how to recognize Order_Info.php.

 

Like I've said before, I'm not a programmer.. so for those of you that are, maybe you could help me about how to make STS recognize this file? Maybe something needs to be added to the sts_user_code.php?

Post or PM me a link to your PWA page and I'll try to figure out what's going wrong. I haven't worked with PWA but maybe I can see from the debugging code what's going wrong.

 

- 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

I'm now running into the same problem for Purchase Without Account (PWA).  When I turn on $display_normal_output for debugging the Order_Info.php page displays below the sts_template.html.  So I guess what's happening is STS doesn't know how to recognize Order_Info.php. 

 

Like I've said before, I'm not a programmer.. so for those of you that are, maybe you could help me about how to make STS recognize this file?  Maybe something needs to be added to the sts_user_code.php?

It looks like the problem is that you are not capturing the $sts_block['columnleft2columnright'] block, which is where STS gets the $content variable from.

 

This is normally started at the bottom of includes/columnleft.php and stopped at the top of includes/columnright.php

 

I don't have access to the program, but it looks like PWA is somehow turning it the capture or something.

 

Does this at least give you somewhere to look?

 

- 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 don't know if I am the only one with this problem but on the last line of my store it doesnt complete my </html> all the way. Instead at first load I get </

then once you hit refresh or visit a page I then get it to load fully.

 

To see what I mean visit my site,

http://www.biostech.net/demo1/index.php

For an osCommerce and STS Tutorial click the www button in my profile.

Link to comment
Share on other sites

I don't know if I am the only one with this problem but on the last line of my store it doesnt complete my </html> all the way. Instead at first load I get </

then once you hit refresh or visit a page I then get it to load fully.

Your site loaded okay for me, but the </ is there at the bottom. When linking to a category the "</" disappears.

I looked at the source code and there it is below the </body> and the end </html> is missing. I believe what's wrong is that the "</ "should be completed to read "</html>" and my guess is that either your sts_template might need to be corrected or it may be index.php which has the truncated code. (The quotes are for gramatical purposes and should not go into the code. For example my index.php ends with this code.

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

My guess is that your's looks like this:

</body>

</

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

It's not in index.php but sts_template.html its at the very last line of sts template, its the </body></html> code.

 

When it loaded I viewed the source and looked for the </ .... when you refresh or reload its gone, and the whole source is there.

Edited by ixbiosxi

For an osCommerce and STS Tutorial click the www button in my profile.

Link to comment
Share on other sites

Both files look good, is it possible that it is trying to strip too many tags.

 

What could cause it not to parse the template file correctly until you refresh or click on a link?

For an osCommerce and STS Tutorial click the www button in my profile.

Link to comment
Share on other sites

I don't have access to the program, but it looks like PWA is somehow turning it the capture or something.

 

Does this at least give you somewhere to look?

 

- Brian

Yes, that was it. The column_right was missing from the PWA so by adding that line, it works. I had a friend take a look at the code and after poking around he found that last night/early this morning.

 

Thanks alot for this contribution, it made life easier for me!

Link to comment
Share on other sites

Humm.. im haveing a problem ... im useing STS 1.8 on osCommerce ver.,2.2ms2..

 

when i load up the index.php page all i see is the arranged boxes the way i made em.... but i also put a Background pickure in the STS template.html... dose the sts not show backgrounds?? if not how would i go about changeing this ?? heres a link so you can see whats happening

 

http://www.anime-trix.com/EXPERIMENTAL/osc...2.2ms2/catalog/

 

also thank you for supporting your contrib ^_^ i think that its great keep up the great work ^_^

 

...also heres a link to the template HTML page

http://www.anime-trix.com/EXPERIMENTAL/osc...s_template.html

 

..BTW now its not showing anything...*sigh* i hate being a NEWB

Edited by KUSANAGI_SEED
Link to comment
Share on other sites

This contibution is great. It works okay but I cannot get any of the dhml menu contibutes to work.

 

I tried them all and I would really like one off them to work.

 

With what Dhtml menu contribution will this work ?

 

I have now installed dhtm_menu1.0

Link to comment
Share on other sites

I had this as a seperate thread, but maybe it will work out better here.

 

I want to install Banner in a Box and Articles Contributions to a site running STS. How do I edit the STS system so that it will understand $articles and $box-ad ? Also, do I still edit column_left and column_right.php as the instructions for those mods specify, or do I need to edit a differetn file now?

 

by the way, I am running MS2 and the installation of STS was perfect, I had no problems with it at all.

Edited by Goanna
Link to comment
Share on other sites

I had this as a seperate thread, but maybe it will work out better here.

I'll try to answer some more questions later, but it is ALWAYS better to post your STS questions here, as this is the only thread I regularly read.

 

Also, please don't send me email directly, as all the time I have available for support I already devote to this thread. Unfortunately I am working on a number of different projects and have little time for support as it is.

 

Post here, and I will do my best to respond, and the many other people who use STS can also help answer your questions (thanks for the help, guys and gals!)

 

Also, if you use STS and want to say "Thank you" just includes a line like Simple Template System (STS) by DiamondSea.com on your page or somewhere on your site with a link to DiamondSea.com and help my Google rankings.

 

Here's the HTML:

Simple Template System (STS) by <a href="http://www.diamondsea.com/">DiamondSea.com</a>

 

Thank you,

 

- 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

I installed the template system and everything appears to work except for sometimes when i try to use the tellafriend option it just adds the product to my cart. This happens when i try to do it from the product page itself it i try to tellafriend from the reviews page it works.There must be some kind of page problem but I am not sure what it is.ANy ideas, has anyone had this problem?

 

THANKS!!!!

Melissa ;)

Link to comment
Share on other sites

I have the cart installed. Now I am trying to modify it but when I add a customized cart header, I still get the original cart box inserted into my modification. Any idea what I am doing wrong? I have installed the latest version of STS.

THANKS,

Link to comment
Share on other sites

The only reason I used STS is because I deigned a flash header that will only look right on a page 800 pixels wide.

 

I really dont need it for anything else, and it seems to be more trouble then it is worth when installing infobox contributions. I am not saying it is bad, it is definitly a nice add on, but for my purposes, it just doesnt seem to be working out as I need to install infoboxes that it is not compatible with.

 

How else could I define the store to contain itself within an 800 pixel wide frame?

Link to comment
Share on other sites

humm could you at least give me a few tips on my it dosent seem to work for me??

i posted on page 27 my problem, i was just wondering if anyhelp could be given ... im gonna try reinstalling everything agin soo.... hopefully ill have my problem solved.. BTW if my problem isnt with STS, then could you please link me to the proper forum?? im sry about shove posting, but id like to continue my developement ASAP thank you for your suport and dimond sea ^_^ MAD PROPS for your hard work, and also i have given credit where credit is due ^_^

Link to comment
Share on other sites

Hi there,

 

thanks a lot for the templating system - it means I will finally have the patience to make some OSC templates :)

 

I have hacked the file catalog/includes/sts_display_output.php to only display account, view cart, checkout when a user is logged in - it also will display "log off" as well as "my account" and when a user is not logged in it will only display "log in" :)

 

Here is the code:

 

Replace this (around line 157 of catalog/includes/sts_display_output.php ):

 

if (tep_session_is_registered('customer_id')) {
   $template['myaccount'] = '<a href=' . tep_href_link(FILENAME_LOGOFF, '', 'SSL')  . ' class="headerNavigation">' . HEADER_TITLE_LOGOFF . '</a>';
   $template['urlmyaccount'] = tep_href_link(FILENAME_LOGOFF, '', 'SSL');
 } else {
   $template['myaccount'] = '<a href=' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_MY_ACCOUNT . '</a>';
   $template['urlmyaccount'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');
 }

 $template['cartcontents']    = '<a href=' . tep_href_link(FILENAME_SHOPPING_CART) . ' class="headerNavigation">' . HEADER_TITLE_CART_CONTENTS . '</a>';
 $template['urlcartcontents'] = '<a href=' . tep_href_link(FILENAME_SHOPPING_CART) . ' class="headerNavigation">' . HEADER_TITLE_CART_CONTENTS . '</a>';

 $template['checkout'] = '<a href=' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_CHECKOUT . '</a>';
 $template['urlcheckout'] = tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL');

 

With this:

 

if (tep_session_is_registered('customer_id')) {
 $template['login'] = '<a href=' . tep_href_link(FILENAME_LOGOFF, '', 'SSL')  . ' class="headerNavigation">' . HEADER_TITLE_LOGOFF . '</a>';
 $template['urllogin'] = tep_href_link(FILENAME_LOGOFF, '', 'SSL');

 $template['myaccount'] = '<a href=' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_MY_ACCOUNT . '</a>';
 $template['urlmyaccount'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');
 
 $template['cartcontents']    = '<a href=' . tep_href_link(FILENAME_SHOPPING_CART) . ' class="headerNavigation">' . HEADER_TITLE_CART_CONTENTS . '</a>';
 $template['urlcartcontents'] = '<a href=' . tep_href_link(FILENAME_SHOPPING_CART) . ' class="headerNavigation">' . HEADER_TITLE_CART_CONTENTS . '</a>';
	 
 $template['checkout'] = '<a href=' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_CHECKOUT . '</a>';
 $template['urlcheckout'] = tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL');
 
 } else {
 $template['login'] = '<a href=' . tep_href_link(FILENAME_LOGIN, '', 'SSL')  . ' class="headerNavigation">' . HEADER_TITLE_LOGIN . '</a>';
 $template['urllogin'] = tep_href_link(FILENAME_LOGIN, '', 'SSL');

 $template['myaccount'] = '';
 $template['urlmyaccount'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');
 
 $template['cartcontents']    = '';
 $template['urlcartcontents'] = '<a href=' . tep_href_link(FILENAME_SHOPPING_CART) . ' class="headerNavigation">' . HEADER_TITLE_CART_CONTENTS . '</a>';
	 
 $template['checkout'] = '';
 $template['urlcheckout'] = tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL');
 
 }

 

Kindest regards

Lobos

Link to comment
Share on other sites

Just quickly,

 

I have added the create account option if a person isn't logged:

 

if (tep_session_is_registered('customer_id')) {
 $template['login'] = '<a href=' . tep_href_link(FILENAME_LOGOFF, '', 'SSL')  . ' class="headerNavigation">' . HEADER_TITLE_LOGOFF . '</a>';
 $template['urllogin'] = tep_href_link(FILENAME_LOGOFF, '', 'SSL');

 $template['myaccount'] = '<a href=' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_MY_ACCOUNT . '</a>';
 $template['urlmyaccount'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');
 
 $template['cartcontents']    = '<a href=' . tep_href_link(FILENAME_SHOPPING_CART) . ' class="headerNavigation">' . HEADER_TITLE_CART_CONTENTS . '</a>';
 $template['urlcartcontents'] = '<a href=' . tep_href_link(FILENAME_SHOPPING_CART) . ' class="headerNavigation">' . HEADER_TITLE_CART_CONTENTS . '</a>';
	 
 $template['checkout'] = '<a href=' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_CHECKOUT . '</a>';
 $template['urlcheckout'] = tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL');
 
 } else {
 $template['login'] = '<a href=' . tep_href_link(FILENAME_LOGIN, '', 'SSL')  . ' class="headerNavigation">' . HEADER_TITLE_LOGIN . '</a>';
 $template['urllogin'] = tep_href_link(FILENAME_LOGIN, '', 'SSL');

 $template['myaccount'] = '<a href=' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_CREATE_ACCOUNT . '</a>';
 $template['urlmyaccount'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');
 
 $template['cartcontents']    = '';
 $template['urlcartcontents'] = '<a href=' . tep_href_link(FILENAME_SHOPPING_CART) . ' class="headerNavigation">' . HEADER_TITLE_CART_CONTENTS . '</a>';
	 
 $template['checkout'] = '';
 $template['urlcheckout'] = tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL');
 
 }

 

Check the post above if you are wondering what this is ;)

 

Kindest regards

Lobos

Link to comment
Share on other sites

I have hacked the file catalog/includes/sts_display_output.php to only display account, view cart, checkout when a user is logged in - it also will display "log off" as well as "my account" and when a user is not logged in it will only display "log in" :)

Lobos,

I made the change -- when I get to the site but haven't logged in, I am still seeing the cart. Also haven't changed the login code you suggest until I hear back about that post.

Link to comment
Share on other sites

I am getting an error message when I try to access my site via the IE browser:

Template file doesn't exist: [includes/sts_template.html]Can't open Template file: [sTS_DEFAULT_TEMPLATE]

 

Can please tell me how to fix this little problem, the rest of the cart does not show at all, but if I type in the full path to the sts_template.html file I get the default tempate with blank table (except for the various strings that load each box).

If only I was the one helping you...

 

.:::::For complete data-driven and multi-media website creations:::::.

http://www.innocentinnovations.com

 

------------------------

Get instructions, visit the documentation site:

http://wiki.oscommerce.com/Top

Link to comment
Share on other sites

After reading more posts, I found that it may have to do with my includes/config file. Here is my file:

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

 

And this is in v 8, I have never had any previous version prior to this install.

Thanks in advance for the help :D

If only I was the one helping you...

 

.:::::For complete data-driven and multi-media website creations:::::.

http://www.innocentinnovations.com

 

------------------------

Get instructions, visit the documentation site:

http://wiki.oscommerce.com/Top

Link to comment
Share on other sites

hmm..

 

Hi, i just installed this, and it is not working..

i am getting the following error when i go to my shop:

Fatal error: Failed opening required 'includes/filenames.php' (include_path='') in /home/sites/site83/web/osc/eshop/includes/application_top.php on line 53

 

If i comment out this line(as there is no such file in my includes folder), it gives an error for the next required line, and if i comment That out, it gives me an error that it cannot find a table in my database..

 

Any ideas?

 

I am running this on a raq, using the package for osCommerce..

 

Please let me know when you can!

~Amy

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