Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] STS v4


Guest

Recommended Posts

I couldn't use the recommended software because I am a OSX user, but I did manage to have some progress. Everything looks okey except, should the http://localhost/includes/sts_templates/te...s_template.html after I enable "Defulte" and "Index" STS modules look like a normal store with all the components? Or will it still look like:

 

"

$breadcrumbs $myaccountlogoff | $cartcontents | $checkout

$catmenu

$categorybox

$manufacturerbox

$whatsnewbox

$specialbox

$searchbox

$informationbox

"

 

Dan,

It should look and feel like a normal osCommerce store. If I remember correctly, osx is using the older non-supported BTS contribution. STS can not co-exist with BTS. You might want to try to un-install the BTS contribution and that should get you going in the right direction.

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 Great contribution. Just trying to create a custom template now.

 

Just a few quickies if anyone can help. I am using the simple 'test' template. Which file do you modify to change the way stuff is displayed in the content window? I'm wanting to reduce the size of the category layout so that it will fit in my new template.

 

Cheers!

 

Rich

Adjust the middle table/cell to meet your needs.

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, Thanks for that.

 

Just another quicky ;) , is there a way to reduce the border size between each image of subcategory?

 

I'm integrating another html template which has its own stylesheet so i am trying to figure out how to alter the infoboxes and content etc. I havent much experience in coding etc so i'm working a bit byt trial and error. I'll let you know how i get on

 

Cheers

Link to comment
Share on other sites

I am using latest version of STS with HTC on oscommercev2.2rca

 

I am only selling 12 products so I have not set up any category/manufaturer besteseller or all that jazz. All that I currently have is the $whatsnewbox.

 

What I would like is simply to display 3 or 4 random selections of my products in that box. When I use the $whatsnewbox I only get one product. I was looking for a template placeholder which will display a Specific product or a random product. Any ideas on how to do this?

Link to comment
Share on other sites

I am using latest version of STS with HTC on oscommercev2.2rca

 

I am only selling 12 products so I have not set up any category/manufaturer besteseller or all that jazz. All that I currently have is the $whatsnewbox.

 

What I would like is simply to display 3 or 4 random selections of my products in that box. When I use the $whatsnewbox I only get one product. I was looking for a template placeholder which will display a Specific product or a random product. Any ideas on how to do this?

 

Jared,

 

You would need to install the "Random Product" contribution. This is a very simple contribution to install. Basically it involves three steps:

  1. Copy the show_random.php file to your includes/boxes folder. Here is the file that I used for a client recently (you can copy this code and save it in a text file named show_random.php and then upload it to your includes/boxes folder):
     
    <?php
    /*
     show_random.php: entirely based on
     $Id: whats_new.php,v 1.30 2002/06/05 20:59:08 dgw_ Exp $
    
     osCommerce, Open Source E-Commerce Solutions
     [url="http://www.oscommerce.com/"]http://www.oscommerce.com[/url]
    
     Copyright (c) 2002 osCommerce
    
     Released under the GNU General Public License
    */
    ?>
    <!-- show_random //-->
    	  <tr>
    		<td>
    <?php
    
    //check the end of the if-line to find the don't-show-products-w/o-image argument
    
     if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status='1' and products_image IS NOT NULL ")) {
    $random_product['products_name'] = tep_get_products_name($random_product['products_id']);
    $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);
    
    
    
    if ($random_product['specials_new_products_price']) {
      $rprod_price =  '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
      $rprod_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
    } else {
      $rprod_price =  $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
    }
    
    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'center',
    							 'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id'], 'NONSSL') . '">' . $random_product['products_name'] . '</a><br>' . $rprod_price
    							);
    new infoBox($info_box_contents);
     }
    ?>
    		</td>
    	  </tr>
    <!-- show_random_eof //-->


  2. Manually add the define to each of your includes/languages/*your language folder*/*your language.php file. For example, for english, you would add the following in includes/languages/english/english.php:
    // show_random box text in includes/boxes/show_random.php
    define('BOX_HEADING_SHOW_RANDOM', 'Our Products');

    You could change the "Our Products" to anything you want.

  3. Create a new STS tag for this new box. Add the following in your includes/modules/sts_inc/sts_column_left.php file:
    	require(DIR_WS_BOXES . 'show_random.php');
     $sts->restart_capture ('randombox', 'box'); // Get Random box

    If you are unsure of where to place this code, simply drop it in just before the search box code in this file. This creates a $randombox tag that you can place anywhere in your template to display the new random box above.

That's it.

I went into detail on the above to help others see how easy it is to create a new box tag to be used in your template.

 

Hope this helped,

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 all,

 

Im working on an sts template but have a smal prolem,

 

The site is, www mobim8.com/index.php

 

The banner and search box are alligned in div's and sit fine in IE but when viewed in firefox they site out of place on the page.

 

