Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

I tried to edit my previous post, but since i couldn't, here's my configure.php:

 

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
 define('HTTP_SERVER', 'http://localhost'); // eg, http://localhost - should not be empty for productive servers
 define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers
 define('ENABLE_SSL', false); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', 'localhost');
 define('HTTPS_COOKIE_DOMAIN', '');
 define('HTTP_COOKIE_PATH', '/shop/');
 define('HTTPS_COOKIE_PATH', '');
 define('DIR_WS_HTTP_CATALOG', '/shop/');
 define('DIR_WS_HTTPS_CATALOG', '');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 

Hope this helps :)

Edited by stardust

Share this post


Link to post
Share on other sites

Hey, I installed an OScommerce with any problem and I made my own STS template.

 

The problem arrived whn I tried to simulate an order. At the payment step, no payment forms were available. I don't know if I was doing something wrong either with the software or the template.

 

Is there any reported problem with that?

Does anybody know any solution?

 

Thanks

 

PS: sorry for the mistakes above, but I'm still an Englsih student from Spain.

Share this post


Link to post
Share on other sites

Hi everyone,

 

The website i'm building is made up of top level categories then subcategories containing the products.

At the moment, the catalog listing on the left lists ALL top level categories along with ALL the subcategories under each category.

 

My question is; Is there a way to display only the subcategories once you are inside a top level category?

 

For example, my top level categories are: Chairs, Tables, Accessories.

and under Chairs I have the subcategories of: Client Chairs, Typist Chairs and Executive Chairs.

 

If I go to Chairs, I only want to display Client Chairs, Typist Chairs and Executive Chairs on the catalog list on the left.

 

Appreciate anyones help.

Cheers.

Share this post


Link to post
Share on other sites

Do you mean that you want a category box that does not display the top level categories? That needs a hack of the categories.php box and has nothing to do with STS. Probably someone has done it already, search the forum.

 

If you want that the only expanded category is the selected one, well, this is the stock osC behavior. by default the categories not selected are collapsed. Try the original categories.php box if it fits your needs, but once again, content of boxes is not modified by STS.

 

- Rigadin


STS PLUS, a variation of STS, is now available.

ACA 2.0 is also out!

Share this post


Link to post
Share on other sites

I just installed the sts 2.01 and sts output 1, my question is what exactly do you modify in the sts_template.html file. I unserstand that you take out move around where you want it but how does that really change the look of the index.php page. I also would like to know how to put 6 products on one page at a time with the actual picture and discription when viewing the catagory list of products instead of the whole list of products in the whole catagory.

 

Thanks for the help in advance

 

Eric


Eric

 

Keep up on osCommerce changes and updates at

Github | Understand osCommerce a little further at OsCommerce Documentation | Copy and paste your error message in Google add "in osCommerce" at the end to get relevant answers to most issues.

Share this post


Link to post
Share on other sites
I just installed the sts 2.01 and sts output 1, my question is what exactly do you modify in the sts_template.html file. I unserstand that you take out move around where you want it but how does that really change the look of the index.php page. I also would like to know how to put 6 products on one page at a time with the actual picture and discription when viewing the catagory list of products instead of the whole list of products in the whole catagory.

 

Thanks for the help in advance

 

Eric

matrix2223,

take a close look at readme.txt that came with the STS contribution, it describes how you can:

 

on page 5, add separate category pages by adding /catalog/includes/sts_templates/index.php_XX-YY.html where XX-YY value is the cPath you see in the catogries URL

 

I do not believe that STS alone allows you to alter the category page to show exactly 6 products with description. STS does have the ability to show all products in the category with the controls provided in admin > configuration > product listing shown below. These settings will affect other store pages. If you still wanted to show 6 items with description, you will have to alter the relevant php files.

 

Display Product Image

Display Product Manufaturer Name

Display Product Model

Display Product Name

Display Product Price

Display Product Quantity

Display Product Weight

Share this post


Link to post
Share on other sites

Hi i currently have STS version 1.2 installed however i'm a little bit confused about how exsactly i upgrade to 1.3 or 1.4. You seem to just say overwrite files however i've already changed from my original fresh install of OSc 2.2 MS2. Therefore i'm unable to just overwrite my files, also how do i ensure that when i put files like sts_template.html instead of template.html that the new upgrade will recognise this?

 

