Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

I have upgraded an STS template module for a client from an earlier version to v4.5.8 and have a strange issue where in the $footer tag that previously worked no longer loads and instead it simply just says $footer in the page

 

the footer.php file has the necessary code added to it to load and the application_bottom.php page load time is displayed under the $footer tag on the page

 

anyone have any ideas as to the cause of this?

Share this post


Link to post
Share on other sites

Hello. I am using STS and stuck on an issue. For the index.php template I use a graphic that I want to appear only on the homepage. But, since it is the template used as well for the product listings page, it shows the graphic there as well (ie, it shows on the graphic meant for the homepage on the link /catalog/index.php?cPath=1). Now, I know I can create templates for each category - but I don't want to do that.

 

Is there a way to create a general template to be used for all product listing pages versus specific ones?

Share this post


Link to post
Share on other sites

Hello. I am using STS and stuck on an issue. For the index.php template I use a graphic that I want to appear only on the homepage. But, since it is the template used as well for the product listings page, it shows the graphic there as well (ie, it shows on the graphic meant for the homepage on the link /catalog/index.php?cPath=1). Now, I know I can create templates for each category - but I don't want to do that.

 

Is there a way to create a general template to be used for all product listing pages versus specific ones?

 

You need to make an index.php_0.html template and include your graphic there. This will be used only for the "home" page

Then make an index.php.html template (without graphic) that will be used in all product listings

Share this post


Link to post
Share on other sites

You need to make an index.php_0.html template and include your graphic there. This will be used only for the "home" page

Then make an index.php.html template (without graphic) that will be used in all product listings

 

That is exactly what I needed! Thank you so much!!!

Share this post


Link to post
Share on other sites

Good Afternoon,

 

I am fairly new to osCommerce and definitely new to STS. So, I have a problem and I can't figure out how to fix it. I had downloaded a Rounded-Red Template for STS, put it in the includes/sts_templates/ folder, and changed the template location in the STS config to be rounded (the name of the folder).

 

However when I go to view the catalog, I receive this error:

1146 - Table 'oscsystem.TABLE_MENU' doesn't exist

 

Select * From TABLE_MENU Order By sort_order

 

[TEP STOP]

 

I am running 2.2rc2 - any ideas as to why this is happening?

Share this post


Link to post
Share on other sites

Good Afternoon,

 

I am fairly new to osCommerce and definitely new to STS. So, I have a problem and I can't figure out how to fix it. I had downloaded a Rounded-Red Template for STS, put it in the includes/sts_templates/ folder, and changed the template location in the STS config to be rounded (the name of the folder).

 

However when I go to view the catalog, I receive this error:

1146 - Table 'oscsystem.TABLE_MENU' doesn't exist

 

Select * From TABLE_MENU Order By sort_order

 

[TEP STOP]

 

I am running 2.2rc2 - any ideas as to why this is happening?

 

This would not have anything to do with STS. What the error is saying is that you are either missing a table from your database or that your new template has a variable in it that is calling for information from that non-existing table.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Good Afternoon,

 

I am fairly new to osCommerce and definitely new to STS. So, I have a problem and I can't figure out how to fix it. I had downloaded a Rounded-Red Template for STS, put it in the includes/sts_templates/ folder, and changed the template location in the STS config to be rounded (the name of the folder).

 

However when I go to view the catalog, I receive this error:

1146 - Table 'oscsystem.TABLE_MENU' doesn't exist

 

Select * From TABLE_MENU Order By sort_order

 

[TEP STOP]

 

I am running 2.2rc2 - any ideas as to why this is happening?

 

This would not have anything to do with STS. What the error is saying is that you are either missing a table from your database or that your new template has a variable in it that is calling for information from that non-existing table.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hi, I'm new to osC, STS, php and (oh, who the hell am I kidding) this entire ecommerce shebang.

 

Issue #1

Basically, I've been reading all the info related to STS and have had some slight success in tweaking my storefront. But when I tried to create my own HTML file (test_1.html) with STS variables, uploaded it to catalog/includes/sts_templates/full/ but it won't work! It's still displaying the original sts_template.html that's in the same folder! I've already changed the STS Default Module to use "test_1.html" as the default template file. Can somebody please enlighten me on this?

 

Issue #2

If the template we need to edit is sts_template.html, then can I please ask what the index.php.html file is for?! When I view them, they're both exactly this same! Needless to say, this makes me quite confused.

 

 

