Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Hi

Just installed STS in new OSCommerce site but now i get

Fatal error: Cannot instantiate non-existent class: currencies in /import_fs2/home/scream/public_html/learnex/catalog/includes/application_top.php on line 258

Is this easy to fix or should I do a total reinstal (took about 5 hours on my crusty modem and makes me sleepy)

Thanks

Andrew

Link to comment
Share on other sites

I just installed the sts on a new oscommerce installation, and it can be viewed here.

http://www.splendoria.com/shop/

Just a couple of questions.

 

After updating the sts_display_output.php, my custom product info page reverts to the original one.

 

Btw, if I'm not using the header tag controller, where should I add my meta tags?

Link to comment
Share on other sites

Rellie

Btw, if I'm not using the header tag controller, where should I add my meta tags?

 

You should try the header tag controller it make it very easy to add keywords & descriptions for each individual product.

I'm not a coder just a splicer.

Link to comment
Share on other sites

Well, I looked at the instructions, and it is just soo SO troublesome, to go through all the pages.. Then I looked at the STS read me, and it says that it is already "sort of" incorporated, but I don't really understand what will I have to do if I already have STS installed. I tried it once, and it messed up completely..

Link to comment
Share on other sites

I have not resolved the issue of STS using the default template on product pages instead of my product_info.php.html template. I've compared all my files and stepped through the install again. Checked everything I can think of. It works sucessfully with a handful of other pages I've tried such as index.php_0.html and product_reviews_info.php.html. I tried the fix offered by bythevineyard. Nothing seems to work. Any suggestions?

 

Regards,

Jim

Link to comment
Share on other sites

in sts_display_output.php, there are a couple of lines commented out to fix popups.

 

when they did this it made it so $scriptbasename was no longer getting set.

 

I just put the lines back in so it sets the variables once to get $scriptbasename and then does it again for the popup fix....

 

I added this:

 

// Trying to set the variable for product info pages

$scriptname = $_SERVER['PHP_SELF'];

$scriptname = getenv('SCRIPT_NAME');

$scriptbasename = substr($scriptname, strrpos($scriptname, '/') + 1);

 

Just before this:

 

// Override if we need to show a pop-up window

$scriptname = $_SERVER['PHP_SELF'];

$scriptname = strstr($scriptname, "popup");

 

// If script name contains "popup" then turn off templates and display the normal output

// This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly

if ($scriptname != false || $scriptname2 != false) {

$display_normal_output = 1;

$display_template_output = 0;

 

Hope that helps.

 

Am sure that is all I did to get the product template working.

 

Dave http://bythevineyard.com

Edited by bythevineyard
Link to comment
Share on other sites

Try naming the sts block articles_box instead of articles. I think articles is already a variable being used.

Well, that did something...

 

Now I am getting the folowing error:

 

Fatal error: Cannot redeclare tep_show_topic() (previously declared in /nfs/home/user/public_html/catalog/includes/boxes/articles.php:13) in /nfs/home/user/public_html/catalog/includes/boxes/articles.php on line 13

 

 

The offending line in articles.php is:

13    function tep_show_topic($counter) {
14         global $tree, $topics_string, $tPath_array;

 

This is the entire funtion:

  function tep_show_topic($counter) {
   global $tree, $topics_string, $tPath_array;

   for ($i=0; $i<$tree[$counter]['level']; $i++) {
     $topics_string .= "  ";
   }

   $topics_string .= '<a href="';

   if ($tree[$counter]['parent'] == 0) {
     $tPath_new = 'tPath=' . $counter;
   } else {
     $tPath_new = 'tPath=' . $tree[$counter]['path'];
   }

   $topics_string .= tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">';

   if (isset($tPath_array) && in_array($counter, $tPath_array)) {
     $topics_string .= '<b>';
   }

 

How am I going to edit that?

Link to comment
Share on other sites

OK ... possibly a dumb question but so be it... I am stumped...

 

I have made some progress with this STS but when I use a bg image on my header and footer bar it makes the text lose it's BOLD feature. No where can I find where to make the text in header bar and footer bar bold again :(

 

Any help will be appreciated!

Liz

Link to comment
Share on other sites

Just installed STS 2.0x. Moving info boxes and such are easy. Thanks. But the question I have is how to use multiple templates. I want only the products of one catagory to show on the main page (using default template), but I difference a different layout (OSCommerce stock) layout in all others. Can STS does this, and how.

thanks.

chris

Link to comment
Share on other sites

priduct_info custom page problem my solution :)

 

i tried add lines as bythevineyard do but my template for product info was still unavalible so i do it myself :)

 

first open sts_display_output.php and find and delete this

if ($scriptbasename == 'product_info.php') {
 require(STS_PRODUCT_INFO);
}

 

then find

$sts_template_file = STS_DEFAULT_TEMPLATE;

and below add this

if ($scriptbasename = "product_info.php") {
 require(STS_PRODUCT_INFO);
}

if ($pipka == "1") {
$sts_template_file = "includes/product_info.php.html";
}

save and now edit product_info.php in your main shop directory

on the begining after licensing and other stuff

befor require('includes/application_top.php');

add

$pipka = 1;

that all if variable named pipka = 1 default template is product_info.php.html in your includes/ directory else sts_template.php

 

i the same way we can do custom templates for any file in main shop direcory :)

