Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] STS v4


Guest

Recommended Posts

Sorry if the answer is already somewhere in this topic. If it is, I just don't know how to search for it because I've searched thru the topic and read lots of posts here and still can't find the answer.

 

In order to use separate stylesheets for my different store designs, I have to hard code the location of the stylesheets into the template files.

 

For example, this line from the sts_template.html file:

 

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

 

becomes something like:

 

<link rel="stylesheet" href="includes/sts_templates/GiftsGalore/stylesheet.css" type="text/css" />

 

Where 'GiftsGalore' is the "Template folder" I enter in the Default section of admin for STS.

 

Now maybe that's exactly how it is supposed to work, but it just seems awkward and makes me think I am doing something wrong.

 

Also, is there a contribution that would turn the "Template folder" entry box into a drop down menu with a list of all the folders in the 'sts_templates' folder?

 

Thanks,

Ken

Link to comment
Share on other sites

i only need to add this code right?

$sts->start_capture();
 include(DIR_WS_INCLUDES . 'boxes/featured.php');
 $sts->stop_capture('featuredbox');

 

now if i make an infobox template exactly like the one i have on the site (the bottom one), do i just insert productname1, productname 2 and so on so it displays each one or do i have to do some kind of loop????

 

You would make "infobox_featured.php.html" with just the $content tag and then "infobox_featured_header.php.html" with just the $headertext tag or replace the tag with your own text such as "Our Featured Products".

 

By the way, a single infobox.php.html template would work as well but all of your infoboxes would look the same (if that is what you want).

 

The $content tag should pull in your cotent (layout of the products) depending upon what your code tells it to do. In other words, if you installed "http://www.oscommerce.com/community/contributions,4491

(Products in Individual Boxes w/Featured Products), then the $content tag would automatically pull in those details.

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

Sorry if the answer is already somewhere in this topic. If it is, I just don't know how to search for it because I've searched thru the topic and read lots of posts here and still can't find the answer.

 

In order to use separate stylesheets for my different store designs, I have to hard code the location of the stylesheets into the template files.

 

For example, this line from the sts_template.html file:

 

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

 

becomes something like:

 

<link rel="stylesheet" href="includes/sts_templates/GiftsGalore/stylesheet.css" type="text/css" />

 

Where 'GiftsGalore' is the "Template folder" I enter in the Default section of admin for STS.

 

Now maybe that's exactly how it is supposed to work, but it just seems awkward and makes me think I am doing something wrong.

 

Also, is there a contribution that would turn the "Template folder" entry box into a drop down menu with a list of all the folders in the 'sts_templates' folder?

 

Thanks,

Ken

Ken,

FYI: There is a tag that will pull in the STS Template Folder: $templatedir

You can use this tag when making links for images and such. :thumbsup:

 

There is also another tag that may be of use to you. It is the $extracss tag.

 

In most cases the extracss tag is not needed, you would just put the link to your stylesheet in the header of your template (do not use in your infobox templates). If you have the need for a separate stylesheet for your infoboxes, you can add it to the extracss like this:

 

$sts->template['extracss'] .= '<link rel="stylesheet" type="text/css" href="infobox_stylesheet.css">';

and place <!--$extracss--> in your header along with your other stylesheet link.

 

 

The link to the stylesheet should be in the html header, not in the infobox template. Here are 3 ways you can do this:

 

  1. Copy the styles you need to the default osCommerce stylesheet.css file.
  2. Use the special placeholder $extracss (see above). You can place the link to infobox_stylesheet.css inside $extracss, and place $extracss in the html header (be sure to use the commented version as shown above or the actual text $extracss will display in the browser).
  3. Place links to your 2 stylesheets into your main template(s). If some styles are defined twice, the second one will be used. Just be aware of that.

As you can place php code into your templates, you can place something in extracss dynamically. For example: according to user's language or month of the year or whatever you are able to code.

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

FYI: There is a tag that will pull in the STS Template Folder: $templatedir

You can use this tag when making links for images and such. :thumbsup:

 

that did the trick, Bill.

 

I used this:

 

<link rel="stylesheet" type="text/css" href="$templatedir/style.css">

 

And it created this in the displayed file:

 

<link href="/osc/includes/sts_templates/easter/style.css" type="text/css" rel="stylesheet">

 

Which works great.

 

The layout for this store never really changes, so the plan is to use the same template files across all iterations of the store. Changing only the stylesheets to change the look of the store. Since the store is a gift shop driven by holidays and seasons, I can now just set up different Template folders for each holiday/season with their own stylesheets and the same template files.

 

I think your last suggestion will make that happen very well.

 

thanks,

Ken

Link to comment
Share on other sites

Hi All!

I thought intalling STS would be a great way to start off 2008!

(In this topic I guess you all agree...)

 

After installing STS works great but the header tags are gone...

My guess is that there are a few tweaks I have to do in:

includes/classes/sts.php and sts_inc/general.php to make HTC work again.

 

Would somebody with a working STS/HTC-shop please post the solution?

Thanks!

//Micke

Link to comment
Share on other sites

Hi All!