Sorry if these questions have been mentioned before. It is quite impossible to sieve through 200+ pages in this topic. I've tried, and obviously didn't succeed in finding an answer.

 

Help is GREATLY appreciated! Thanks! :)

Share this post


Link to post
Share on other sites

Hi, I'm new to osC, STS, php and (oh, who the hell am I kidding) this entire ecommerce shebang.

 

Issue #1

Basically, I've been reading all the info related to STS and have had some slight success in tweaking my storefront. But when I tried to create my own HTML file (test_1.html) with STS variables, uploaded it to catalog/includes/sts_templates/full/ but it won't work! It's still displaying the original sts_template.html that's in the same folder! I've already changed the STS Default Module to use "test_1.html" as the default template file. Can somebody please enlighten me on this?

 

Issue #2

If the template we need to edit is sts_template.html, then can I please ask what the index.php.html file is for?! When I view them, they're both exactly this same! Needless to say, this makes me quite confused.

 

 

Sorry if these questions have been mentioned before. It is quite impossible to sieve through 200+ pages in this topic. I've tried, and obviously didn't succeed in finding an answer.

 

Help is GREATLY appreciated! Thanks! smile.gif

 

 

Please don't say that you've tried to "sieve" through this topic and could not find the answer as the answer to this is "all" throughout this topic. You could also use Google to search this thread for the answer.

 

The template name is very important to how STS works. It will always look for the sts_template.html if it is within the same template folder as your templates are in. I suggest using that name for your default template and don't try to rename it anything else. The link below will provide more details:

 