using $content or sts_product_info.php variables

 

just remember to change $pipka variables depend on file and add new lines to sts_display_output.php

 

example

and $pipka = 2 to product_reviews.php

and to sts_display_output.php

 

if ($pipka == "2") {

$sts_template_file = "includes/product_reviews.php.html";

}

 

make tamplate for products_reviews jus remember that main concept of reviews is in $content variable and is not editable but serches categories newsletters are fulu editable as in sts_template.html

 

for me its works :)

Link to comment
Share on other sites

Hi,

 

Just installed the template, it is great !!

However, still need some help and advice :

 

1. how do I "control" $content ? :ph34r:

which file does it link to ?

 

I wish to amend the page with title "Let's See What We Have Here" / "Categories"

 

Tks & Rdgs

Link to comment
Share on other sites

I'm very new to all this, when I try and install sts I get this error message

 

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /home/o0o/public_html/shop/includes/application_top.php on line 511

 

Fatal error: main(): Failed opening required 'STS_START_CAPTURE' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/o0o/public_html/shop/includes/application_top.php on line 511

 

Thanks in advance

 

Ryan

Link to comment
Share on other sites

I am currently converting my shop from the BTS contribution to this one. I was reading through the README file and found this:

 

-----------------------------------------------------------------------------

TIPS AND TRICKS:

-----------------------------------------------------------------------------

 

WHEN CREATING TEMPLATE FILES, USE ___ABSOLUTE___ URLs. Using relative URLs

will work, but it may be a bit tougher to debug your templates.

 

Make your image and stylesheet links absolute URL's (with a leading slash

or http://) instead of relative (no leading slash).

 

This will allow you to simply view the template page in your browser exactly

as it will appear on your site, as opposed to the missing-image version you

get with relative URL's, above.

 

You'll then be able to view your accurate-looking template page with the URL:

 

  http://www.YourDomain.com/YourCatalogPath/...s_template.html

 

You can accomplish the same effect using a <base> tag and still be allowed to use relative URL's which makes moving a site easier.

 

If you put the following within the HEAD of your document:

<base href="http://127.0.0.1/sites/test_store/">

 

Will tell your browser to automatically make all your relative links into Absolute links with the URL specified. It works for images and loading external files such as CSS, Images and Javascript.

Link to comment
Share on other sites

Hi, I got this installed and have had it for a while...

 

I was wondering how I would go about making the browser title dynamic so it would load the product title name in the browser title instead of having my store name there constantly....

 

this is what I am trying to fix:

 

http://froogle.google.com/froogle?scoring=...ts.com&filter=0

 

if you notice, everything comes up as my store title vice the product...

 

thanks in advance if you can help!!

Edited by higabyte
Link to comment
Share on other sites

Whoa...

 

I just recently installed my store, and put STS in which is usually no problem, but I have come up with this error:

 

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /home/user/public_html/catalog/includes/application_top.php on line 583

 

