Jump to content
rigadin2

[Contribution] STS v4

Recommended Posts

that would be too good to be true :)

 

this is my html-code:

<a href="products_new.php"><img border="0" src="images/button_header_newproducts.gif"></a>

 

The image is in /catalog/includes/sts_templates/mytemplate/images/dutch/

 

but it is not showing. I have chmodded the images dir to 777. Did I misunderstand you?

 

Gina

 

Ah ok... so you're not talking about the regular form submit and page change buttons then? Where does your code go? Also really it's better if you can use the tep_href_link function to create your links so that the session parameters are passed from page to page. And from there I need to hand over to someone who knows how this stuff works better...

Share this post


Link to post
Share on other sites
Ah ok... so you're not talking about the regular form submit and page change buttons then? Where does your code go? Also really it's better if you can use the tep_href_link function to create your links so that the session parameters are passed from page to page. And from there I need to hand over to someone who knows how this stuff works better...

 

i am editing the index.php.html file with frontpage, but that is obviously not the way to go...... :huh: Could someone tell me in what file I should put my image/button and how the syntax should be? I guess I am somewhat overwhelmed by all possiblities.

 

Thanks anyway,

Gina

Share this post


Link to post
Share on other sites
Hi,

 

I asked for a pointer how to add images/buttons that show differently in diferent languages and got referred to the manual. Allthough I have read it and tried a few things, those don't seem to be working for me. I have added a few lines (based on the cataloglogo) to general.php in catalog/includes/modules/sts_inc, but all it showed was $new_button in my website.

I think I want to make a new placeholder, but would like to know in what files I should add what?

 

I know this is a noob-question, but unfortunately that is what I am.

 

TIA

Gina

Gina,

 

I answered this a month or so back...take a look at the following step by steps:

 

http://forums.oscommerce.com/index.php?s=&...t&p=1100849

or

http://forums.oscommerce.com/index.php?s=&...t&p=1087860

 

Tracy is correct for images for default osC functions but you will need to follow the advice given in the above threads to make your images change per language in your shop.

 

Hope this helped you out,


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

Can I drag the topic back round to using the category/manufacturer descriptions section of HTC with STS? Bill you mentioned editing the $headertags placeholder to include the category or manufacturer descriptions, but that code is this:

 

$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 anyway it only belongs in the <head> section of the page. When I add the category stuff to the main index.php page it stops the meta tags working, even though I'm not adding the meta tags bits to the head section of index.php The $content placeholder includes the category image and heading, which is replaced in HTC, and I'm just not following where $content gets the content from exactly, though obviously it's index.php somewhere...

 

This would be easier to wrap my head round without the toddler jiggling about next to me...

Share this post


Link to post
Share on other sites
Can I drag the topic back round to using the category/manufacturer descriptions section of HTC with STS? Bill you mentioned editing the $headertags placeholder to include the category or manufacturer descriptions, but that code is this:

 

$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 anyway it only belongs in the <head> section of the page. When I add the category stuff to the main index.php page it stops the meta tags working, even though I'm not adding the meta tags bits to the head section of index.php The $content placeholder includes the category image and heading, which is replaced in HTC, and I'm just not following where $content gets the content from exactly, though obviously it's index.php somewhere...

 

This would be easier to wrap my head round without the toddler jiggling about next to me...

Tracy,

Since I created the bundled version of STS & HTC assuming that the STS users would use category templates to add in their category descriptions, I purposely left out the instructions to modify the catalog/index.php file. Since the $content tag works according to the script that is being called upon, you will need to do the following in order for your $content tag to include the categories_htc_description field from your database:

 

Find the following lines in catalog/index.php

 

Around line 70:

 