thumbsup.gif The answer to your issue and most likely other issues you might face being new to STS and osCommerce is here. (post #5160)

 

Hope this helped you out in some way.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hmmm... After i installed STS i get the following

 

1054 - Unknown column 'p.products_image_array' in 'field list'

 

select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_array, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from products p, products_description pd where p.products_status = '1' and p.products_id = '28' and pd.products_id = p.products_id and pd.language_id = '1'

 

[TEP STOP]

 

when i click on a product.

What should i do?

Share this post


Link to post
Share on other sites

Dear All,

 

I'm searching a good contrib for additonnal product in product info compatible with STS 4.5.8

 

for example if the customer select a flashlight, i want the batteries, lightbulbs or any additional accessories appears on the product info page under my item.

It's quite similar as the "related products", but I want the ability to select my "sub products"... Ive tried "master products" but it didnt work well.

 

If you have a good contribution in mind... thanks so much in advance.

 

Olivier


STS 4.5.8

Share this post


Link to post
Share on other sites

Dear All,

 

I'm searching a good contrib for additonnal product in product info compatible with STS 4.5.8

 

for example if the customer select a flashlight, i want the batteries, lightbulbs or any additional accessories appears on the product info page under my item.

It's quite similar as the "related products", but I want the ability to select my "sub products"... Ive tried "master products" but it didnt work well.

 

If you have a good contribution in mind... thanks so much in advance.

 

Olivier


STS 4.5.8

Share this post


Link to post
Share on other sites

Dear All,

 

I'm searching a good contrib for additonnal product in product info compatible with STS 4.5.8

 

for example if the customer select a flashlight, i want the batteries, lightbulbs or any additional accessories appears on the product info page under my item.

It's quite similar as the "related products", but I want the ability to select my "sub products"... Ive tried "master products" but it didnt work well.

 

If you have a good contribution in mind... thanks so much in advance.

 

Olivier


STS 4.5.8

Share this post


Link to post
Share on other sites

I guess I'm being a bit slow today but I managed to get the STS system to work all except for the Multiple Custom Categories.

 

I created a file in the main directory of the template i amy using (it is within the same area as /test and /full) the file name is product_info.php_c1.php

 

So I want it to affect all of cpath 1...but nothing happens.

 

Am I missing something am I to add something? All I wanted the STS system was specifically for custom multiple categories and i can't get it to work...

Share this post


Link to post
Share on other sites

I guess I'm being a bit slow today but I managed to get the STS system to work all except for the Multiple Custom Categories.

 

I created a file in the main directory of the template i amy using (it is within the same area as /test and /full) the file name is product_info.php_c1.php

 

So I want it to affect all of cpath 1...but nothing happens.

 

Am I missing something am I to add something? All I wanted the STS system was specifically for custom multiple categories and i can't get it to work...

Share this post


Link to post
Share on other sites

I guess I'm being a bit slow today but I managed to get the STS system to work all except for the Multiple Custom Categories.

 

I created a file in the main directory of the template i amy using (it is within the same area as /test and /full) the file name is product_info.php_c1.php

 

So I want it to affect all of cpath 1...but nothing happens.

 

Am I missing something am I to add something? All I wanted the STS system was specifically for custom multiple categories and i can't get it to work...

 

 

Take a look at the following thread as it will answer your question as well as more you may come upon:

 

Important Posts for the STS newbie:

 

Post #3755: http://forums.oscomm...p;#entry1226986

 

Post #4326: http://forums.oscomm...p;#entry1303555

 

Post #4974: http://forums.oscomm...p;#entry1361366

 

Post #3772: http://forums.oscomm...p;#entry1227769

 

Post #3757: http://forums.oscomm...p;#entry1227006

 

Please review the above for insight on how the Simple Template System allows you to make templates for pages, categories, home page, products and infoboxes.

 

Hope this was helpful,


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Dear all,

perhaps this question is posted, but I cannot find out it within this large forum.

 

Okay,

My store is accessed via few websites with IFRAMES with its own domain.

Due this configuration, I have no logos to be shown.

But as google has indexed it very well :rolleyes: people can access it directly.

So I have a default page for this domain <mydefaultpage.htm> that is on frameset, that contains a logo for the store, in the very top and /index.php as the bottom frame.

 

If I push "home" from the store, it create a second, third, fourth... top frame giving a awfull design.

 

I have been looking for the code to modify the breadcrums to be able to do something like to have the home link to

 

mystore.domain.com/ ...... target="_top"

 

to be able to get the home page with only one top frame.

 

I am sorry but I am unable to find out how to do this.

 

Could you please help me in this issue?

 

Thank you.

Regards.

Share this post


Link to post
Share on other sites

Take a look at the following thread as it will answer your question as well as more you may come upon:

 

Important Posts for the STS newbie:

 

Post #3755: http://forums.oscomm...p;#entry1226986

 

Post #4326: http://forums.oscomm...p;#entry1303555

 

Post #4974: http://forums.oscomm...p;#entry1361366

 

Post #3772: http://forums.oscomm...p;#entry1227769

 

Post #3757: http://forums.oscomm...p;#entry1227006

 

Please review the above for insight on how the Simple Template System allows you to make templates for pages, categories, home page, products and infoboxes.

 

Hope this was helpful,

VERY HELPFUL! for some reason I could access the search thread option so I tried searching this URL with google + what I was looking for and had very little success. But now it's working for me, so I'm glad of that.

However I can't seem to find a thread solving the one last problem I have

My variable is displaying when you acess the actual product

http://egogen.com/1234/product_info.php?cPath=21_24_26_27&products_id=29

 

You see $categorybox in the left corner? I'm not quite sure where and what I did wrong, but I'm doing the slow method of replace file I modified with the original OSC file until it goes away. So far no luck. What exactly causes a variable to display as a variable? I would search more but I'm not sure which phrase to ue other than "Variable showing" or "Variable displayed" or "tags displayed/showing"

Share this post


Link to post
Share on other sites

I have a strange problem with a heavily modified shop that uses STS... I'm not sure when this problem started, but I am having no luck tracking down the issue/resolution and am hoping somebody here can help. My issue is with my menu... I have Top level categories and 2 levels of subcategories. From the homepage all the menus go to the proper category page and display the correct STS template. But if I click into a Subcategory, and then from there click BACK to a top level category, the cPath is holding on to the subcategory path, and while it displays the correct products, my template is not working, and it will show the template from the corresponding subcategory that is connected to that cPath...

 

Right now, I have my categories.php page hardcoded with my menu. I know this is only a temporary fix, and I'd really appreciate any ideas on where I might find the problem? I'm not sure that this is an STS problem but since it is a problem calling the correct template, I am hoping somebody might have run into this issue too?

 

Thanks,

Janet

 

If it helps, here is my categories.php file:

 

<?php

/*

$Id: show_subcategories.php,v 1.0 2003/01/08 10:37:00 Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com/

 

Based on: main_categories.php Ver. 1.0 by Gustavo Barreto

 

History: 1.0 Creation

 

Released under the GNU General Public License

 

*/

 

// Preorder tree traversal

function preorder($cid, $level, $foo, $cpath)

{

global $categories_string, $HTTP_GET_VARS;

 

// Display link

if ($cid != 0) {

for ($i=0; $i<$level; $i++)

$categories_string .= ' ';

$categories_string .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath

=' . $cpath . $cid) . '">';

 

// 1.6 Are we on the "path" to selected category?

$bold = strstr($HTTP_GET_VARS['cPath'], $cpath . $cid . '_') || $HTTP_GET_VARS['cPath'] == $cpath . $cid;

// 1.6 If yes, use <b>

if ($bold)

$categories_string .= '<b>';

$categories_string .= $foo[$cid]['name'];

if ($bold)

$categories_string .= '</b>';

$categories_string .= '</a>';

// 1.4 SHOW_COUNTS is 'true' or 'false', not true or false

if (SHOW_COUNTS == 'true') {

$products_in_category = tep_count_products_in_category($cid);

if ($products_in_category > 0) {

$categories_string .= ' (' . $products_in_category . ')';

}

}

$categories_string .= '<br>';

}

 

// Traverse category tree- this is for older snapshots pre-November 2002

/* foreach ($foo as $key => $value) {

if ($foo[$key]['parent'] == $cid) {

// print "$key, $level, $cid, $cpath<br>";

preorder($key, $level+1, $foo, ($level != 0 ? $cpath . $cid . '_' : ''))

;

} */

// Function used for post November 2002 snapshots

function tep_show_category($counter) {

global $foo, $categories_string, $id;

 

for ($a=0; $a<$foo[$counter]['level']; $a++) {

$categories_string .= " ";

}

}

}

 

?>

<!-- show_subcategories //-->

<tr>

<td class="infoBox_left">

 

<?php

 

//////////

// Display box heading

//////////

//$info_box_contents = array();

// $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CATEGORIES);

// new infoBoxHeading($info_box_contents, true, false, false, true);

 

//////////

// Get categories list

//////////

// 1.2 Test for presence of status field for compatibility with older versions

// $status = tep_db_num_rows(tep_db_query('describe categories status')); used for older snapshots

$status = tep_db_num_rows(tep_db_query('describe ' . TABLE_CATEGORIES . ' status'));

 

 

$query = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image

from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd

where c.categories_id = cd.categories_id";

// 1.3 Can't have 'where' in an if statement!

if ($status >0)

$query.= " and c.status = '1'";

$query.= " and cd.language_id='" . $languages_id ."'

order by sort_order, cd.categories_name";

 

$categories_query = tep_db_query($query);

 

 

// Initiate tree traverse

$categories_string = '';

preorder(0, 0, $foo, '');

 

//////////

// Display box contents

//////////

$info_box_contents = array();

$row = 0;

$col = 0;

while ($categories = tep_db_fetch_array($categories_query)) {

if ($categories['parent_id'] == 0)

{

$temp_cPath_array = $cPath_array; //Johan's solution - kill the array but save it for the rest of the site

unset($cPath_array);

 

$cPath_new = tep_get_path($categories['categories_id']);

 

$text_subcategories = '';

$subcategories_query = tep_db_query($query);

while ($subcategories = tep_db_fetch_array($subcategories_query))

{

 

if ($subcategories['parent_id'] == $categories['categories_id'])

{

 

$cPath_new_sub = "cPath=" . $categories['categories_id'] . "_" . $subcategories['categories_id'];

 

$text_subcategories .= '' . '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '" class="menusubcateg">' . '   ' . tep_image(DIR_WS_IMAGES . 'pointer_blue_light.gif', '') . $subcategories['categories_name'] . '</a>' . " ";

} // if

} // While Interno

//start befordch fix (show category count)

$cPath_myNewPath = explode('_',str_replace("cPath=", "", $cPath_new));

$cPath_new_fix = "cPath=" . $cPath_myNewPath[count($cPath_myNewPath)-1];

$buildtext = ' <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_fix, 'NONSSL') . '" class="menucateg"><b>' . ' ' . tep_image(DIR_WS_IMAGES . 'cat_arrow_right.gif', '') . $categories['categories_name'];

$info_box_contents[$row] = array('align' => 'left',

'params' => 'class="smallText" width="125" valign="top"',

'text' => '' . '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '" class="menucateg"><b>' . ' ' . tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', '') . $categories['categories_name'] . '</b></a>' . $text_subcategories);

$col ++;

if ($col > 0)

{

$col = 0;

$row ++;

}

$cPath_array = $temp_cPath_array; //Re-enable the array for the rest of the code

}

}

new infoBox($info_box_contents, true);

 

 

?>

</td>

</tr>

<!-- show_subcategories_eof //-->

Share this post


Link to post
Share on other sites

edited: sorry, the forum hiccupped and posted my question twice

Edited by janetgot

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×