I thought intalling STS would be a great way to start off 2008!

(In this topic I guess you all agree...)

 

After installing STS works great but the header tags are gone...

My guess is that there are a few tweaks I have to do in:

includes/classes/sts.php and sts_inc/general.php to make HTC work again.

 

Would somebody with a working STS/HTC-shop please post the solution?

Thanks!

//Micke

Micke,

Take a look at the link in my signature below..."How to install HTC with STS".

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

 <tr>
<td background="images/infobox_module/left.gif" width="14"> </td>
<td align="center" class=mws_boxCenter_module><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><br> <a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS). '">' . tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/featured.gif', IMAGE_FEATUREDPRODUCT). '</a> </td>
<td class=mws_boxCenter_module2>'. strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $featured_products["products_id"]). '"><b>' . DESCR_READ_MORE . '</b></a><br><br>       <s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '">' . tep_image_button('cart_buy.gif', IMAGE_BUTTON_IN_CART) . '</a> <span class="productSpecialPrice">' . $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span></td>
<td background="images/infobox_module/right.gif" class="smallText" width="14"><img src="images/infobox_module/right.gif" width="14" height="149" /></td>
 </tr>

 

how should i edit that to make it look like the featured products below it?? on my site.

Link to comment
Share on other sites

Micke,

Take a look at the link in my signature below..."How to install HTC with STS".

Hi!

I have tried all the steps in your "how-to" exept this one:

For the catalog side, do NOT follow the HTC instructions

I get only blank pages...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

Does this mean that I have to roll back some of the things I did when I installed HTC a year and a half ago?

//Micke

Link to comment
Share on other sites

Hi!

I have tried all the steps in your "how-to" exept this one:

For the catalog side, do NOT follow the HTC instructions

I get only blank pages...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

Does this mean that I have to roll back some of the things I did when I installed HTC a year and a half ago?

//Micke

Did you configure the STS modules to use the HTC file (listed on Step 6)?

 

Also, if you added the HTC code to add the headertag info on the Catalog side, you will end up with error messages because STS is also doing this for your dynamically (redundant info).

 

As for the blank pages, rule out the above first and then start replacing each htc file with the file of the same name from the contribution. It appears something might have gotten corrupted during the file upload. It probably wouldn't hurt to run the database script again.

 

By the way, what version of each are you installing? I believe the most current is STSv4.5.8 and HTCv2.6.3.

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

OK! :)

 

Reading the install instructions for HTC I tried to roll back the installation.

 

Removing the HTC lines from application_top.php crashed the site.

 

+ I tried to add:

require_once(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

require_once(DIR_WS_FUNCTIONS . 'header_tags.php');

to sts_display_output.php

+ Page still blank

 

+ I commented out the if clause surrounding the title tag in:

// BOF: WebMakers.com Changed: Header Tag Controller v2.5.7

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

<title><?php echo TITLE; ?></title>

<?php

}

// EOF: WebMakers.com Changed: Header Tag Controller v2.5.7

?>

+ Page still blank

 

+ I added catalog/includes/boxes/header_tags.php that I for some reason left out when I installed HTC.

+ Page still blank

 

Any ideas? :(

//Micke

Link to comment
Share on other sites

Did you configure the STS modules to use the HTC file (listed on Step 6)?

 

Also, if you added the HTC code to add the headertag info on the Catalog side, you will end up with error messages because STS is also doing this for your dynamically (redundant info).

 

As for the blank pages, rule out the above first and then start replacing each htc file with the file of the same name from the contribution. It appears something might have gotten corrupted during the file upload. It probably wouldn't hurt to run the database script again.

 

By the way, what version of each are you installing? I believe the most current is STSv4.5.8 and HTCv2.6.3.

HTC works just fine until I set "Use templates" to true and add ";headertags.php" to the template files.

This must mean that no file, nor the database is corrupted, right?

 

STS works just fine (without header tags of course) until I add ";headertags.php" to the template files.

//Micke

Link to comment
Share on other sites

Hi All! :)

Good morning Chicago!

(Why the smiley?)

 

I commented out line 17 in sts_inc/headertags.php...

<?php
/*
 $Id: headertags.php,v 1.0 2005/11/03 23:55:58 rigadin Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2005 osCommerce

 Released under the GNU General Public License

STS PLUS v4 include module by Rigadin ([email protected]) for Header Tags Controller (contribution 207)
*/

 $sts->start_capture();
 if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
// require(DIR_WS_FUNCTIONS . 'header_tags.php');
  require(DIR_WS_INCLUDES . 'header_tags.php');
 } 
 $sts->stop_capture('headertags');

?>

...and HTC and everything seems to be working just fine...

...with STS enabled - and disabled...

...nice!

(Now, am I going to run up and down the stairs to use up this excess of seretonin and adrenalin so I can concentrate? No, I'll let it wear off slow and easy...)

//Micke

Link to comment
Share on other sites

Hi All! :)

Good morning Chicago!

(Why the smiley?)

 

I commented out line 17 in sts_inc/headertags.php...

<?php

[b]//Micke[/b]