Find:

 

	if ($category_depth == 'nested') {
$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

 

and replace with:

 

	if ($category_depth == 'nested') {
$category_query = tep_db_query("select cd.categories_name, c.categories_image, cd.categories_htc_title_tag, cd.categories_htc_description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

 

=============================================

Around line 78:

 

Find:

 

	<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  </tr>

 

and replace it with:

 

		   <td><h1><?php echo $category['categories_htc_title_tag']; ?></h1></td>
	   <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	   <?php if (tep_not_null($category['categories_htc_description'])) { ?> 
	  <tr>
	   <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
	   <td><h2><?php echo $category['categories_htc_description']; ?></h2></td>
	  </tr>
	  <?php } ?>

=============================================

Around line 247:

 

Find:

 

	?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

and replace it with:

 

 

if (isset($HTTP_GET_VARS['manufacturers_id'])) 
  $db_query = tep_db_query("select manufacturers_htc_title_tag as htc_title, manufacturers_htc_description as htc_description from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
else 
  $db_query = tep_db_query("select categories_htc_title_tag as htc_title, categories_htc_description as htc_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'");

$htc = tep_db_fetch_array($db_query);
?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td><h1><?php echo $htc['htc_title']; ?></h1></td>

Around line 298

 

Find:

 

   <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
 </tr>

 

REPLACE with:

 

		   <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, $category['categories_htc_title_tag'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>		   
	  <?php if (tep_not_null($htc['htc_description'])) { ?> 
	  <tr>
	   <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
	   <td colspan="2"><h2><?php echo $htc['htc_description']; ?></h2></td>
	  </tr>
	  <?php } ?>

The above code made reference to the following styles: h1 and h2.

You can modify that to be anything you want or just add the following to your catalog/stylesheet.css file:

 

In stylesheet.css, add the following. Set it to the desired size and\

color for your shop.

 

 

h1 { 
font-family: Verdana, Arial, sans-serif;
font-size: 20px;
font-weight: bold;
margin-bottom: 0;
padding-bottom: 0;
}

h2 {
font-family: Verdana, Arial, sans-serif;
font-size: 14px;
font-weight: normal;
margin-bottom: 0;
padding-bottom: 0;
}

 

That will get you what you want. I do not think there is any need to create a placeholder for the above but I guess you can if you really wanted to in order to insert the categories_htc_description data anywhere on your template.

 

Hope that was what you were looking for,


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

Bill, thanks for all that :) but I forgot to mention before that for some reason when I add those bits the meta tags stop working! And well obviously I need both, LOL

Share this post


Link to post
Share on other sites
Bill, thanks for all that :) but I forgot to mention before that for some reason when I add those bits the meta tags stop working! And well obviously I need both, LOL
Tracy, that should not be the case. You have something incorrect in your installation then...most likely the code that you entered in your index.php file. Be sure that you are inserting that code into your "catalog/index.php" file and not the other index.php files in the store.

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
Bill, thanks for all that :) but I forgot to mention before that for some reason when I add those bits the meta tags stop working! And well obviously I need both, LOL

Also, one more point...

After making the changes to your index.php file, it might be a good idea to run the "Fill All Tags" routine in the HTC Admin.


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

I'm having trouble getting the infobox templates to work. I enabled them in admin, created my html template, uploaded it to my templates folder in a boxes subfolder. Since it is for my categories box, I tried naming both infobox_category.php.html and infobox_categories.php.html. The default box still shows when I view my pages. Either I am missing a step or I'm not naming the infobox file correctly?

 

Thanks

Share this post


Link to post
Share on other sites
I'm having trouble getting the infobox templates to work. I enabled them in admin, created my html template, uploaded it to my templates folder in a boxes subfolder. Since it is for my categories box, I tried naming both infobox_category.php.html and infobox_categories.php.html. The default box still shows when I view my pages. Either I am missing a step or I'm not naming the infobox file correctly?

 

Thanks

Debbie, it would be named using the naming structure of the PHP files listed in your catalog/includes/boxes folder. For the categories infobox, you would use the following infobox template name:

 

infobox_categories.php.html

 

The infobox template should be uploaded into your catalog/includes/sts_templates/*template folder*/boxes folder.

Also, be sure you have Use Infobox Templates enabled in the STS Default Module in your store's admin.


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

OK...got it to work. Not sure what I missed the first time around. Are you in the Chicago area, Bill?

 

Debbie, it would be named using the naming structure of the PHP files listed in your catalog/includes/boxes folder. For the categories infobox, you would use the following infobox template name:

 

infobox_categories.php.html

 

The infobox template should be uploaded into your catalog/includes/sts_templates/*template folder*/boxes folder.

Also, be sure you have Use Infobox Templates enabled in the STS Default Module in your store's admin.

Share this post


Link to post
Share on other sites

Hi everyone,

 

I've got the image popupproblem, and I've tried loads of suggestions out here but I just can't seem to get it to function. I've fully tested the site on localhost and everything worked, but online the popups stopped functioning. I've got the $htmlparams> stuff, javascript is being included, and I'm using the original product_info.php and popup_image.php, also I got al the tags from the sts_blank_template.html and sts_template.html for as far is I know. Could someone help me get the popups working again? Big thanks :)!

 

the webshops location is: http://kreatrends.nl/catalog/

Share this post


Link to post
Share on other sites
Hi everyone,

 

I've got the image popupproblem, and I've tried loads of suggestions out here but I just can't seem to get it to function. I've fully tested the site on localhost and everything worked, but online the popups stopped functioning. I've got the $htmlparams> stuff, javascript is being included, and I'm using the original product_info.php and popup_image.php, also I got al the tags from the sts_blank_template.html and sts_template.html for as far is I know. Could someone help me get the popups working again? Big thanks :) !

 