Fatal error: main(): Failed opening required 'STS_START_CAPTURE' (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/') in /home/user/public_html/catalog/includes/application_top.php on line 583

 

So I check what is on line 583:

581     // STS: ADD
582     // Capture text between application_top.php and header.php
583     require(STS_START_CAPTURE);
584     // STS: EOADD

 

That's kind of screwy... the file is on the server in the place it is supposed to be...

 

Hmmmm <_<

Link to comment
Share on other sites

Whoa...

 

I just recently installed my store, and put STS in which is usually no problem, but I have come up with this error:

 

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /home/user/public_html/catalog/includes/application_top.php on line 583

 

Fatal error: main(): Failed opening required 'STS_START_CAPTURE' (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/') in /home/user/public_html/catalog/includes/application_top.php on line 583

 

So I check what is on line 583:

581 ? ? // STS: ADD
582 ? ? // Capture text between application_top.php and header.php
583 ? ? require(STS_START_CAPTURE);
584 ? ? // STS: EOADD

 

That's kind of screwy... the file is on the server in the place it is supposed to be...

 

Hmmmm <_<

When I got this error, it was because I forgot to add the few lines of STS lines to the config file.... It wasn't that the file didn't exist, it was that it wasn't defined in the config.php file. Hope this helps!

Link to comment
Share on other sites

Hi everyone.

Maybe this issue was discussed here already, but this thread is sooo long and the search function of the forum is sooo poor, so here it is :

 

The file name index.php as the default template is hard-coded in sts_display_output.php.

So if you want to change our main file name from index.php to shop.php for example STS will not find shop.php.html templates.

The code should be :

// Are we in the index.php script?  If so, what is our Category Path (cPath)?
if ($scriptbasename == FILENAME_DEFAULT) {
 // If no cPath defined, default to 0 (the home page)
 if ($cPath == "") {
$sts_cpath = 0; 
 } else {
       $sts_cpath = $cPath;
 }

 // Look for category-specific template file like "index.php_1_17.html"
 $sts_check_file = STS_TEMPLATE_DIR . FILENAME_DEFAULT . "_$sts_cpath.html";

 if (file_exists($sts_check_file)) {
   // Use it
   $sts_template_file = $sts_check_file;
 }

 

With this change eveything works. Thanks for this great contribution.

 

Greetings,

 

Cristian

Link to comment
Share on other sites

HELP! Any assistance would be sooo appreciated.My Webpage

 

I did the advanced install for the newest STS version on a clean OSC because (apparently) I have the CVS version of OSC. All I have is a blank screen on my store page. I searched through all 100 or so pages of this thread and didn't find any solution to my problem. I saw other people who had posted similar situations (1 or 2) but never saw a response.

 

I'm not up on PHP or most of the other technical aspects of building my site but I know HTML a bit so I thought this would be the best way to go about it. I'm at my wits end and ready to throw in the towel but I hate to give up and just have a standard OSC.

 

PLEASE help me! You would be my savior! I've been at this for 2 weeks now with little to show and have installed 4 carts (including the Agoracart I abandonned because it was too confusing).[email protected]

 

Information monkeys could follow would be best for me!

Link to comment
Share on other sites

HELP! Any assistance would be sooo appreciated.My Webpage

 

I did the advanced install for the newest STS version on a clean OSC because (apparently) I have the CVS version of OSC. All I have is a blank screen on my store page. I searched through all 100 or so pages of this thread and didn't find any solution to my problem. I saw other people who had posted similar situations (1 or 2) but never saw a response.

 

I'm not up on PHP or most of the other technical aspects of building my site but I know HTML a bit so I thought this would be the best way to go about it. I'm at my wits end and ready to throw in the towel but I hate to give up and just have a standard OSC.

 

PLEASE help me! You would be my savior! I've been at this for 2 weeks now with little to show and have installed 4 carts (including the Agoracart I abandonned because it was too confusing).[email protected]

 

Information monkeys could follow would be best for me!

If you are not up on php you really should be using the milestone version as it is considered the last stable release. Going with a devolpment version when you do not know php just seems to be asking for trouble.

I have yet to have an clean sts install break anything and not work except when I forgot to make the changes to the config file.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

If you are not up on php you really should be using the milestone version as it is considered the last stable release. Going with a devolpment version when you do not know php just seems to be asking for trouble.

I have yet to have an clean sts install break anything and not work except when I forgot to make the changes to the config file.

 

Hi Richard, Thanks for the response. I used the version that is automatic through my hoster (webhostingbuzz) so it would automatically install and I wouldn't have to mess with that part. That's all I know about it. I am assuming it's CVS because there are folders labelled CVS in my filemanager now. :( I definitely made the changes to the config file though. I can follow directions very well and I'm a fast learner. I hate to ask for help so I tried everything I could think of before doing so, including reading EVERY post in this thread & all the FAQs, lol.

Link to comment
Share on other sites

Well the install is really not that hard. My hosting company offers an automatic install through cpanel also but it is actually an older version so I opted to go ahead and install it myself and I have had a lot less trouble doing it that way.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Is it at all possible to use a STS product_info template together with Price Break? PB uses its own price calculation mechanism, as does sts_product_info.php ($template['regularprice'] I think).

Unfortunately I'm much too dumb to be able to understand where and how $template['regularprice'] and $pf = new PriceFormatter; could work together.

 

Has anyone done this before?

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