All in all i guess i'm looking for someone to explain what the major changes are to STS through the versions or is it not possible to upgrade. If so i might have to install a completely fresh version of OSc2.2 MS2 and install it from there however that would take WEEKS.

 

Anyone got any ideas the site is here if anyone wants to take a look www.onlyfantasy.com (adult!)

 

Thanks

Regards

Tom Lowes

Share this post


Link to post
Share on other sites

I don't know if it will help some people...but here I am. I had problem opening the Big picture popup. Although the popup was triggered the result was a part of the homepage and not the Big picture...

 

so I solved this But I am not sure if it is the absolute sollution for this problem.

 

I opened the popup_image.php. and I changed the last line

 

<?php require('includes/application_bottom.php'); ?>

 

with this one...

 

// close session (store variables)
 tep_session_close();

 if (STORE_PAGE_PARSE_TIME == 'true') {
$time_start = explode(' ', PAGE_PARSE_START_TIME);
$time_end = explode(' ', microtime());
$parse_time = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);
error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' - ' . getenv('REQUEST_URI') . ' (' . $parse_time . 's)' . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);

if (DISPLAY_PAGE_PARSE_TIME == 'true') {
  echo '<span class="smallText">Parse Time: ' . $parse_time . 's</span>';
}
 }

 if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded == true) && ($ini_zlib_output_compression < 1) ) {
if ( (PHP_VERSION < '4.0.4') && (PHP_VERSION >= '4') ) {
  tep_gzip_output(GZIP_LEVEL);
}
 }

 

Basically its the application_bottom.php file without the sts part...

 

Hope that helps. I f I find any problems I'll report it. Have a nice day from Greece!

Share this post


Link to post
Share on other sites

Been using this for over a year with no problems...so that is a good testimony as to how good a job you have done with it. I only get into trouble when I get creative with your code, and up until now I managed to figure it out myself. With this issue I figured you could answer this in much less time than I can continue to experiment.

 

I have so many products on a site that we had to take off the $catmenu and $manufacturerbox from the sts_template.html page because our payment modules were timing out during the transactions. Once removed it works great. This in itself is no big deal but I would like to put each of these two boxes and their functionality on their own page, so customers can still search. I created two new pages and on one I added the $catmenu variable and on the other the $manufacturerbox in a central location on the page.

 

I was surprised to find that the categories box works just fine as is with no changes. You can see what I mean at http://www.trucksandmoore.com/osCommerce/c...by_category.php.

 

However, the manufacturer version which is only different in the use of $manufacturerbox instead of $catmenu just shows the text $manufacturerbox on the page at http://www.trucksandmoore.com/osCommerce/c...anufacturer.php.

 

I guess I'm hoping that there is something simple I could do to make the manufacturerbox work as well. I'm really trying to not have to write something custom if I can avoid it. Any ideas?

 

Thanks for your hard work on this- I have saved hundreds of hours on our sites thanks to this contibution!

Share this post


Link to post
Share on other sites

Hope someone can give me some advice it may be something simple but I dont seem to be having any joy.

 

Anyway I have all my SSL setup fine and I can seem to getting working fine on my normal shop but not on my new one I am doing with STS. Basically I have notice that on the standard shop when you click on a page that requires the SSL certificate it changes the URL of all your images to the secure site (https) so that the padlock will load and people can view the certificate but on the the STS site all the image URL's just stay on the standard HTTP so no padlock loads so the cetificate cant be viewed.

 

Do I just need to have a different template for all the pages that need to loaded securely or is there some other simple little thing that I am missing.

Share this post


Link to post
Share on other sites

I am having a problem. I installed STS on a current site and for some reason, the $content is not showing. Totally blank.

Share this post


Link to post
Share on other sites

hello forum,

 

I am a newbie so please bare with me while I try to explain what I would like to accomplish

with this great contribute please as well as I am asking for some simple guideance to begin

with this if I may.

 

I have installed the OSC on my main domain name so therefore will it matter that my OSC is

