Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Thanks for the reply. I think what I really want to do is insert some code in the template file that only shows up if the cart is not empty.

In other words, when I reference $cartbox, I want it to show up in the exact same way. But, I want to have some PHP in the sts_template.php file that says if(cart not empty) echo 'my html' else echo 'other'

Daniel, I understood what you wanted to do and my previous post still applies. Add your code to the tag in sts_column_left.php and then place the $cartbox in your template. It will not show if the cart is empty. There are other tags that already perform like this.

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

Does STS is 4.5.8 work with osCommerce Online Merchant v2.2 Release Candidate 2a , I'm trying to get this setup with the step by step instructions and I cant get it to work.

Yes, STS works perfectly with RC2 and RC2a as long as you follow the installation instructions for RC2 that are included with the contribution.

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,

I installed STS on an install of oscommerce 2.2 RCa. I then created a template and added some tags. It was working fine... then I refreshed and I got this error

Warning: include(includes/modules/sts_inc/) [function.include]: failed to open stream: No such file or directory in D:\my site\www\store\includes\modules\sts_inc\sts_display_output.php on line 21

Warning: include() [function.include]: Failed opening 'includes/modules/sts_inc/' for inclusion (include_path='.;C:\php\pear\') in D:\my site\www\store\includes\modules\sts_inc\sts_display_output.php on line 21

 

Now I KNOW for a fact that includes/modules/sts_inc/ and all of the files within it exist. I also reverted to the sts_template.php and am still getting the same error.

 

Any ideas?

Edited by jrd1mra
Link to comment
Share on other sites

Hello,

I installed STS on an install of oscommerce 2.2 RCa. I then created a template and added some tags. It was working fine... then I refreshed and I got this error

Warning: include(includes/modules/sts_inc/) [function.include]: failed to open stream: No such file or directory in D:\my site\www\store\includes\modules\sts_inc\sts_display_output.php on line 21

Warning: include() [function.include]: Failed opening 'includes/modules/sts_inc/' for inclusion (include_path='.;C:\php\pear\') in D:\my site\www\store\includes\modules\sts_inc\sts_display_output.php on line 21

 

Now I KNOW for a fact that includes/modules/sts_inc/ and all of the files within it exist. I also reverted to the sts_template.php and am still getting the same error.

 

Any ideas?

 

Duh, I had removed

Files for normal template
sts_user_code.php

I updated the admin to use this file for normal template and the problem went away.

Link to comment
Share on other sites

I asked before about how to make the #cartbox only show up when it has items; that worked, thanks.

 

Now, another question:

How can I define a variable on one of the pages being templated and then access it in the sts_template.php file? For example, on my login.php under the catalog folder, I might want to define a variable at the top called $title="Log In Page," and then somewhere on sts_template.php I want to be able to display $title. I tried using session variables and this worked, but the start_session() call seemed to interrupt with the cart by making the program forget that the user was logged in (because it was making a new session).

 

Thanks so much.

Link to comment
Share on other sites

I asked before about how to make the #cartbox only show up when it has items; that worked, thanks.

 

Now, another question:

How can I define a variable on one of the pages being templated and then access it in the sts_template.php file? For example, on my login.php under the catalog folder, I might want to define a variable at the top called $title="Log In Page," and then somewhere on sts_template.php I want to be able to display $title. I tried using session variables and this worked, but the start_session() call seemed to interrupt with the cart by making the program forget that the user was logged in (because it was making a new session).

 

Thanks so much.

First of all, there is no such file named sts_templates.php.

 

Look in the files under the includes/modules/sts_inc folder to see how variables are made. For a listing of variables already created, look in the STS User Manual.

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!

 

Now I get it!.. or some of "it" ;)

 

One question though:

Where do I change the layout of the different place holders? Such as Categories, Search and so on.

 

And One more Q:

Where do I chage the main content? The "What's New Here?" . The $content variabel I guess?

 

Have nice Days!

Link to comment
Share on other sites

Hi!

 

Now I get it!.. or some of "it" ;)

 

One question though:

Where do I change the layout of the different place holders? Such as Categories, Search and so on.

 

And One more Q:

Where do I chage the main content? The "What's New Here?" . The $content variabel I guess?

 