I wouldn't get too excited about this as this seems to be a temp fix for an underlying issue. You WILL NEED that function if you want STS & HTC to work properly together.

 

I still think you either have a file in the wrong place or a piece of code that is undermining the sts_inc/headertags.php code.

 

:thumbsup: Have you considered doing a file comparison of your site against that of one of my STS/HTC bundles available in the STSv4 Power Pack site? This would be a quick way to see if something has been missed or out of place.

 

Hope you get it working properly soon,

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

Ok, can you help me fix the remaining part??? I tried but its not doing anything.

 

Site

 

1) Change the Product color, even though i have the class set to the appropriate class, its still not changing.

2) Align things properly, and show the entire product name.

3) And add the border around the entire featured products table.

Link to comment
Share on other sites

Ok, can you help me fix the remaining part??? I tried but its not doing anything.

 

Site

 

1) Change the Product color, even though i have the class set to the appropriate class, its still not changing.

2) Align things properly, and show the entire product name.

3) And add the border around the entire featured products table.

Ash,

As much as I enjoy helping people with STS, I think this thread needs to stay focused on STS and not CSS, or HTML, or Flash, or any other web skill needed to design a web site. I gave you some direction a few posts back on how to find what is what on your page (IE Developer Toolbar - FREE DOWNLOAD from Microsoft).

 

I used this tool to find that you need to edit the following CSS to get the image (....) to spread completely under each product:

url(images/bg_hor.gif) repeat-x center 50%

BACKGROUND: url(images/bg_hor.gif) repeat-x center 50%

Try changing that to 100% and that should fix that problem and align things for you.

 

You can easily add a border around the featured products table using an infobox template or add the css manualy to the featured.php page (I think that is the one).

 

Your products name will show automatically unless you have the font too large or the cell (or div) too small. I beleive in your case it is the font. This will need to be changed using CSS as well:

class item_name

 

Don't give up. I see that you have come a long way and you will appreciate what you have learned in doing this yourself. I really like what I see you doing. :thumbsup:

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

Alright guys, you have been really helpful in the past, hoping you can shed some light on this problem I'm having :

 

In IE my site does not display the content correctly and I think it has something to do with my custom STS template.

http://www.youraddressmagazine.com/shop/catalog

 

on the index the difference can be seen. in FF the whole message is displayed, in IE just the title of the page.

if you click the my account link at the top you can see more messed up stuff... none of the login boxes display, but instead, again the title and then a weird version of the sidebar.

 

thats the part that really perplexes me, and i have not found the root problem for. is it in the infoboxes you think?

 

any help would be greatly appreciated.

Link to comment
Share on other sites

Sorry I moved the site around so i could put an older working version up. IE ONLY ISSUES:

 

here is the index :

http://www.youraddressmagazine.com/shop2/catalog/index.php

 

and an example of the login problem :

http://youraddressmagazine.com/shop2/catal...ea950c05e3d19f8

 

the other pages seem to work fine, product info and such. updating the login.php to its original contents changed nothing.

Link to comment
Share on other sites

I have STS installed and working properly, but I was curious if there is a way to display the number of items in the cart without using the cartbox code. I have seen it done on a few different osCommerce sites, but I don't know what code they're using to do it.

Link to comment
Share on other sites

My question concerns the latest version of STS and HTC contribution. The STS instructions say not to totally follow the HTC catalog side of the instructions if I understood correctly. Does adding the headertags.php file to admin section of STS suppose to replace having to modify this bit of code in every page you need header tags.

 

QUOTE from HTC instructions................

 

CHANGES TO ALL FILES:

 

For Header Tags to work on a page of your site, that page must have the code

change mentioned below installed. You should make the following changes to

 

index.php

product_info.php

 

and any other file in the root directory (the same location where your

index.php file is located) that you want to have Header Tags to work with. For

example, if you want your privacy page to have its own title and meta tags,

then you should make this change to the privacy.php file. Only files that

contain <title><?php echo TITLE; ?></title> can be altered.

 

NOTE: The <TITLE> tag is different in popup_image.php and is not handled by

Header Tags Controller so there is no need to modify that file.

 

In each file you want to edit, make the following modification:

 

FIND:

 

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

 

REPLACE with:

 

<?php

// BOF: Header Tag Controller v2.6.3

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

<title><?php echo TITLE; ?></title>

<?php

}

// EOF: Header Tag Controller v2.6.3

 

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

 

My Header title and meta tags all seemed to be functioning fine but the following bit of code on the product_info.php.html page does not fuction without the above change.............

 

 

Quote from HTC:

 

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="smallText" align="center"><?php echo TEXT_VIEWING; ?> 

<?php echo '<a title="' . $tags_array['title'] . '" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL') . '"/# ' . $tags_array['title'] . '">' . $tags_array['title']; ?></a></td>

</tr>

 

 

All I get is "Currently Viewing:" with nothing else

 

As I said, I solved it with changing the code but would like to confirm I have it working as it was designed to function in STS.

Basically my question is , by adding the headertags.php file after sts_user_code.php in admin, is this suppose to take care of this automatically because it seems to contain the same code to include in the page.

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