in my main root when I then go to install the STS version? I ask this becuase the steps keep saying

"in the catolog files" and I dont seem to have a catolog file and I read somewhere in this forum that if you

have installed the OSC in your main root then you dont have a catolog file?

 

and if what I said above is so then how should I install it so that when visitors come to my

main site and pull up my domain name then my html pages for the store as well as the store itself will

show please if this is possiable to do even at all again not sure which is why I ask this sorry if it sounds dumb to some but I feel better safe then sorry?

 

I also wanted to mention that I installed the OSC thru my hosting cpanel thru the Fantasico version will this

make a difference or no?

 

Next question:

 

I have installed or should say I edited out my OSC on these following files:

privacy policy

conditions

 

I also did all this below to the OSC that is installed on my site at the moment:

 

I edited out the main page where the text showes up at first when you install the OSC

I also changed my LOGO heading as well as the background colors and the footer colors and the

header colors thru the css page.

I also added a new box thru the contributes here to add my adsense banner on the right and left

columes and I added the steps to show that box as well in the 2 columes pages as well as where it said

to add a new box to make that adsense box show.

 

SO what I need to know now please before I go for installing the STS contibute or the other one even is will any of the above work that I have done so far get altered out or messed up with this new install and if so how can I avoid it before it happens please?

 

I really would like to use this contribute to alter the boxes ( mean to move them around a bit) and to be then able to add my HTML coding as I belong to alot of affiliate programs and see this

contribute as I am understanding it to work to be able to allow me to add those extra codings as they are

mainly with HTML as there listings etc,

 

please if any of this is not going to work for what and how I wanted

to set up my store can anyone here be so kind as to point me in the right path before I take the wrong

path so to speak,

 

I still am not sure as to if this version of STS's latest version or if STSPlus version would be right to install

but after reading both threads thought I needed to ask which version here out of the 2 would work easyer for the newbie such as myself to get it to work.

Thanks to everyone who can offer me the advice and guidance I need to move forward with this project

I really appreciate the help and so loog forward to someone who I am sure has a bit more knowledge then me with this contribute will please take the time to further assist me with the questions here on this contribute.

 

starz

Share this post


Link to post
Share on other sites
I am having a problem. I installed STS on a current site and for some reason, the $content is not showing. Totally blank.

 

Anyone have any clue why it is doing this??

Share this post


Link to post
Share on other sites

im using sts v2 and have used $search_categories, the categories appear ok, but instead of the "All Categories" option i get the TEXT_ALL_CATEGORIES text?


Hey its free!

Share this post


Link to post
Share on other sites

I already have a running shop using osC, but I am playing around with a clean install right now. My existing shop has some messy code now from previous contribs that were installed, removed, etc. So now, I am working with a fresh install, and some different contribs that I would like to have, but either could not get working in the past, or have not yet tried.

 

I am running into a big problem though. Almost none of my installed contribs are showing up. I can only think this is due to STS (first contrib I installed on the fresh install).

 

 

osC MS2.2

STS 3.00 Beta (Works)

 

 

Not showing/working:

 

Ask a Question (Ask a Product Question)

 

Wishlist 3.5d - No wishlist option is show

Share this post


Link to post
Share on other sites

howdy ..

 

have tried to do a search but can't seem to find anything .. but i'm having a problem where $regularprice and $specialprice are coming up blank.

 

This is the code for pricing from the includes/sts_product_info.php file.

 

$template['regularprice'] = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
 $template['specialprice'] = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']));
} else {
 $template['specialprice'] = '';
}

 

any help? pleeeeeeeeeeeeeeease :) o:)

Share this post


Link to post
Share on other sites

Does anyone know of any contributions below, or similar, will work with the latest version of STS (with product_info.php.html)?

 

- CoolMenu

- Extra Images (or any multiple image contrib)

- Attribute Option Type Feature (this probably isn't the actual name, but it allows for radio buttons for attributes)

Share this post


Link to post
Share on other sites
howdy ..

 

have tried to do a search but can't seem to find anything .. but i'm having a problem where $regularprice and $specialprice are coming up blank.

 

This is the code for pricing from the includes/sts_product_info.php file.

 

any help? pleeeeeeeeeeeeeeease :) o:)

 