Does anyone know why this happend or what I am missing to cure this problem?

 

Thanks in advance

Link to comment
Share on other sites

Hello, everyone,

 

just a small question: How could I know where the variables are? And where those files or codes corresponding locate?

 

ex: $right_arrow, I can't find out the file in which it is...

 

Thank you for all your helps.

Edited by hoken
Link to comment
Share on other sites

Hi Tracy,

 

Have you given any thought to the More Category Boxes contribution?

Bill:

 

Have looked at the 'More Category Boxes' contrib & think it would be ideal for one of my projects, but I'm using STSv4 & invoke the product menu using $categorybox. My question is how would I call the additional category boxes in my template? (index.php.html)

 

thanks,

 

Jerry

Link to comment
Share on other sites

Bill:

 

Have looked at the 'More Category Boxes' contrib & think it would be ideal for one of my projects, but I'm using STSv4 & invoke the product menu using $categorybox. My question is how would I call the additional category boxes in my template? (index.php.html)

 

thanks,

 

Jerry

 

Jerry,

You would need to create a new STS tag in the includes/modules/sts_inc/sts_column_left.php file, under the current categorybox tag. Something like the following should do the trick:

 

 

 $sts->restart_capture(); // Clear buffer but do not save it nowhere, no interesting information in buffer.
// Get categories box from db or cache  
 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }  
 $sts->restart_capture ('categorybox', 'box');  

// More Category Boxes contrib
$default_category_box_enabled_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_CATEGORY_BOX_ENABLED' ");
$default_category_box_enabled = tep_db_fetch_array($default_category_box_enabled_query);

if ($default_category_box_enabled['configuration_value'] == 'true') {

 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }
}

 include(DIR_WS_BOXES . 'more_categories.php');
$sts->restart_capture ('morecategorybox', 'box');
// More Category Boxes contrib

The above would create a new STS tag named $morecategorybox to call the more_categories.php file.

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

Hello, everyone,

 

just a small question: How could I know where the variables are? And where those files or codes corresponding locate?

 

ex: $right_arrow, I can't find out the file in which it is...

 

Thank you for all your helps.

The STS tags for the template pages are created in the includes/modules/sts_inc/ files. The STS tags for the infobox templates are located in includes/classes/boxes.php file.

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 all,

 

Im working on an sts template but have a smal prolem,

 

The site is, www mobim8.com/index.php

 

The banner and search box are alligned in div's and sit fine in IE but when viewed in firefox they site out of place on the page.

 

Does anyone know why this happend or what I am missing to cure this problem?

 

Thanks in advance

IE and FireFox look at code in different ways. One thing to look at is to remove all hard coded styles and add this in your stylesheet instead (FireFox has issues with styles hard coded to tables, cells, etc.).

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

Thank you, Sir..I suspected as much, but didn't have a clue how to go about doing it.

Many thanks,

 

Jerry

 

 

Jerry,

You would need to create a new STS tag in the includes/modules/sts_inc/sts_column_left.php file, under the current categorybox tag. Something like the following should do the trick:

 

 

 $sts->restart_capture(); // Clear buffer but do not save it nowhere, no interesting information in buffer.
// Get categories box from db or cache  
 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }  
 $sts->restart_capture ('categorybox', 'box');  

// More Category Boxes contrib
$default_category_box_enabled_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_CATEGORY_BOX_ENABLED' ");
$default_category_box_enabled = tep_db_fetch_array($default_category_box_enabled_query);

if ($default_category_box_enabled['configuration_value'] == 'true') {

 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }
}

 include(DIR_WS_BOXES . 'more_categories.php');
$sts->restart_capture ('morecategorybox', 'box');
// More Category Boxes contrib

The above would create a new STS tag named $morecategorybox to call the more_categories.php file.

Link to comment
Share on other sites

Hi, I have a stupid question:

 

How could I use the funtion of the STS variables to my own design?

 

EX: I make a button "My account". I don't know how to make the link as the fonction of $myaccount in STS.

Link to comment
Share on other sites

Hi, I have a stupid question:

 

How could I use the funtion of the STS variables to my own design?

 

EX: I make a button "My account". I don't know how to make the link as the fonction of $myaccount in STS.

Two different ways, well actually three, but here are two of them (the other is simply copy the name of the my account button and place it in your template folder/images/english folder):

 

$urlmyaccount

URL of the My Account page. Use SSL if available.

Target page: FILENAME_ACCOUNT defined in catalog/includes/filenames.php .

Created in: includes/modules/sts_inc/general.php

Possible use: Place an icon on your template and use this placeholder as link target.

Example: http://www.yourdomain.com/catalog/account.php

 

$myaccountlogo

Image with link to the My Account page. Multilanguage. Use SSL if available.

Image is header_account.gif, located in [template folder]/images/

