Jump to content
rigadin2

[Contribution] STS v4

Recommended Posts

Bill, I had 2 questions earlier that I really could use a hand on.

 

1. Is there a way to modify the spacing between the links in the information infobox???? I am using a template for it but I don't think that matters. I tried looking through the PHP code but I am a rookie and couldn't figure it out.

 

2. I am trying to create a content template for one of the new pages I added with the "STS 4 Add New Page Files" contribution. Can someone explain how to do this in layman's terms. I looked through the STS manual and didn't really see anything that helped. The new page is safety.php.html in the "full folder" under sts_template, I tried just creating a file called safety.php.html and put it in the ...full/content/ folder but it still shows the default safety.php file.

 

 

Thanks for everything you do

Share this post


Link to post
Share on other sites

1. Spacing in the includes/boxes/information.php

 

Quick cheat is to add another <br>. Your initial code should look like this:

  $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
									 '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
									 '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
									 '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');

 

You can change it to:

  $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br><br>' .
									 '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br><br>' .
									 '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br><br>' .
									 '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');

 

You could also change it to be inside of <p> tags by doing this:

  $info_box_contents[] = array('text' => '<p><a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a></p>' .
									 '<p><a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a></p>' .
									 '<p><a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a></p>' .
									 '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');

 

 

2. template for added page:

I've never had to do this before so I'm not sure I would be the best person to advise you. My first thought is that the index.php.html template should govern the appearance of the new page, except for it's content. In order to govern the content you are going to need to add the variables into STS that you want to display (by variable I am meaning the things like $infobox $footer $specialbox etc.. that we use in a template) in order for a content template to work.

 

Hopefully someone else who has done this can explain it better than I :blush:

 

Bill, I had 2 questions earlier that I really could use a hand on.

 

1. Is there a way to modify the spacing between the links in the information infobox???? I am using a template for it but I don't think that matters. I tried looking through the PHP code but I am a rookie and couldn't figure it out.

 

2. I am trying to create a content template for one of the new pages I added with the "STS 4 Add New Page Files" contribution. Can someone explain how to do this in layman's terms. I looked through the STS manual and didn't really see anything that helped. The new page is safety.php.html in the "full folder" under sts_template, I tried just creating a file called safety.php.html and put it in the ...full/content/ folder but it still shows the default safety.php file.

 

 

Thanks for everything you do


~Tracy
 

Share this post


Link to post
Share on other sites
Joey,

You do not need to install an infobox template contribution into STSv4.5.8 since it ALREADY has an infobox template system ALREADY built in. All you have to do is enable it in the STS Default module in the admin. If you tried to install the older infobox template addon into v4.5.8, then there is not telling what kind of errors you are going to get.

 

I strongly suggest that you either uninstall the infobox addon or reinstall STSv4.5.8 completely.

 

 

Can I make graphical border all away around the infobox with STSv4.5.8?

 

If so can I use the code in the infobox.html in the Infobox Template 4.2v contribution to do this?

 

Thanks

Joey


I have installed:

Oscommerce version 2.2rc2a, STS version 4.5.8, Header Tags SEO version 3.1.5, SEO Assistant version 2.1

 

Thanks

Joey

Share this post


Link to post
Share on other sites
Can I make graphical border all away around the infobox with STSv4.5.8?

 

If so can I use the code in the infobox.html in the Infobox Template 4.2v contribution to do this?

 

Thanks

Joey

Yes, you can. You can use any CSS or HTML to make the border. I'm not sure what you mean by the code from Infobox Template 4.2v.

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 I hope you are out there!!!

 

3rd question.... im such a php moron!!!

 

How do I get the "shopping cart in header" turned into a link? Here is the code

 

I tried several different things and just couldn't figure it out.

 

Brian, just to clarify...

 

This will create a new STS tag called $headcart that will allow you to place shopping cart details in your header (or anywehre else you want it).

 

Add the following in includes/modules/sts_inc/sts_user_code.php:

 

 

$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');

 

