Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

I would like to have $imagelarge return images from a custom folder \catalog\images\largeimages instead of from the value of DIR_WS_IMAGES (typically \catalog\images).

 

Can someone point me to the "best" place to make this change?

 

Thanks.

 

Mike

Not only the best place, probably the only one:

go to catalog/includes/sts_product_info.php about line 46 you'll find:

$template['imagelarge'] = tep_image(DIR_WS_IMAGES ......

Make your changes here.

Link to comment
Share on other sites

Not only the best place, probably the only one:

go to catalog/includes/sts_product_info.php about line 46 you'll find:

$template['imagelarge'] = tep_image(DIR_WS_IMAGES ......

Make your changes here.

 

 

Thanks, but I need a little more help.

 

Here are the changes I've made.

 

In /catalog/includes/configure.php I added one line:

define('DIR_WS_LARGE_IMAGES', DIR_WS_LARGE_IMAGES . 'images/largeimages/');

 

Then in /catalog/includes/sts_product_info.php I changed:

$template['imagelarge'] = tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), '','','');

 

to

 

$template['imagelarge'] = tep_image(DIR_WS_LARGE_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), '','','');

 

(only changed DIR_WS_IMAGES to DIR_WS_LARGE_IMAGES)

 

I have placed my small images in /catalog/images and the large ones in /catalog/images/largeimages and have used the same names.

 

After making these changes, no image displays on the product page.

 

Any ideas why?

 

Thanks a lot.

 

Mike

Mike in Key West

Link to comment
Share on other sites

Thanks, but I need a little more help.

 

Here are the changes I've made.

 

In /catalog/includes/configure.php I added one line:

  define('DIR_WS_LARGE_IMAGES', DIR_WS_LARGE_IMAGES . 'images/largeimages/');

 

Then in /catalog/includes/sts_product_info.php I changed:

  $template['imagelarge'] = tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), '','','');

 

to

 

  $template['imagelarge'] = tep_image(DIR_WS_LARGE_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), '','','');

 

(only changed DIR_WS_IMAGES to DIR_WS_LARGE_IMAGES)

 

I have placed my small images in /catalog/images and the large ones in /catalog/images/largeimages and have used the same names.

 

After making these changes, no image displays on the product page.

 

Any ideas why?

 

Thanks a lot.

 

Mike

The piece of code in red does not work as you define a variable using itself (therefore not yet defined). It should be:

define('DIR_WS_LARGE_IMAGES', DIR_WS_IMAGES . 'largeimages/');

 

- Rigadin

Link to comment
Share on other sites

Are custom templates for checkout_*.php, login.php possible with STS? I'd like to reconfigure those pages a little different than my standard template to help facilitate the checkout process. Does the same syntax that works for product_info.php custom templates somehow apply to these files as well?

 

Jacob

Link to comment
Share on other sites

Are custom templates for checkout_*.php, login.php possible with STS? I'd like to reconfigure those pages a little different than my standard template to help facilitate the checkout process. Does the same syntax that works for product_info.php custom templates somehow apply to these files as well?

 

Jacob

 

Yes they are, we do the same thing, just use the same syntax.

 

Regards,

 

Peter

Link to comment
Share on other sites

Hi guys, I'm a new user of this super program. A question: It is possible to define the main page, with this addons?

 

Thanks

 

There is a contribution called Define Main Page or something near which adds a WYSIWYG editor to the admin side, to display something on the front page without entering html code in the language file. What is around this (header, columns, footer) are defined in your template.

I hope I answered the question.

 

- Rigadin

Link to comment
Share on other sites

hey guy, where are those file:

STS_TEMPLATE_DIR.php

STS_DEFAULT_TEMPLATE.php

 

There aren't in the STS-2_01 pack

 

And another question: what are the packs I need to download? There too many... :'(

 

The last full version is dated 5 feb 2005. Update from 25 Aug 2005 is needed and other depends on which contributions you are using.

Edited by 241
Link to comment
Share on other sites

I don't understand a thing in the document of "25 Aug 2004 - STS 2.01 Bug fixes":

2) The popup fix from 2 Apr 2004 was buggy, the info_shopping_cart.php was not displayed anymore in popup window and

separate templates for specific pages did not work anymore.

- FIX: $scriptname renamed $scriptname1 (2x in the code below)

- FIX: inserted lost line $scriptbasename = ... that is used to detect specific page templates.

 

The code (around line 63) should look like that:

 

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

$scriptname = $_SERVER['PHP_SELF'];

// Returns file name without path nor parameters

$scriptbasename = substr($scriptname, strrpos($scriptname, '/') + 1);

$scriptname1 = strstr($scriptname, "popup");

$scriptname2 = strstr($scriptname, "info_shopping_cart");

// If script name contains "popup" then turn off templates and display the normal output

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

if ($scriptname1 != false || $scriptname2 != false) {

$display_normal_output = 1;

$display_template_output = 0;

}

 

What I have to do?

Link to comment
Share on other sites

Are custom templates for checkout_*.php, login.php possible with STS? I'd like to reconfigure those pages a little different than my standard template to help facilitate the checkout process. Does the same syntax that works for product_info.php custom templates somehow apply to these files as well?

 

Jacob

 

Yes they are, we do the same thing, just use the same syntax.

 

Regards,

 

Peter

 

Excellent! Should I just use the tag list that is applicable as well? Are there any new and/or different tags for those pages? Thanks for the response, Peter.

 

