Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Yeah, got that figured out. So now, FF is being a pain and not centering the table. I've tried everything eg: table {margin: auto;} in the CSS, align="center", div tags. Nothing. Any suggestions?

Link to comment
Share on other sites

In stylesheet.css:

 

BODY {
 background: #f1e5f0;
 color: #000000;
 margin: 0px;
 width:320px;  [b][color="#FF0000"]<-- DELETE THIS LINE!![/color][/b]
}

Sometimes after changing the stylesheet you have to hold the <Ctrl> key down while doing a page refresh in the browser to force the browser to reload all contents from the server, including the newly changed stylesheet.

 

This works with IE and Firefox.

Edited by germ

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Hey Bill,

 

Took some time away from the OSC scene... Now im back and causing problems again

 

I am simply trying to modify the main page that displays the new products.. I am unable to get the formatting to work. My tags are not outputting anything.

 

If you have a look im sure you can quickly give me the slap i need

 

www.krownmodastore.com

 

Thanks in advance.

Link to comment
Share on other sites

Hi,

 

Does anyone know if you can have multiple banner ads with sts? I have a $banner_only in my right column which displays a banner, but i'd also like a different one in the left column .. is this possible? perhaps a $banner_only2 or something...

 

I have searched for this in the forum and google but found nothing ..

 

It would be great if it were possible ..

 

many thanks

 

steve

Link to comment
Share on other sites

Hey Bill,

 

Took some time away from the OSC scene... Now im back and causing problems again

 

I am simply trying to modify the main page that displays the new products.. I am unable to get the formatting to work. My tags are not outputting anything.

 

If you have a look im sure you can quickly give me the slap i need

 

www.krownmodastore.com

 

Thanks in advance.

Dave,

 

You have a couple different problems going on here.

 

  1. You can't use the product info STS tags on pages other than the product_info content templates. It is possible but it would require some re-coding on your part. I have done this and even posted in this thread about it but I strongly suggest that you do not go down this route until at least you get problem #2 below worked out. Here is the post #4440 in any case:
    http://www.oscommerce.com/forums/index.php?sho...p;#entry1325353
  2. You are using an osCommerce template that needs to be converted to an STS template. See my step by step on how to do this properly:
    Post # 2587
    http://www.oscommerce.com/forums/index.php?sho...p;#entry1131089

Look into the above and see if that helps.

 

By the way, the only STS tags that can be used in your infobox templates are $content, $headertext and $right_arrow.

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

Hi,

 

Does anyone know if you can have multiple banner ads with sts? I have a $banner_only in my right column which displays a banner, but i'd also like a different one in the left column .. is this possible? perhaps a $banner_only2 or something...

 

I have searched for this in the forum and google but found nothing ..

 

It would be great if it were possible ..

 

many thanks

 

steve

 

Steve,

 

osCommerce does not do this by default and would require some custom code on your part or by installing a contribution that does what you want.

 

Here are a few to look at:

http://www.oscommerce.com/community/contributions,254/page,4

 

http://www.oscommerce.com/community/contri.../search,new+box

 

http://www.oscommerce.com/community/contri...l/search,banner

 

http://www.oscommerce.com/community/contri...l/search,banner

 

Note: After creating your new banner infobox, then you simply need to create a new STS tag for it such as $bannerbox.

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

Link to comment
Share on other sites

Note: After creating your new banner infobox, then you simply need to create a new STS tag for it such as $bannerbox.

 

Thanks for the reply,

 

is there a tutorial somewhere on how to create sts tags?

 

thanks again

Link to comment
Share on other sites

Thanks for the reply,

 

is there a tutorial somewhere on how to create sts tags?

 

thanks again

http://www.oscommerce.com/forums/index.php?sho...p;#entry1353096

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

I don't know if i'm going blind here ... but i can't see anything about creating sts tags on that page or any of the others ive serached in this thread ... :blink:

 

 

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

 

Post#4667

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

I just installed a module called Default Specials, which puts a module on the index page of specials. I have it displaying fine, but if I don't have any specials, I get the header text, with no products. I am using templates for infoboxes, and this is my template for that box:

<h1 class="infoboxHeading">Specials & Promotions</h1>
<div class="tableBorder">$content</div>

Here is the code in /includes/modules/default_specials.php