Have nice Days!

 

Look in the STS User Manual regarding how to change the "What's New Here" to display the "title" instead.

 

Look in the post directly above this one regarding how/where to edit the STS variables.

 

Categories is an infobox so you could consider using the STS Infobox Template feature. This feature works on all pages listed in includes/boxes/ and includes/modules/. Please refer to the STS User Manual on how to create an infobox template.

 

Note: The category menu is the most complicated of the boxes. I strongly suggest installing a contribution that is geared directly for the category menu. My favorite is listed in the STS User Manual: http://www.oscommerce.com/community/contributions,4201

 

Here is another one: http://www.oscommerce.com/community/contributions,4228

 

If using either of the two above, you would then need to create a new STS tag for it.

For the Nested Categories, you would add the following in your includes/modules/sts_inc/sts_column_left.php file:

 

Find:

// Get categories box from db or cache  
 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }  
 $sts->restart_capture ('categorybox', 'box');

Add after:

// Get categories box from db or cache  This page is for categories nested as an unordered list for easy css modifications by Bill Kellum
 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'ul_categories.php');
 }  
 $sts->restart_capture ('categorycssbox');

Now just add the $categorycssbox to your template where you want the css category menu to appear.

 

For the second, follow the step by step that I have posted in the STSv4 Power Pack site (a site dedicated to STS add-ons). The link is in my signature below.

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

I have two oscommerce templates I would like to turn into STS themes, I can provide the full oscommerce files and everything that is needed. I just dont have the time myself to do it.

How much would someone charge to do this for me and what turn around time?

 

1 template I need done for sure, and the other depending on price and maybe a few addones and modifications that should be pretty simple to do, I can explain more if anyone is interested in doing this.

Link to comment
Share on other sites

I have two oscommerce templates I would like to turn into STS themes, I can provide the full oscommerce files and everything that is needed. I just dont have the time myself to do it.

How much would someone charge to do this for me and what turn around time?

 

1 template I need done for sure, and the other depending on price and maybe a few addones and modifications that should be pretty simple to do, I can explain more if anyone is interested in doing this.

 

 

Jacob,

I have just sent you a personal message (PM)

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 all,

 

I've just installed a clean version of RC2a and dropped STS 458 over it.

 

I've created a very simple html file with only $content in the body section and set that as template in the STS admin section.

 

When I look at my shop, the 3 products in my test shop show up fine.

When I click on one product, I'm taken to the product page.

If I click on the "click to enlarge" link, it doesn't work and I get an error indicator (yellow exclamation point) in the bottom left corner of IE7.

 

In FF I don't get any error indicators, but clicking on the "click to enlarge" link doesn't do nothing.

 

Please help!

 

Many thanks in advance,

Erik.

Link to comment
Share on other sites

Hi all,

 

I've just installed a clean version of RC2a and dropped STS 458 over it.

 

I've created a very simple html file with only $content in the body section and set that as template in the STS admin section.

 

When I look at my shop, the 3 products in my test shop show up fine.

When I click on one product, I'm taken to the product page.

If I click on the "click to enlarge" link, it doesn't work and I get an error indicator (yellow exclamation point) in the bottom left corner of IE7.

 

In FF I don't get any error indicators, but clicking on the "click to enlarge" link doesn't do nothing.

 

Please help!

 

Many thanks in advance,

Erik.

Erik,

 

You're missing some of the important tags that are needed to pull in the JavaScript for the popup menu. Take a look at the blank template in the test folder. The purpose of this template is to show what HTML is required in order for STS to function properly.

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

Hey peeps!

 

Im working on an sts layout for a friend of mine,

 

Its been a while since I created the layout and now feel a bit rusty and could do with a couple of pointers..

 

 

First question is... I have about 9 links in my first columb left box that I have custom made and I wanted to add cutom text in the center of the page were the content would normaly show but im having trouble doing this, I have just eddited a page and removed the $content call and added my custom text the page works fine but im not sure were to save it and how to link to it using the sts system, Can anyone advice on this please?

 

Second little problem is I have about 7 main catagories all with sevral sub cats, When u click on a main catagorie for example I have

 