languages), linking to FILENAME_ACCOUNT (account.php, defined in includes/filenames.php).

Before STS v4.3: image was header_account.gif in catalog/images folder.

Created in: includes/modules/sts_inc/general.php

Possible use: button in header.

See also: $urlmyaccount if you don't need the multilanguage feature.

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

Jared,

 

You would need to install the "Random Product" contribution. This is a very simple contribution to install. Basically it involves three steps:

  1. Copy the show_random.php file to your includes/boxes folder. Here is the file that I used for a client recently (you can copy this code and save it in a text file named show_random.php and then upload it to your includes/boxes folder):
     
    <?php
    /*
     show_random.php: entirely based on
     $Id: whats_new.php,v 1.30 2002/06/05 20:59:08 dgw_ Exp $
    
     osCommerce, Open Source E-Commerce Solutions
     [url="http://www.oscommerce.com/"]http://www.oscommerce.com[/url]
    
     Copyright (c) 2002 osCommerce
    
     Released under the GNU General Public License
    */
    ?>
    <!-- show_random //-->
    	  <tr>
    		<td>
    <?php
    
    //check the end of the if-line to find the don't-show-products-w/o-image argument
    
     if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status='1' and products_image IS NOT NULL ")) {
    $random_product['products_name'] = tep_get_products_name($random_product['products_id']);
    $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);
    
    
    
    if ($random_product['specials_new_products_price']) {
      $rprod_price =  '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
      $rprod_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
    } else {
      $rprod_price =  $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
    }
    
    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'center',
    							 'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id'], 'NONSSL') . '">' . $random_product['products_name'] . '</a><br>' . $rprod_price
    							);
    new infoBox($info_box_contents);
     }
    ?>
    		</td>
    	  </tr>
    <!-- show_random_eof //-->


  2. Manually add the define to each of your includes/languages/*your language folder*/*your language.php file. For example, for english, you would add the following in includes/languages/english/english.php:
    // show_random box text in includes/boxes/show_random.php
    define('BOX_HEADING_SHOW_RANDOM', 'Our Products');

    You could change the "Our Products" to anything you want.

  3. Create a new STS tag for this new box. Add the following in your includes/modules/sts_inc/sts_column_left.php file:
    	require(DIR_WS_BOXES . 'show_random.php');
     $sts->restart_capture ('randombox', 'box'); // Get Random box

    If you are unsure of where to place this code, simply drop it in just before the search box code in this file. This creates a $randombox tag that you can place anywhere in your template to display the new random box above.

That's it.

I went into detail on the above to help others see how easy it is to create a new box tag to be used in your template.

 

Hope this helped,

 

 

Thanks! That was exactly what i was looking for. I am showing three products so i just put $randombox three times, I am sure you have a way to set the script to show x number but this worked for me.

Link to comment
Share on other sites

Hi!

 

Is flash ok?

 

I sort of did like this in the index.php.html

 

<div id="flash">

<object width="763" height="368">

<param name="movie" value="couleurful.com_flash.swf">

<embed src="couleurful.com_flash.swf" width="763" height="368">

</embed>

</div>

 

That dont work.. ;)

Do I put the flash in template/english/image or in the catalog/image or somewere else?

 

What code do I need?

 

Peace!

Link to comment
Share on other sites

I am sorry it this has been asked before, but I can't seem to find it:

 

I want to adjust the productlisting page when you click on a category. I have made a template and added the desired text in dutch above $content, but I have 2 languages...

 

Do I have to make another placeholder?

 

Thanks for any hints!

 

Gina

Link to comment
Share on other sites

Hi!

 

Is flash ok?

 

I sort of did like this in the index.php.html

 

<div id="flash">

<object width="763" height="368">

<param name="movie" value="couleurful.com_flash.swf">

<embed src="couleurful.com_flash.swf" width="763" height="368">

</embed>

</div>

 

That dont work.. ;)

Do I put the flash in template/english/image or in the catalog/image or somewere else?

 

What code do I need?

 

Peace!

Tim,

 

This thread is the right place to ask questions relating to STSv4 but you also posted in the older STS thread (STSv3 and older). I posted a detailed response in that thread.

 

Hope it 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

Link to comment
Share on other sites

I posted the below in the general section and did not geta response, I was wondering if there is a way to do the following with STS. I simply want to make the index.php page display exactly how the products_new.php page displays. Since I only have 12 products this would be ideal. I also have been trying for a few hours now to make it work and am lost... Thanks

 

Hello,

I am almost done with my template. All that I want now is to change how the index page displays products. as a mater of fact i want it to look exactly like the new products page. I am only going to have 12 products, with no categories so this look works for me.

 

I want www treatmentsolutionsnetwork.com/store

to look like

www treatmentsolutionsnetwork.com/store/products_new.php

 

Any ideas?