<?php
/*
 $Id: default_specials.php,v 2.0 2003/06/13

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- default_specials //-->
<?php
$info_box_contents = array();
 $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
 new infoBoxHeading($info_box_contents, true, false, tep_href_link(FILENAME_SPECIALS));

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
 $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIALS_PRODUCTS_MODULE);
  } else {
 $new = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price, s.specials_new_products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and s.status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_SPECIALS_PRODUCTS_MODULE);
  }


$info_box_contents = array();
 $row = 0;
 $col = 0;
 while ($default_specials = tep_db_fetch_array($new)) {
$default_specials['products_name'] = tep_get_products_name($default_specials['products_id']);
$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>');
$col ++;
if ($col > 2) {
  $col = 0;
  $row ++;
}
 }
 new contentBox($info_box_contents);
?>

<!-- default_specials_eof //-->

How can I NOT display the header of this infobox if there are no items with a special price?

 

Thanks!!

Link to comment
Share on other sites

I just installed a module called Default Specials, which puts a module on the index page of specials. I have it displaying fine, but if I don't have any specials, I get the header text, with no products. I am using templates for infoboxes, and this is my template for that box:

<h1 class="infoboxHeading">Specials & Promotions</h1>
<div class="tableBorder">$content</div>

Here is the code in /includes/modules/default_specials.php

<?php
/*
 $Id: default_specials.php,v 2.0 2003/06/13

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- default_specials //-->
<?php
$info_box_contents = array();
 $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
 new infoBoxHeading($info_box_contents, true, false, tep_href_link(FILENAME_SPECIALS));

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
 $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIALS_PRODUCTS_MODULE);
  } else {
 $new = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price, s.specials_new_products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and s.status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_SPECIALS_PRODUCTS_MODULE);
  }


$info_box_contents = array();
 $row = 0;
 $col = 0;
 while ($default_specials = tep_db_fetch_array($new)) {
$default_specials['products_name'] = tep_get_products_name($default_specials['products_id']);
$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>');
$col ++;
if ($col > 2) {
  $col = 0;
  $row ++;
}
 }
 new contentBox($info_box_contents);
?>

<!-- default_specials_eof //-->

How can I NOT display the header of this infobox if there are no items with a special price?

 

Thanks!!

 

First, you needed to create a custom STS tag for your custom infobox default_specials.php. Then, you would add the tag to your template. If your code is correct in the default_specials.php script, then the infobox will not show in your page if there are no specials.

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

First, you needed to create a custom STS tag for your custom infobox default_specials.php. Then, you would add the tag to your template. If your code is correct in the default_specials.php script, then the infobox will not show in your page if there are no specials.

Can you give me some sort of example of doing this? I opened the user manual, and section 3.2.1 says:

 

3.2.1 Add new variables in sts_user_code.php

If you want to add any new boxes or template variables, add them in the

includes/modules/sts_inc/sts_user_code.php file. An example of syntax is provided.

• See chapter 5.7 for another way to create new variables.

 

But there is no section 5.7???

Link to comment
Share on other sites

I got this working, and did not have to create an STS tag for this. This is part of the index.php page content. I got it working by modifying default_specials.php to do only draw the contentBox if there was anything in the $info_box_contents array:

if (!empty($info_box_contents)) {
	new contentBox($info_box_contents);
}

If I don't have any specials, then the box is not being drawn.

 

Thanks

Link to comment
Share on other sites

I got this working, and did not have to create an STS tag for this. This is part of the index.php page content. I got it working by modifying default_specials.php to do only draw the contentBox if there was anything in the $info_box_contents array:

if (!empty($info_box_contents)) {
	new contentBox($info_box_contents);
}

If I don't have any specials, then the box is not being drawn.

 

Thanks

 

You said this was an infobox. It it truly was and it was created in the same manner in which osCommerce creates infoboxes, then yes, you would have had to create a new STS tag for it.

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

I'm trying to change the text for the tag $myaccountlogoff

 

I'd rather it say Login when the person is not yet logged in. Where do I change this?

 

By the way....thank you so much for this. I'm working on setting up my store on here and have went from Joomla to zencart and finally to here thanks to this module. It's great!

Link to comment
Share on other sites

HI All,

 

 

I just installed a fresh version of oscommerce-2.2rc1-FR-w3c-3. Everything was ok before to install STS,

STSv458_1_2 then Modern Template RC2a for STSv458_1_2.

 

After that the email function of oscommerce doesn't work anymore, when i create account, or when i need

to get back forgotten password, nothing work, i didn't receive any emails. any idea?

 

It's very annoying :(

 

Thx.

Link to comment
Share on other sites

HI All,

 

 

I just installed a fresh version of oscommerce-2.2rc1-FR-w3c-3. Everything was ok before to install STS,

STSv458_1_2 then Modern Template RC2a for STSv458_1_2.

 

After that the email function of oscommerce doesn't work anymore, when i create account, or when i need

to get back forgotten password, nothing work, i didn't receive any emails. any idea?

 

It's very annoying :(

 

Thx.

This would only take place if you misplaced some of the STS code during a manual installation. To quickly find your mistake, use a file comparison tool such as WinMerge or Beyond Compare to compare your files with the files that came 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

I am confused as to the directory structure and exactly what files I am copying/replacing

 

From the "STS" folder, copy the new files to your store:

 

catalog\includes\classes\sts.php

 

catalog\includes\functions\sts.php

 

folder catalog\includes\languages\english\modules\sts (plus all other languages you may have in your setup)

 

folder catalog\includes\modules\sts

 

folder catalog\includes\modules\sts_inc

 

folder catalog\includes\sts_templates

 

what is the difference between 'catalog\includes' and 'folder catalog\includes' ??

 

 

THEN it says If you have a fresh install of osCommerce Online Merchant 2.2RC2, you can take the files from the "Files for RC2" folder and copy them over your installation

 

wont that copy over the files i just added from the STS folder??

Link to comment
Share on other sites

ok, i got STS working finally..... now i am having trouble using the osCommerce templates that i have downloaded. Where do the template files need to go exactly? I have tried putting the osc template folder in sts_templates folder and selecting it from admin console but its a no go. any help would be great.

 

is development with OSC dying? is there something better that I should know about?

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