Now add the following in includes/languages/engish.php:

 

 

// STS Show Cart In Header
define('ENTRY_HCART_EMPTY', 'Your cart is empty');
define('ENTRY_HCART_CONTAINS', 'You have ');
define('ENTRY_HCART_ITEM', '<a href="shopping_cart.php" class="trailText">item in your cart</a>');
define('ENTRY_HCART_ITEMS', '<a href="shopping_cart.php" class="trailText">items in your cart</a>');
define('ENTRY_HCART_PRICE', '');


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, I had 2 questions earlier that I really could use a hand on.

 

1. Is there a way to modify the spacing between the links in the information infobox???? I am using a template for it but I don't think that matters. I tried looking through the PHP code but I am a rookie and couldn't figure it out.

 

2. I am trying to create a content template for one of the new pages I added with the "STS 4 Add New Page Files" contribution. Can someone explain how to do this in layman's terms. I looked through the STS manual and didn't really see anything that helped. The new page is safety.php.html in the "full folder" under sts_template, I tried just creating a file called safety.php.html and put it in the ...full/content/ folder but it still shows the default safety.php file.

 

 

Thanks for everything you do

Brian, Tracy is correct in the above answer regarding the link spacing.

Regarding the content template, I need to know more info...

 

Did you create the new pages correctly as advised in the Add New Pages using STS contribution? If so, you can easily create a template for your new page safety.php. The template will be called safety.php.html and should be placed in your template folder (yourdomain.com/includes/sts_templates/*your*template*folder/safety.php.html.

 

To make it easier for you, I would copy a template that works and name it safety.php.html. Then you can just modify that template to however you desire.

 

Keep in mind, whatever you have defined in the "text" portion of the new page will be displayed by the $content variable in your template. You could easily remove any text in that define statement in safety.php so that it will not show up in your template and then add what you want in the template itself. Another option is to create a content template for your safety.php file. This is more difficult but it can be done.


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

Do you know how to put this code into product_info.php.html so it works??

 

this code come from http://addons.oscommerce.com/info/968 ( Stock display (images / text ))

 

 

CODE

<?php

$prod_quantity = tep_get_products_stock($products_id);

switch ($prod_quantity) {

case 0:

print '<img src="images/stock_soldout.gif" border="0">';

break;

case 1:

print '<img src="images/stock_limitedstock.gif" border="0">';

break;

case 2:

print '<img src="images/stock_limitedstock.gif" border="0">';

break;

case 3:

print '<img src="images/stock_instock.gif" border="0">';

break;

case 4:

print '<img src="images/stock_instock.gif" border="0">';

break;

default:

print '<img src="images/stock_instock.gif" border="0">';

}

?>

 

 

I have tryed to implement the code into includes/modules/sts_inc/product_info.php

 

But i dont know how i should make the code

 

 

Need help

 

Regards Tony

Share this post


Link to post
Share on other sites

Hey guys got a quick quesiton

im running latest sts and osc

 

 

i was wondering if there was a way to put the tell a friend tag in the product template? it only shows up as $tellafriendbox and not as the actual box. Is there something missing from my code? or is there easier way to do this.

 

 

thanks

Share this post


Link to post
Share on other sites

I have this setup, First place I would check would be in your catalog/includes/modules/sts_inc/sts_column_left.php file

 

I have this bit of code in there:

  //if (isset($HTTP_GET_VARS['products_id']) && basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) {
include(DIR_WS_BOXES . 'tell_a_friend.php');
$sts->restart_capture ('tellafriendbox', 'box'); // Get tell a friend box
$sts->template['specialfriendbox']=$sts->template['tellafriendbox']; // Shows specials or tell a friend
// } else $sts->template['tellafriendbox']='';

 

Notice I customized it as I always wanted the tell a friend box to show on any page, so I commented out the first line and the last line.

 

Hope that helps, but if not let us know and I'll dig some more and see if I can find anything else that may be causing the problem ;)

 

Hey guys got a quick quesiton

im running latest sts and osc

 

 

i was wondering if there was a way to put the tell a friend tag in the product template? it only shows up as $tellafriendbox and not as the actual box. Is there something missing from my code? or is there easier way to do this.

 

 

thanks


~Tracy
 

Share this post


Link to post
Share on other sites
I have this setup, First place I would check would be in your catalog/includes/modules/sts_inc/sts_column_left.php file

 

I have this bit of code in there:

  //if (isset($HTTP_GET_VARS['products_id']) && basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) {
include(DIR_WS_BOXES . 'tell_a_friend.php');
$sts->restart_capture ('tellafriendbox', 'box'); // Get tell a friend box
$sts->template['specialfriendbox']=$sts->template['tellafriendbox']; // Shows specials or tell a friend
// } else $sts->template['tellafriendbox']='';

 

Notice I customized it as I always wanted the tell a friend box to show on any page, so I commented out the first line and the last line.

 

Hope that helps, but if not let us know and I'll dig some more and see if I can find anything else that may be causing the problem ;)

 

 

oh man this makes sense, let me give it a go. i think it will work

 

thanks so much!

Share this post


Link to post
Share on other sites
Hey guys got a quick quesiton

im running latest sts and osc

 

 

i was wondering if there was a way to put the tell a friend tag in the product template? it only shows up as $tellafriendbox and not as the actual box. Is there something missing from my code? or is there easier way to do this.

 

 

thanks

If all you are wanting is for the Tell a Friend box to display on all of your product pages, just simply create a product_info.php.html template in your template folder (not the content folder) and then add the $tellafriendbox tag. You may be interested in the $specialfriendbox instead as it will display the special box if there is not product ID in the URL. Do not use this placeholder together with $tellafriendbox or $specialbox, or you'll sometimes have the same infobox displayed twice!


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

If you are using the code I posted earlier, then the tag would be

 

$tellafriendbox

 

See if that works for you

 

false alarm still not working...

~Tracy
 

Share this post


Link to post
Share on other sites

Thanks Bill,

 

That reminded me why I have those bits commented out in my version - because I do have a $specialbox and a $tellafriendbox on all of my pages ;)

 

If all you are wanting is for the Tell a Friend box to display on all of your product pages, just simply create a product_info.php.html template in your template folder (not the content folder) and then add the $tellafriendbox tag. You may be interested in the $specialfriendbox instead as it will display the special box if there is not product ID in the URL. Do not use this placeholder together with $tellafriendbox or $specialbox, or you'll sometimes have the same infobox displayed twice!

~Tracy
 

Share this post


Link to post
Share on other sites
Yes, you can. You can use any CSS or HTML to make the border. I'm not sure what you mean by the code from Infobox Template 4.2v.

 

 

Bill here is the code for infobox.php.html

 

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td background="images/infobox/infobox_05.gif"> </td>

<td bgcolor="#DBF1FF">$content</td>

<td background="images/infobox/infobox_08.gif"> </td>

</tr>

<tr>

<td width="30">

<img src="images/infobox/infobox_09.gif" width="30" height="22"></td>

<td width="100%" background="images/infobox/infobox_11.gif"></td>

<td width="31">

<img src="images/infobox/infobox_12.gif" width="31" height="22"></td>

</tr>

</table>

 

Can I use this code from infobox templates v4.2 in the new sts4.5.8?

 

Thanks

Joey


I have installed:

Oscommerce version 2.2rc2a, STS version 4.5.8, Header Tags SEO version 3.1.5, SEO Assistant version 2.1

 

Thanks

Joey

Share this post


Link to post
Share on other sites
Bill here is the code for infobox.php.html

 

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td background="images/infobox/infobox_05.gif"> </td>

<td bgcolor="#DBF1FF">$content</td>

<td background="images/infobox/infobox_08.gif"> </td>

</tr>

<tr>

<td width="30">

<img src="images/infobox/infobox_09.gif" width="30" height="22"></td>

<td width="100%" background="images/infobox/infobox_11.gif"></td>

<td width="31">

<img src="images/infobox/infobox_12.gif" width="31" height="22"></td>

</tr>

</table>

 

Can I use this code from infobox templates v4.2 in the new sts4.5.8?

 

Thanks

Joey

Try it...I don't see any reason why it wouldn't work as long as you have those images uploaded to the linked directory.


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

Do you know how to put this code into product_info.php.html so it works??

 

this code come from http://addons.oscommerce.com/info/968 ( Stock display (images / text ))

 

 

CODE

<?php

$prod_quantity = tep_get_products_stock($products_id);

switch ($prod_quantity) {

case 0:

print '<img src="images/stock_soldout.gif" border="0">';

break;

case 1:

print '<img src="images/stock_limitedstock.gif" border="0">';

break;

case 2:

print '<img src="images/stock_limitedstock.gif" border="0">';

break;

case 3:

print '<img src="images/stock_instock.gif" border="0">';

break;

case 4:

print '<img src="images/stock_instock.gif" border="0">';

break;

default:

print '<img src="images/stock_instock.gif" border="0">';

}

?>

 

 

I have tryed to implement the code into includes/modules/sts_inc/product_info.php

 

But i dont know how i should make the code

 

 

Need help

 

Regards Tony

Tony,

 

Try something like this and then let me know if it worked for you:

 

Insert the following code into includes/modules/sts_inc/product_info.php just before the last ?>

 

 

$sts->start_capture();
$prod_quantity = tep_get_products_stock($products_id); 
switch ($prod_quantity) { 
case 0: 
print '<img src="images/stock_soldout.gif" border="0">'; 
break; 
case 1: 
print '<img src="images/stock_limitedstock.gif" border="0">'; 
break; 
case 2: 
print '<img src="images/stock_limitedstock.gif" border="0">'; 
break; 
case 3: 
print '<img src="images/stock_instock.gif" border="0">'; 
break; 
case 4: 
print '<img src="images/stock_instock.gif" border="0">'; 
break; 
default: 
print '<img src="images/stock_instock.gif" border="0">'; 
} 
$sts->stop_capture ('prod_quantity'); // Get the result to the main array

$template_pinfo['prod_quantity']= $sts->template['prod_quantity']; // Put it in the product info

 

The above would create a product_info content template tag named $prod_quantity that you could place in your product_info content template.

 

Hope this worked out for you,


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
If all you are wanting is for the Tell a Friend box to display on all of your product pages, just simply create a product_info.php.html template in your template folder (not the content folder) and then add the $tellafriendbox tag. You may be interested in the $specialfriendbox instead as it will display the special box if there is not product ID in the URL. Do not use this placeholder together with $tellafriendbox or $specialbox, or you'll sometimes have the same infobox displayed twice!

i have been working on this for a few hours,

 

when i take my product template out of the templates/content folder the tell a friend box will work but then the content makers wont work like $starform, $productdesc ect...

 

but when i move the file into the content of the template page the friend box will not work but all the content markers will.

 

trying to figure out what i have set wrong

Share this post


Link to post
Share on other sites
Tony,

 

Try something like this and then let me know if it worked for you:

 

Insert the following code into includes/modules/sts_inc/product_info.php just before the last ?>

 

 

$sts->start_capture();
$prod_quantity = tep_get_products_stock($products_id); 
switch ($prod_quantity) { 
case 0: 
print '<img src="images/stock_soldout.gif" border="0">'; 
break; 
case 1: 
print '<img src="images/stock_limitedstock.gif" border="0">'; 
break; 
case 2: 
print '<img src="images/stock_limitedstock.gif" border="0">'; 
break; 
case 3: 
print '<img src="images/stock_instock.gif" border="0">'; 
break; 
case 4: 
print '<img src="images/stock_instock.gif" border="0">'; 
break; 
default: 
print '<img src="images/stock_instock.gif" border="0">'; 
} 
$sts->stop_capture ('prod_quantity'); // Get the result to the main array

$template_pinfo['prod_quantity']= $sts->template['prod_quantity']; // Put it in the product info

 

The above would create a product_info content template tag named $prod_quantity that you could place in your product_info content template.

 

Hope this worked out for you,

Thanks Bill!!

It worked perfectly.

Share this post


Link to post
Share on other sites

I'm having a similar problem to what Josh has said above...

 

I'm trying to put the manufacturers box, $manufacturerbox, on my product info page. All I get is the text: $manufacturerbox and not the actual box.

 

I believe I have set up STS correctly... is there any way to accomplish this? If this has been covered somewhere before and I have missed it could someone point me in the right direction?

 

Thanks again.

Share this post


Link to post
Share on other sites
I'm having a similar problem to what Josh has said above...

 

I'm trying to put the manufacturers box, $manufacturerbox, on my product info page. All I get is the text: $manufacturerbox and not the actual box.

 

I believe I have set up STS correctly... is there any way to accomplish this? If this has been covered somewhere before and I have missed it could someone point me in the right direction?

 

Thanks again.

Mike and Josh....

 

Keep in mind that when using a content template, it is only for the "content" portion of the page, not for the header, right & left columns and footer. The main template will take care of those areas.

 

How it works, general template:

 

Main templates are templates containing the columns, header and footer. The center of the page only contains the $content placeholder.

With the Product Info Module, you have the possibility to define a separate "content template" that will replace the $content of the main template. Content templates must be located in the "content" folder inside the templates folder (includes/sts_templates/*your template folder*/content)

 