Phone accories : Parts : repairs etc etc...

 

It says at the top of that page listing the items in my sub cat Catagories at the head,. I would like to replace this word with an image But have a diffrent image at the head of each of my 7 main cats, It this possible? and if so how would I go about achieving this?

 

 

Thanks for any help given.. It is much appreciated and I will try my best to give back help to others that need it if I can

 

 

Anthony

Link to comment
Share on other sites

Erik,

 

You're missing some of the important tags that are needed to pull in the JavaScript for the popup menu. Take a look at the blank template in the test folder. The purpose of this template is to show what HTML is required in order for STS to function properly.

 

Bill, thanks for you prompt response.

 

Actually I already looked in the blank template, but this is all I see in there:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html $htmlparams>
<head>
<meta http-equiv="Content-Language" content="en-us">
<!--$headcontent-->
 <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<p>This is a blank template. Replace this text with your content. Enjoy! 
Template by: Bill Kellum</p>
</body>
</html>

 

I copied the <html $htmlparams> to my template file, but that didn't help.

 

Do you have any other suggestions?

 

Erik.

Link to comment
Share on other sites

I am using latest version of STS with HTC on oscommercev2.2rca

 

I am only selling 12 products so I have not set up any category/manufaturer besteseller or all that jazz. All that I currently have is the $whatsnewbox.

 

What I would like is simply to display 3 or 4 random selections of my products in that box. When I use the $whatsnewbox I only get one product. I was looking for a template placeholder which will display a Specific product or a random product. Any ideas on how to do this?

Link to comment
Share on other sites

Hi,

 

i've an issue with payment module telling me there is only one available even if i activate more than one payment module.

btw when i desactivate the sts template, the behavior is ok .. :blink:

i searched into the forum and didn't found any similar behavior

i'm using STS 4.5.8 with oscommerce

Link to comment
Share on other sites

Hi,

 

i've an issue with payment module telling me there is only one available even if i activate more than one payment module.

btw when i desactivate the sts template, the behavior is ok .. :blink:

i searched into the forum and didn't found any similar behavior

i'm using STS 4.5.8 with oscommerce

STS would not have anything to do with your payment modules not showing up unless of course you did not install STS correctly.

Use a file comparison tool such as Beyond Compare or WinMerge to compare your files with the files from the contribution to see where you may have gone wrong.

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, I am using STS and my images don't enlarge when you click the Click to enlarge link when viewing merchandise. Can anyone help me with this?

 

http://www.pymonogram.com/shopping

 

Thank you!

Candace

 

Candace,

 

Please see about 8 posts above your regarding the required tags for each template page to pull in the JavaScript.

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 there!

 

May I ask How I get flash to work on/with the osC site?

 

I sort of did like this in the index.php.html

 

<div id="flash">

<object width="763" height="368">

<param name="movie" value="couleurful.com_flash.swf">

<embed src="couleurful.com_flash.swf" width="763" height="368">

</embed>

</div>

 

That dont work..

 

Were do i put the flash and what would one write?

 

 

Sincerely,

Link to comment
Share on other sites

Hi. I used to use this bit of code in my header --

 

<?=$cart->count_contents()?>

 

Anyone know how I can do something similar in sts? Thanks

 

James, the following is a little more robust (I prefer it that way).

At the following code to your includes/modules/sts_inc/sts_user_code.php file:

 

 

$sts->start_capture();
$productno = $cart->count_contents();
$totalprice = $currencies->format($cart->show_total());

if ($productno > 1) {
echo ENTRY_HCART_CONTAINS;
echo " ";
echo $productno;
echo " ";
echo ENTRY_HCART_ITEMS;
echo " "; echo " ";
echo ENTRY_HCART_PRICE;
echo " ";
echo $totalprice;
} elseif ($productno == 0) {
echo ENTRY_HCART_EMPTY;
} else {
echo ENTRY_HCART_CONTAINS;
echo " ";
echo $productno;
echo " ";
echo ENTRY_HCART_ITEM;
echo " "; echo " ";
echo ENTRY_HCART_PRICE;
echo " ";
echo $totalprice;
}
$sts->stop_capture ('headcart');

Then, add $headcart in your template where you want it.

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

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