Jacob

Link to comment
Share on other sites

Ok I need some really good STS/PHP programmars to help me with this little dilemma:

 

I want to create several sts variables similar to the $content variable that will allow me to put the products from several different sub-category pages all on the main category page.

 

For example, suppose I had a main category called clothes, and under that I had sub-categories called shirts, shoes, and pants. How can I make variables like $content_shirts, $content_shoes, $content_pants, that will take their respective subcategory products and put them in a product list on the main page clothes?

 

It doesn't seem like this would be too complicated. I've already hacked the dickens out of STS like you guys wouldn't believe, but this one kind of stumps me. Please help! :)

Link to comment
Share on other sites

I can't figure out what I am doing wrong. I am trying to add a couple statice pages to my site and I want to use the $cataloglogo and $cat menu on them . I believe I set them up as templates but when I view them the header and cat. pull down menu don't show up. It's probably something obvious but I'm stumped. Any help would be appreciated.

 

Here's the link

Wickedwomancandleco.com

 

Thanks

Shelby :huh:

Link to comment
Share on other sites

  • 2 weeks later...

Has anyone checked out Fancier Invoice & Packingslip?

 

This contrib emails a html invoice to the customer when they place an order. The really cool part is that with STS it looks like it would email the invoice placed inside the main page layout like where you would place $content. The only problem is that with STS it doesn't actually send the content.

 

Here is what I'm talking about. Remember these are screenshots of the email that the customer would get and I haven't finished with the colors etc so they may not match.

 

This is with STS DISABLED

Email-Invoice-05-76.jpg

 

This is with STS ENABLED.

STS-Email-Invoice-05-76.jpg

 

What would be really awesome is to have the top image integrated with STS so that the email would look like it does when you view the invoice from the web page. Like this.

STS-Web-Invoice-05-76.jpg

 

I'm not a PHP programmer by any means, I can hack and slash but that's it. I would really like to someone get this integrated with STS and I think it is a really fantastic way to remind the customer about your store. Every time they open that email it's like they are visiting your store again.

 

Anyone up to the challenge? :-"

 

Dave.

Link to comment
Share on other sites

Hello there,

i have a problem with this contrib. the sts system duplicates my html, head, body tags. heres some code:

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
<title>osCommerce</title>
<base href="http://www.leuchtenzentrale.de/catalog/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<!-- Page layout by Simple Template System (STS) v2.01 on osCommerce 2.2-MS2 - http://www.diamondsea.com/sts/ -->
<!-- Using Template File [includes/sts_template.html) -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>osCommerce</title><base href="http://www.leuchtenzentrale.de/catalog/">
<!-- start get_javascript(applicationtop2header) //-->
<!-- end get_javascript(applicationtop2header) //-->
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>

Ive seen this problem in this thread around page 5 or so, but this was ages ago (v1.3) and didnt helped me. i didnt got anything useful with this forums' search engine.

can anyone please help me. thx in advance.

 

regards benjamin

Link to comment
Share on other sites

Hi,

 

what version is the latest now? I have been checking the download section with the v1.3 readme file on top.

 

There I could only find:

5 Feb 2004 - Simple Template System (STS) v2.01

 

Is this the latest one?

I am a first time user/installer.

 

Thanks

 

Pathfinder

Link to comment
Share on other sites

Hi,

 

I'm repeating (and resuming) this question from several days ago.  Please, can somebody help me ?  I'm still having the same trouble:

I'm using STS, but I'm having a little problem: I've just finished setting up my shopping cart, but in "manufacturers" (which I call "artists", I'm selling CDs), it always send me to the index page, no matter which artist I choose.  I'm having the same trouble from the "artist Info, more products" links. 

 

In the other hand, the box with the "all manufacturers" text in, in the category page -where the products per category are displayed- works correctly.

 

I'm sure that each product has a manufacturer assigned to it.

 

My site: www.costaqmusic.com

 

I can see what you mean. If I try "artist" Duo Feterman by using http://www.costaqmusic.com/index.php?manufacturers_id=17 , it doesn't work.

 

If I try http://www.costaqmusic.com/index.php?cPath...2a&filter_id=17 , I can see the product for the artist Duo Feterman.

 

Why does one work and not the other ?

 

Simple, ...... have you seen the source code generated ?

 

The one that works uses this template:

 

http://www.costaqmusic.com/includes/sts_te.../index.php.html

 

The one that doesn't work uses this template:

 

http://www.costaqmusic.com/includes/sts_te...ndex.php_0.html

 

Why doesn't the second one work ? Because you have no "$content" defined. :D

 

Peter

Link to comment
Share on other sites

STS FIX FOR SEF AND Ultimate SEO URLs

 

I just uploaded a fix to the contributions section that fixes a little problem I've been having when using Ultimate SEO URLs + STS. Hope it helps!

Link to comment
Share on other sites

GREAT !! thank you.

 

the problem is that, when I first installed OsC and did this shopping cart, I didn't know how to do anything. I used STS and took out the $content to put the content I wanted on the index (I didn't want the greeting, the new products...).

 

Now I know a little (very little) more, so I edited the index.php to have the content from there as I wanted it, not direct html editing on the index_0.php template.

 

thank you again.

Shutiri.

Link to comment
Share on other sites

This contrib is just great, but I just have one problem. I tried to find it in this thread but I couldn't. Now when I have installed STS I get like borders around everything, have I missed doing something?

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