When the Product Info Module is enabled, it looks in the template folder to see what templates exist. It is possible to define templates based on the product ID or it's category ID. Templates must be located in the templates folder (includes/sts_templates/*your template folder*).

 

It works like this (first found first used):

 

1. Check for a main template based on the product ID, for example product with ID 4:

 

1.1 Use product_info.php_4.html if exists.

 

2. Check for category specific main template, based on the category ID where the product is located. (Example below with a product located in sub-category 22, located in category 11)

 

2.1 Use product_info.php_c11_22.html if exists.

 

2.2 Use product_info.php_c11.html if exists.

 

2.3 Use product_info.php.html if exists.

 

3. No specific template found, use default template as defined in the default module (by default it is sts_template.html)

 

 

 

Now that we have a main template, STS will look to see if there is a content template, based on product ID and the category where it belongs: example with product ID4 (STS looks in the 'content' folder):

 

1.1 Use product_info.php_4.html if exists.

 

2. Check for category specific content template, based on the category ID where the product is located. (Example below with a product located in sub-category 22, located in category 11)

 

2.1 Use product_info.php_c11_22.html if exists.

 

2.2 Use product_info.php_c11.html if exists.

 

2.3 Use product_info.php.html if exists.

 

If no content template is found then do not use any, $content will come from the original catalog/product_info.php .

 

So...your manufacturer box and Tell a Friend box would not be inserted into the 'content' template but should be inserted into your main template that holds the header, columns and footer portions of the page.


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, Sorry for my english.

 

Oscommerce version: MS2.2 RC2a

Sts version: STSv4.5.8

 

I Have a error in my pages:

 

 

Warning: include(includes/modules/sts_inc/create_account.php) [function.include]: failed to open stream: No such file or directory in pathmysite/public_html/includes/modules/sts_inc/sts_display_output.php on line 21

Warning: include() [function.include]: Failed opening 'includes/modules/sts_inc/create_account.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in pathmysite/public_html/includes/modules/sts_inc/sts_display_output.php on line 21

Warning: include(includes/modules/sts_inc/information.php) [function.include]: failed to open stream: No such file or directory in /pathmysite/public_html/includes/modules/sts_inc/sts_display_output.php on line 21

Warning: include() [function.include]: Failed opening 'includes/modules/sts_inc/information.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in pathmysite/public_html/includes/modules/sts_inc/sts_display_output.php on line 21

 

What is this error?

 

Please help me.

Edited by m4tt86

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

×