Edited by jrd1mra
Link to comment
Share on other sites

I did a clean install earlier today of OSC V2.2 RC2, installed STS V4.8.5 and all went well, which came as a surprise.

 

I then uploaded the Modern Template for RC2a, following the optional steps and set it as the default. Looks fine apart from the fact I get the variable $categorycssmenu displayed on the page instead of a populated category box. See HERE.

 

From the Install.txt file....

 

Notes regarding this STS template:

 

In order to display the custom categories CSS menu, a new STS tag ($category_cssmenu) was created in catalog/includes/modules/sts_inc/sts_column_left.php. This tag pulls in the new categories_cssmenu.php file included in this contribution. You still have the option of using the default category menu by simply removing the STS tag $category_cssmenu from your template page and then add in the STS tag $categorybox in its place.

 

I've had a look at the documentation, what appears to be the relevant code pages and so on, but I'm not getting it.

 

I'd like to have the custom categories CSS menu working - so anyone want a shot at pointing the idiot back at his village? :blush:

Link to comment
Share on other sites

I just started using osC yesterday, so excuse me if I'm a bit slow on things.

 

I went ahead and set up STS, and got everything working save for a few things.

 

My content box shows none of my design. I think maybe I'm editing the wrong file. Which one is it supposed to be? Or is it possible that it isn't pulling my CSS from my index?

 

The friends/specials box thing just isn't showing, at all. Any ideas?

 

Also $counter is just displaying $counter, not the actual counter.

 

Other than those things I don't see any problems.

Edited by fox0r
Link to comment
Share on other sites

I am sorry it this has been asked before, but I can't seem to find it:

 

I want to adjust the productlisting page when you click on a category. I have made a template and added the desired text in dutch above $content, but I have 2 languages...

 

Do I have to make another placeholder?

 

Thanks for any hints!

 

Gina

Gina, there is more than one way to accomplish this. By far, the best way would be to stay within the osCommerce standards and add your language specific text within the defines in the includes/languages/english.php or german.php (etc.) files. I know this maybe daunting for a newbie but it is really quite simple if you take the time to think it through.

 

For example: Say you had a line of text such as "You cart is empty" and you need this to be language specific. You would add a line in each of your *language*.php files.

 

In includes/languages/english.php you would add:

define('ENTRY_HCART_EMPTY', 'Your cart is empty');

In includes/languages/german.php you would add:

define('ENTRY_HCART_EMPTY', 'Ihr Warenkorb ist leer');

 

You would do the same for all of your other languages.

 

Then, in your template, you would add some PHP code where you want the language specific text to appear:

 

<?php echo ENTRY_HCART_EMPTY; ?>

 

The above is the most rock solid way of doing this.

 

Another approach would be to call a totally different template page depending upon the language. This works excellent if you are only using a single template for all of the pages in your shop.

 

Try this:

Simple Example for Language Specific Templates for STSv4.5.8:

  1. Create a home page template: index.php_0.html.
  2. Insert the following code just after the </head> section in your index.php_0.html:
    <?php
    Global $languages_id;
    include (STS_TEMPLATE_DIR.'sts_template_'.$languages_id.'.html');
    ?>


  3. Create your language templates as so (language ID may be different in your shop):

  • sts_template_1.html (1 is the language ID for english in my shop)
  • sts_template_2.html (2 is the language ID for Dutch in my shop)
  • sts_template_3.html (3 is the language ID for Spanish in my shop)

Now, depending upon which language the user selects in your shop they will be taken to the appropriate language specific template.

 

Another option is to add some PHP code that would echo some text depending upon the language.

 

Hope that didn't confuse you too much,

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

As regards my post above, I appear to have trashed my shop, trying to remove some of the default text. I'd renamed the original file before substituting my modified version, just to be on the safe side. Tried to delete my version and restore the name of the original, but that still gives an error.

 

Fatal error: Call to a member function add_current_page() on a non-object in ....../includes/application_top.php on line 312

 

Oddly, re-uploading the file from the install package didn't fix things either.

Link to comment
Share on other sites

I did a clean install earlier today of OSC V2.2 RC2, installed STS V4.8.5 and all went well, which came as a surprise.

 

I then uploaded the Modern Template for RC2a, following the optional steps and set it as the default. Looks fine apart from the fact I get the variable $categorycssmenu displayed on the page instead of a populated category box. See HERE.

 

From the Install.txt file....

 

 

 

I've had a look at the documentation, what appears to be the relevant code pages and so on, but I'm not getting it.

 

I'd like to have the custom categories CSS menu working - so anyone want a shot at pointing the idiot back at his village? :blush:

 

Hello Pat,

 

The correct tag would be $category_cssmenu.

Did you upload the optional additional categories_cssmenu.php file in includes/boxes/categories_cssmenu.php ?

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

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