the webshops location is: http://kreatrends.nl/catalog/

Here is your problem and solution:

 

When the pop-up image in your cart is coming up as a template page instead of the larger image ... you should turn off "Use Search-Engine Safe URLs (still in development)" which is configured in the MY STORE page of Configuring your catalog.

 

:thumbsup: Tip: DO NOT USE THAT FEATURE since it is very buggy. If you just have to have that function, try the other URL mods that are available.


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

Hello,

 

I have OsC v2.2 MS2 that came with my host, and installed STSv4.5. I followed the Install Text, but the index.php file shows up as the regular OsCommerce layout. It doesn't use the template. Also, I don't know if this makes a difference, but when I overwrote the /includes/function/html_output.php file, I got this error message:

 

Fatal error: Call to a member function image() on a non-object in /home/coconuts/public_html/includes/functions/html_output.php on line 78

 

So I put the original file back. I've used STS once before, but didn't have a problem setting it up.

Thanks in advance!

Share this post


Link to post
Share on other sites
Hello,

 

I have OsC v2.2 MS2 that came with my host, and installed STSv4.5. I followed the Install Text, but the index.php file shows up as the regular OsCommerce layout. It doesn't use the template. Also, I don't know if this makes a difference, but when I overwrote the /includes/function/html_output.php file, I got this error message:

 

Fatal error: Call to a member function image() on a non-object in /home/coconuts/public_html/includes/functions/html_output.php on line 78

 

So I put the original file back. I've used STS once before, but didn't have a problem setting it up.

Thanks in advance!

Upgrade to STSv4.5.2 and your error should go away. The actual problem lies with a bug that showed up since v4.4.

 

Bug fix 1 of 2 can be found at: http://forums.oscommerce.com/index.php?s=&...t&p=1023674

 

At the very end of application_top.php, it should look like this:

(be sure you have this code as below)

 

// START STS 4.1
 require (DIR_WS_CLASSES.'sts.php');
 $sts= new sts();
 $sts->start_capture();
 // END STS 4.1
// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;

// set which precautions should be checked
 define('WARN_INSTALL_EXISTENCE', 'true');
 define('WARN_CONFIG_WRITEABLE', 'true');
 define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
 define('WARN_SESSION_AUTO_START', 'true');
 define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
?>

 

Bug fix 2 of 2 can be found at: http://forums.oscommerce.com/index.php?s=&...t&p=1037770

 

Templates are not being recognized by STS.

 

Open the includes/modules/sts/sts_default.php file.

Find:

 

 

if (strstr($scriptbasename, "popup") || strstr($scriptbasename, "info_shopping_cart")) {
return ''; // We don't use template for these scripts

$check_file = STS_TEMPLATE_DIR .$scriptbasename . ".html";

if (file_exists($check_file)) return $check_file;

 }

Replace with (you will remove the bracket):

 

 

if (strstr($scriptbasename, "popup") || strstr($scriptbasename, "info_shopping_cart"))
  return ''; // We don't use template for these scripts

$check_file = STS_TEMPLATE_DIR .$scriptbasename . ".html";

if (file_exists($check_file)) return $check_file;

If you leave the brackets "as is", then you will experience templates not being recognized by STS.


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
Here is your problem and solution:

 

When the pop-up image in your cart is coming up as a template page instead of the larger image ... you should turn off "Use Search-Engine Safe URLs (still in development)" which is configured in the MY STORE page of Configuring your catalog.

 

:thumbsup: Tip: DO NOT USE THAT FEATURE since it is very buggy. If you just have to have that function, try the other URL mods that are available.

 

thanks loads! this did the trick, everything is working fine again. My hero :lol:

Share this post


Link to post
Share on other sites
Tracy, that should not be the case. You have something incorrect in your installation then...most likely the code that you entered in your index.php file. Be sure that you are inserting that code into your "catalog/index.php" file and not the other index.php files in the store.

 

hmm... Bill have you tried doing this yourself? Or has anyone else? And actually got the two parts working together with the category descriptions? I inserted the relevant code using Beyond Compare from a working copy of MS2 with HTC, so yes I know it's in the right place and yes I'm sure the rest of it is installed correctly, the metatags worked fine before I added the HTC category code snippets. Obviously page content is as big a thing for SEO, if not bigger, than metatags and I'm just trying to make it easy to edit the page content, for myself and any future clients I may have.

 

signed, baffled of Huddersfield :blink:

Share this post