how odd.

 

it appears to be working again *rub chin* nervous breakdown incoming! :'(

Share this post


Link to post
Share on other sites

I have added the STS V 2_01 and am still seeing the standard oscommerce layout when viewing my store. I have modified the sts_template.html file, which is in my includes folder, but I am not seeing any changes to the store. I am very new to installing contributions and editing anything in php, was there something that I missed changing to make the new template to show?

Share this post


Link to post
Share on other sites
I have added the STS V 2_01 and am still seeing the standard oscommerce layout when viewing my store. I have modified the sts_template.html file, which is in my includes folder, but I am not seeing any changes to the store. I am very new to installing contributions and editing anything in php, was there something that I missed changing to make the new template to show?

 

 

Disregard, I didnt have all the files uploaded. I think it is working now.

Share this post


Link to post
Share on other sites

I wonder if anyone else has experienced this problem, STS works like a dream on our website, however a few customers ring their orders in and tell us that they cannot find a checkout button or link on the website to proceed onto the secure server. You can take a look here www.afterdark-sensations.co.uk it sells sexy items of lingerie etc so please dont look if you are easily offended. Is there a fix or is it customers firewalls/browsers causing the problem. Hope someone can help?

Share this post


Link to post
Share on other sites

Ok I've been trying to figure this out but it just doesn't seem to want to work!! sts runs great but how do I specify a template for a single page that has only one value in the cPath.

 

For instance if my URL is - index.php?cPath=48 my template would be index.php_48.html which does work for that category BUT it also applies that specific template to ANY of the other pages that are within that category. In other words index.php?cPath=48_50 uses the template that should ony be specified for cPath=48 ONLY.

 

I've placed an index.php.html within the sts templates dir but that doesn't work. Anybody out there have a solution for this?

 

Thanks in advance.

Share this post


Link to post
Share on other sites
Ok I've been trying to figure this out but it just doesn't seem to want to work!! sts runs great but how do I specify a template for a single page that has only one value in the cPath.

 

For instance if my URL is - index.php?cPath=48 my template would be index.php_48.html which does work for that category BUT it also applies that specific template to ANY of the other pages that are within that category. In other words index.php?cPath=48_50 uses the template that should ony be specified for cPath=48 ONLY.

 

I've placed an index.php.html within the sts templates dir but that doesn't work. Anybody out there have a solution for this?

 

Thanks in advance.

 

I haven't worked with this, but maybe try index.php_48_0.html ? It seems like it would work, but again, I haven't worked with different templates for individual pages.

Share this post


Link to post
Share on other sites

Using v3.00 Beta 2 from Jul 31 2005 by DiamonSea

 

I had a problem similar to others with popup_image.php. In product_info.php.html I replaced this line (approx line 60):

 

<td class="smallText" align="center"><a href="javascript:popupWindow('http://sts.diamondsea.com/sts3/popup_image.php?pID=$productsid')">$imagesmall<br>-->

 

with this one I modeled on a similar link from admin/bannder_manager.php

 

<td class="smallText" align="center"><?php echo '<a href="javascript:popupWindow(\'' . FILENAME_POPUP_IMAGE . '?pID=$productsid\')">' ?>$imagesmall<br>

 

I did see the comments by Kiss2000 on Jan 4 2006 on the contrib download page titled "PopUps STS v3 beta fix". Thank you for pointing me to this bug! The solution above is portable between my test and production site so that's why I'm using this and not what Kiss2000 had suggested. Either will work but this way I don't have to change code later on.

 

On a side note...

 

I'm assuming there must be a bunch of popup_image.php replacement contribs out there so I'm just going to mention what I noticed while fixing this bug in product_info.php.html.

 

The code in popup_image.php was undersizing my image in Firefox. I changed this code:

function resize() {
 if (navigator.appName == 'Netscape') i=40;
 if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
 self.focus();
}

 

to this. Note the commented out line and the +85. It may result in a slightly oversized popup window but that should be ok for now

 

function resize() {
 //if (navigator.appName == 'Netscape') i=40;
 if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+85-i);
 self.focus();
}

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

×