Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

hi,

 

how can i get this code to work in STS

 

<?php
echo '<a href=shopping_cart.php>view cart</a> (' . $cart->count_contents(). ')' . $currencies->format($cart->show_total());
?>

 

it displays the cart content like this "View Cart(0) $0.00"

 

it works fine when i add it to an original osc php file but when i try to use it in a template i get this error

 

"Fatal error: Call to a member function on a non-object in /home/pixelhub/public_html/includes/sts_templates/test/sts_template.php on line 48

"

 

can any one help me with this

 

Cheers

Craig

 

it ok i have it.

 

i just added

 

$sts->start_capture();

echo '<a href=shopping_cart.php>view cart</a> (' . $cart->count_contents(). ')' . $currencies->format($cart->show_total());

$sts->stop_capture('simple_cart');

 

to sts_user_code.php

 

and used the placment name

 

$simple_cart

 

in the future i will read the instructions before asking a question :blush:

 

cheers

Craig

Link to comment
Share on other sites

Hey Guys

 

I have installed the loginbox as per the install instructions. I am now using the STS V4 template for my site, so i need to setup the memberlogin.php as a box

 

in sts_template.html i setup the coding as

 

if ((tep_session_is_registered('customer_id')) && (basename ($PHP_SELF,".php") != 'login')){ include(DIR_WS_BOXES . 'memberlogin.php');

$sts->restart_capture ("memberloginbox', 'box');

}

 

However, i get

 

Parse error: parse error, unexpected $ in /home/racespec/public_html/catalog/includes/modules/sts_inc/sts_column_left.php on line 107

 

ANy help ASAP would be much appreciated?

 

Thanks

 

Tarek

Link to comment
Share on other sites

Hi,

 

I have a small problem.

 

If I put tags (like $cartbox or $categorybox) it shows always the full content box with this code at the header of the box:

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_left.gif" border="0" alt="" width="11" height="14"></td>

<td width="100%" height="14" class="infoBoxHeading">Categories</td>

<td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>

</tr>

</table>

 

But I want that the script shows me only the categories without the title. How can I resolve this problem?

Link to comment
Share on other sites

Hey Guys

 

I have installed the loginbox as per the install instructions. I am now using the STS V4 template for my site, so i need to setup the memberlogin.php as a box

 

in sts_template.html i setup the coding as

 

if ((tep_session_is_registered('customer_id')) && (basename ($PHP_SELF,".php") != 'login')){ include(DIR_WS_BOXES . 'memberlogin.php');

$sts->restart_capture ("memberloginbox', 'box');

}

 

However, i get

 

Parse error: parse error, unexpected $ in /home/racespec/public_html/catalog/includes/modules/sts_inc/sts_column_left.php on line 107

 

ANy help ASAP would be much appreciated?

 

Thanks

 

Tarek

 

I guess you are inserting the code in sts_column_left.php and not in sts_template.html . What code you have at line 107 of sts_column_left.php?

 

The forum for STS v4 is in different place, you'll find more infos here:

http://www.oscommerce.com/forums/index.php?sho...view=getnewpost

 

- Rigadin

Link to comment
Share on other sites

You can download the newest version of Simple Template System (STS) here:

 

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

 

- Brian

 

Er... well... I'm going to ask a very dumb question, but... WHERE is the download link? :huh:

 

This one? --> http://www.oscommerce.com/community/contributions,1524

 

I've seen nothing there.. :blink:

 

Help!

 

Marcos

Link to comment
Share on other sites

Er... well... I'm going to ask a very dumb question, but... WHERE is the download link? :huh:

 

This one? --> http://www.oscommerce.com/community/contributions,1524

 

I've seen nothing there.. :blink:

 

Help!

 

Marcos

 

 

Go Back to the link.

Scroll down the page and click on the brown and green icon next to the STS that you want to d/l....it's there I just checked!!

Edited by Sierrab
Link to comment
Share on other sites

Hello everybody.

 

Thanks for good script, but i have a proplem.

 

I think i followed intructions right when installing STS. but now i have header before my STS theme, the header (logo, and "header navigation" etc.) ain't in my sts_template.html.

 

What have i done wrong ?

Link to comment
Share on other sites

Hi

 

I am using the Simple Template System (v4) and then went to install the category tabs with subtabs contribution.

 

After installing and visiting the store I got this message:

 

Warning: main(STS_RESTART_CAPTURE): failed to open stream: No such file or directory in /home/www/includes/modules/sts_inc/sts_user_code.php on line 27

 

Fatal error: main(): Failed opening required 'STS_RESTART_CAPTURE' (include_path='.:/usr/local/php4/share/pear') in /home/www/includes/modules/sts_inc/sts_user_code.php on line 27

 

 

 

This corresponds to this line in sts_user_code.php where I put the extra code:

 

require (STS_START_CAPTURE);

 

 

 

Which is part of this code which the installation instruction said to put in:

 

//BEGIN Categories Tabs

$sts_block_name='categories_tabs';

require (STS_RESTART_CAPTURE);

include_once(DIR_WS_INCLUDES . 'categories_tab.php');

require(STS_STOP_CAPTURE);

$template['categories_tabs'] = strip_unwanted_tags($sts_block['categories_tabs'], 'categories_tabs');

//END Categories Tabs

 

//BEGIN Sub-Categories Tabs

$sts_block_name='categories_subtabs';

require (STS_RESTART_CAPTURE);

include_once(DIR_WS_INCLUDES . 'categories_subtab.php');

require(STS_STOP_CAPTURE);

$template['categories_subtabs'] = strip_unwanted_tags($sts_block['categories_subtabs'], 'categories_tabs');

//END Sub-Categories Tabs

 

 

 

Has anyone got any ideas?

 

Thanks

 

Sam

Link to comment
Share on other sites

I have had the STS system installed for quite awhile now and for some reason I can't seem to get rid of the line of whitespace above my template. It appears as though the information from the original PHP pages of OSCommerce are still being parsed, but they are empty.

 

This causes the body and header to be displayed twice (Though there is nothing displayed in the first parsing of the page)

 

Here is the top of the header code on my pages after viewing the source:

 

<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="171" valign="top"><table border="0" width="171" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Salty Dog Cafe Online Store</title><base href="http://www.saltydog.com/store/">

<!-- start get_javascript(applicationtop2header) //-->
<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>
<!-- end get_javascript(applicationtop2header) //-->

<link rel="stylesheet" type="text/css" href="stylesheet.css">
<body>

 

 

As you can see the header and body are showing up twice. I have posted my template code as well so you can see that there should be nothing out of the ordinary going on. let me know if anyone has any ideas.

 

A live version of this site is located here: http://www.saltydog.com/store/index.php

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html $htmlparams>
<head>
<!--$headcontent-->
 <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
<td>?</td>
<td width="785"><table width="785" border="0" cellspacing="0" cellpadding="0">
	<tr>
	  <td width="16" background="includes/sts_templates/full/images/l_shadow.jpg"><img src="includes/sts_templates/full/images/l_shadow.jpg" width="16" height="11"></td>
	  <td width="769"><table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td><img src="includes/sts_templates/full/images/t_nav.jpg" width="769" height="63" border="0" usemap="#Map"></td>
		  </tr>
		  <tr>
			<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td valign="middle" bgcolor="#00449b"><img src="includes/sts_templates/full/images/r2_c1.jpg" width="94" height="26"></td>
				  <td valign="middle" bgcolor="#00449b" class="topnav"><a href="http://www.saltydog.com/store/index.php?cPath=32">T-Shirts </a> <a href="http://www.saltydog.com/store/index.php?cPath=80">Sweatshirts </a> <a href="http://www.saltydog.com/store/index.php?cPath=28">Men </a> <a href="http://www.saltydog.com/store/index.php?cPath=26">Women </a> <a href="http://www.saltydog.com/store/index.php?cPath=27">Childrenswear </a> <a href="http://www.saltydog.com/store/index.php?cPath=22">Hats </a> <a href="http://www.saltydog.com/store/index.php?cPath=25">Pets </a> <a href="http://www.saltydog.com/store/index.php?cPath=40">Products </a> </td>
				  <TD width="230" height="26" align="right" valign="middle" background="includes/sts_templates/full/images/r2_c3.jpg"> Search:
					<form name="quick_find" action="http://www.saltydog.com/store/advanced_search_result.php" method="get">
						<input type="text" name="keywords" size="10" maxlength="30" style="width: 75px" class="loginButton">
					  ?
					  <input name="submit" type="submit" title=" Quick Find " value="GO">
					</form>
					??								  
				</tr>
			  </table></td>
		  </tr>
		  <tr>
			<td><table width="100%" border="0" cellpadding="4" cellspacing="0">
				<tr bgcolor="#1b7eab">
				  <td height="18" colspan="2" valign="top"><table width="75%" border="0" cellspacing="0" cellpadding="0">
					  <tr>
						<td width="17%" height="22" valign="middle" class="subnav">?</td>
						<td width="83%" height="22" valign="middle" class="subnav">?</td>
					  </tr>
					</table></td>
				</tr>
				<tr>
				  <td height="303" colspan="2" valign="top" background="includes/sts_templates/full/images/r3_c1.jpg">?</td>
				</tr>
				<tr>
				  <td width="171" align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="4">
					<tr>
					  <td><p>$cartbox</p>
						  <p>$informationbox</p>
						  <p>$bestsellersbox</p></td>
					</tr>
				  </table>
					<table width="135" border="0" cellpadding="2" cellspacing="0">
					  <tr>
						<td width="135" align="center" valign="top"><script src=https://seal.verisign.com/getseal?host_name=www.saltydog.com&size=M&use_flash=YES&use_transparent=YES?=en></script>
							<br />
						  <a href="http://www.verisign.com/ssl/ssl-information-center/" target="_blank"  style="color:#000000; text-decoration:none; font:bold 7px verdana,sans-serif; letter-spacing:.5px; text-align:center; margin:0px; padding:0px;">About SSL Certificates</a></td>
					  </tr>
					</table></td>
				  <td width="614" rowspan="2" valign="top">
				  $content
					<p>$specialfriendbox</p>
					<p>$footer_text</p>
				  </td>
				</tr>

			  </table></td>
		  </tr>
		</table></td>
	</tr>
  </table></td>
<td background="includes/sts_templates/full/images/r_shadoew.jpg">?</td>
 </tr>
</table>
<map name="Map">
 <area shape="rect" coords="-57,-15,290,59" href="index.php">
 <area shape="rect" coords="510,-1,593,60" href="account.php">
 <area shape="rect" coords="597,-4,675,60" href="shopping_cart.php">
 <area shape="rect" coords="679,-15,744,59" href="checkout_shipping.php">
</map>
</body>
</html>

Assault

If you want to find it you'll have to google "Assault T-Shirts" because posting my damn url in my signature is against the forum rules.

T-Shirts with an edge

Powered by OSCommerce + about 20 different custom addons and some Wordpress

Link to comment
Share on other sites

As far as I can tell, this module is broken as hell. I am having to edit every one of my php files in /catalog in order to remove all the extra crap that OSC is printing around STS. Each page has two headers, and a lot of pages also have dual language, notifications, and tell a friend boxes. I can only assume I will be editing the code on those too.

 

This is probably more of an OSC problem than a STS problem, because OSC should have a more elegant way of printing its header code out than to have a dozen different pages all with the same giant block of header code, but still. Annoying.

 

I wish I had known before hand what a giant mess I was getting into before I started hacking this thing in.

 

I asked about this problem weeks ago and got no response. Sigh. This was supposed to save me work.

Link to comment
Share on other sites

As far as I can tell, this module is broken as hell. I am having to edit every one of my php files in /catalog in order to remove all the extra crap that OSC is printing around STS. Each page has two headers, and a lot of pages also have dual language, notifications, and tell a friend boxes. I can only assume I will be editing the code on those too.

 

This is probably more of an OSC problem than a STS problem, because OSC should have a more elegant way of printing its header code out than to have a dozen different pages all with the same giant block of header code, but still. Annoying.

 

I wish I had known before hand what a giant mess I was getting into before I started hacking this thing in.

 

I asked about this problem weeks ago and got no response. Sigh. This was supposed to save me work.

What version of STS are you using? Do you have any other contributions installed? It appears you may have STSv4 installed but you also installed two errant files (from Cally) that causes the issue that have described. If you turn STS off from the admin panel, are you still experiencing the problems?

 

I will need to know more information before I can really begin to help you out.

 

I hope the little bit above will lead you in the right direction,

 

Bill Kellum

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

Hello STS users!

 

 

 

STS v4.1 has been updated to STS v4.2. :D

 

STS v4.2 is a User-Friendly Version of the Simple Template System (STS).

 

 

Version 4.2 is the easiest template system to date for the osCommerce solution. STS has recently been ranked 5th among contribution downloads for osCommerce, passing BTS (Basic Template System).

 

The Simple Template System (STS) has seen a lot of great changes over the years, changes for the better and has drawn a huge fan base. I hope that this version will continue that trend as well as bring in the novice who may have considered previous STS versions ?too taunting?. :blink:

 

This update includes the "Footer? patch, as well as the "Product info module v1.0.6" and ?Index module v1.0.3? updates, integrated into one seamless install. We can all thank Chris (Rigadin2) for these fine updates! I have only taken these updates and bundled them into one seamless install package, along with easy to understand documentation and additional templates for your convenience.

 

STS v4.2 is an official release of the Simple Template System.

 

Why this new version 4.2?

STS 4.1 has seen three major changes and a few bug fixes since its release back in April 2006. Without this update, in order to install a stable STS v4.1, new users would have to download four different files as well as make some additional changes to a few of the PHP files in their store. With version 4.2, installation is as simple as downloading this complete package and following the instructions toward one seamless installation. Instructions for manual installation are still available for those who have a heavily modified store.

 

If you have kept up with all of the fixes mentioned in the support forum as well as the patches and new modules uploaded onto the contribution site, then you already have version 4.2, without the updated documentation and additional templates of course.

 

Main advantages of this version:

-Integrated all bug fixes and updates to this fine contribution into one seamless package.

-Updated the install text as well as the contribution?s documentation to make the installation and use of STS 4 more user-friendly.

-Added a new ?blank? template with all of the required code for ease of use to create your own STS v4.2 templates from scratch.

-Added install instructions for the ?Infobox Templates for STS? contribution as an STS4.2 add-on.

 

STS 4.2, differences with STS 4.1:

-Updated ?includes/modules/sts/sts_index.php? (Rigadin2, May 8, 2006, Index module v1.0.3 for STS4)

-Updated ?includes/sts/sts_product_info.php (Rigadin2, June 5, 2006, Product info module v1.0.6)

-Updated ?includes/footer.php? (Rigadin2, July 25, 2006 ?Footer Patch?)

-Updated ?sts_templates? folder from both the ?clean_osc? and ?upload? folders (cleaned up discrepancies and remains from STS PLUS)

-Bug fix: ?index.php_0.html? template for main page will now work as designed.

-Added: A new module parameter to set in admin.

You now have the choice to set STS to look for templates of parent categories.

-Bug fix: The ?sts_product_info.php? module does not call the function sts_strip_content_tags anymore when using a content template, because there is nothing to take away from your content template.

 

You can download it here:

 

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

 

Enjoy,

Bill Kellum

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

Nice - thanks!

 

But I get this in admin:

 

Parse error: parse error, unexpected T_RETURN, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /xxxxxxxx/catalog/includes/modules/sts/sts_index.php on line 97

 

Probably easy to solve but I dont know how..

Link to comment
Share on other sites

In response to my own problem above I upgraded to 4.2 and everything was fixed.

Assault

If you want to find it you'll have to google "Assault T-Shirts" because posting my damn url in my signature is against the forum rules.

T-Shirts with an edge

Powered by OSCommerce + about 20 different custom addons and some Wordpress

Link to comment
Share on other sites

I am having trouble opening the zip file for STS v4.2 posted on August 10, 2006 in: http://www.oscommerce.com/community/contri...,all/search,sts

 

Files and folders inside the zip have a size of 0. Only the install_text and stsv4_2.doc can be decompressed.

 

Updating my post: The files are inside the zip, but the folders are broken. Creating the zip again probably will fix the problem.

Link to comment
Share on other sites

Updating my post: The files are inside the zip, but the folders are broken. Creating the zip again probably will fix the problem.

The problem can be experienced using Windows XP unzip default tool. If you experience this problem, you can use an alternate program to decompress it. I tried 7-zip and the folders unzipped ok.

Link to comment
Share on other sites

Seems like this is an amazing contribution!

 

I am having a small issue however.

 

http://www.milagro-herbs.com/catalog/index.php

 

I simply can't get any content dynamic or static to display. Is there something obvious I am missing during the admin set-up?

 

Any thought or suggestions are appreciated.

Are you using a stop character at the end of your placeholders?

 

By adding a stop character at the end of placeholders, like $content$ or $content# instead of just using $content, the sorting of the big array containing all the placeholders variables is not needed anymore.

 

To do so, you have to open your template, add the same end character to all placeholders. For example: "$", then tell the system to use this end character. This is done by defining a constant in the template. Add this code at the beginning of your template to indicate you are using an end char:

 

<?php DEFINE ('STS_END_CHAR', '$'); ?>

 

For content templates, add this instead of the above code:

 

<?php DEFINE ('STS_CONTENT_END_CHAR', '$'); ?>

 

Hope this helps,

 

Bill Kellum

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

The problem can be experienced using Windows XP unzip default tool. If you experience this problem, you can use an alternate program to decompress it. I tried 7-zip and the folders unzipped ok.
I'm sorry that you have experienced download problems. The STSv4.2 is packaged as a standard zip file. If you are using Windows XP, you should have been able to just simply right click on the downloaded zip file and then selected extract from the sub-menu.

 

I have provided a separate download site for those who may be experiencing similar difficulties:

 

http://www.soundsgoodpro.com/stsv4_2.htm

 

The above link also provides PDF versions of the User Manual and Installation documents.

 

Hope this makes it easier for everyone,

 

Bill Kellum

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

Wow Bill, after looking 4.2 over I'm impressed, however, from my last experience with 4.1 I'm a little afried to give it a try and prefer to use 2.01. Am I wrong in thinking like this or would you recommend this upgrade to be far better than the 4.0 or 4.1 and less stressful and more successful?

 

BTW Thanks for your hard work in putting all this in one place and I really like the install instructions as they are far less complicated that before. Very well done.

 

Guy

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