Link to post
Share on other sites
hmm... Bill have you tried doing this yourself? Or has anyone else? And actually got the two parts working together with the category descriptions? I inserted the relevant code using Beyond Compare from a working copy of MS2 with HTC, so yes I know it's in the right place and yes I'm sure the rest of it is installed correctly, the metatags worked fine before I added the HTC category code snippets. Obviously page content is as big a thing for SEO, if not bigger, than metatags and I'm just trying to make it easy to edit the page content, for myself and any future clients I may have.

 

signed, baffled of Huddersfield :blink:

Absolutely! I try not to suggest anything that I have not got to work for myself. :thumbsup:

I created an osC shop last week just for the issue that you are describing. Actually, just to help you resolve your particular issue. I could not duplicate the problem that you are having.

 

Here is what I did:

  1. Created my stock osC store using the latest RC1 version (July 4th, 2007)
  2. Added STSv4.5.3
  3. Added HTCv2.6.3 by following my own advice here: http://forums.oscommerce.com/index.php?sho...p;#entry1086557
  4. Added the category description modifications listed in the HTC "Install_Catalog.txt" file.
    See this link: http://forums.oscommerce.com/index.php?s=&...t&p=1116611
  5. Added Category descriptions in the store's admin using the newly formed options created by the HTC contribution.

Tested and "All is well".

I really "feel" for you Tracy and I wish I could help you isolate your problem. I think you are going about it the right way and hopefully you will find "the cure". :thumbsup:

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

Share this post


Link to post
Share on other sites
Absolutely! I try not to suggest anything that I have not got to work for myself. :thumbsup:

I created an osC shop last week just for the issue that you are describing. Actually, just to help you resolve your particular issue. I could not duplicate the problem that you are having.

 

Thanks Bill, I went through it step by step and it's fine, typically, but having gone through the comparison I'm not sure why it didn't work before, lol. Unless it was something to do with the slightly older versions I was using, from the STS Megapowerpack or whatever it's called, lol. Oh well! Thanks so much for your help :)

Share this post


Link to post
Share on other sites
Upgrade to STSv4.5.2 and your error should go away. The actual problem lies with a bug that showed up since v4.4.

 

Bug fix 1 of 2 can be found at: http://forums.oscommerce.com/index.php?s=&...t&p=1023674

 

Bug fix 2 of 2 can be found at: http://forums.oscommerce.com/index.php?s=&...t&p=1037770

 

Templates are not being recognized by STS.

 

Open the includes/modules/sts/sts_default.php file.

Thanks for your quick response!

So, I upgraded to v4.5.2, along with making the changes to those two files (sts_default.php only had 1 bracket for me to remove, when there should be 2? :huh: ), and I get this error:

Fatal error: Cannot redeclare class messagestack in /home/coconuts/public_html/includes/classes/message_stack.php on line 88.

 

I have a clean osCommerce and haven't made any changes to the template, so I just copied over all the files in the upgrade.

Share this post


Link to post
Share on other sites
Thanks for your quick response!

So, I upgraded to v4.5.2, along with making the changes to those two files (sts_default.php only had 1 bracket for me to remove, when there should be 2? :huh: ), and I get this error:

Fatal error: Cannot redeclare class messagestack in /home/coconuts/public_html/includes/classes/message_stack.php on line 88.

 

I have a clean osCommerce and haven't made any changes to the template, so I just copied over all the files in the upgrade.

For some reason I couldn't edit my post. Anyway, I went back to sts_default.php, and saw that I hadn't deleted the bracket after the upgrade. Now function find_template ($scriptbasename) doesn't have an end bracket, and I get this error:

Parse error: parse error, unexpected ';', expecting T_FUNCTION in /home/coconuts/public_html/includes/modules/sts/sts_default.php on line 110

If I put the bracket back, I get the previous error.

Share this post


Link to post
Share on other sites
hmm... Bill have you tried doing this yourself? Or has anyone else? And actually got the two parts working together with the category descriptions? I inserted the relevant code using Beyond Compare from a working copy of MS2 with HTC, so yes I know it's in the right place and yes I'm sure the rest of it is installed correctly, the metatags worked fine before I added the HTC category code snippets. Obviously page content is as big a thing for SEO, if not bigger, than metatags and I'm just trying to make it easy to edit the page content, for myself and any future clients I may have.

 

signed, baffled of Huddersfield :blink:

 

I have done this myself thinking I wanted this not fully HTC at the time but after installing the changes realize I did not need or want this. I had no problems with the code Bill provided.

 

May I suggest you download the actual HTC contrib and follow the instructions in th.at


Powered By osC 2.2RC2a STS 4.5.8 - HTC 2.6.3 - FP 1.5.9 - BCH 1.0.0

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

×