Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Is it possible to create product level templates?

 

I have a template for product_info.php, but this site only has a few products and I would like to create a specific page for each product. Is this possible?

Link to comment
Share on other sites

Hey folks, running a new install of osCommerce. The only other installed module is Easy Populate.

 

I followed the sts instructions to the letter, and here are the errors I get when I try to go to the /catalog/ page:

 

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /var/www/html/catalog/includes/application_top.php on line 511

 

Fatal error: main(): Failed opening required 'STS_START_CAPTURE' (include_path='.:/php/includes:/usr/share/php') in /var/www/html/catalog/includes/application_top.php on line 511

 

 

Any help would be greatly appreciated.

 

Accidentally first posted in its own thread.

Link to comment
Share on other sites

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /var/www/html/catalog/includes/application_top.php on line 511

I'm fairly new to this myself and may not be of any help but I'm wondering what you have at line 511 in the application_top.php file? At that line in my file is the STS code I added per the instructions. The end of my file looks like this:

 

// STS: ADD

// Capture text between application_top.php and header.php

require(STS_START_CAPTURE);

// STS: EOADD

?>

 

Does yours end this way?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I love this template system, and I have it working on one install.

 

Today I tried to use it on another install of osc and I am getting this message when I attempt to access my catalog via http://www.propheticminstries.net/catalog/

 

Warning: main(DIR_WS_TEMPLATESmain_page.tpl.php): failed to open stream: No such file or directory in /home/proph102/public_html/catalog/index.php on line 159

 

Fatal error: main(): Failed opening required 'DIR_WS_TEMPLATESmain_page.tpl.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/proph102/public_html/catalog/index.php on line 159

Edited by innovations

If only I was the one helping you...

 

.:::::For complete data-driven and multi-media website creations:::::.

http://www.innocentinnovations.com

 

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

Get instructions, visit the documentation site:

http://wiki.oscommerce.com/Top

Link to comment
Share on other sites

When I click on an item in the manufacturers box, it opens up the Advanced Search page with an error (since no fields are filled in). Before STS, clicking on an item would do the search and display items for that manufacturer. Does anyone know how to fix this or what might be wrong?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack_mcs, I wish I could help you but I am having my own problems with the STS v1.8.

 

 

I have dropped my database and deleted my osc files. I re-created my database and installed a fresh version of osc MS2.2. After installing the STS contrib I get this error:

 

 

Warning: main(DIR_WS_BOXESwhats_new.php): failed to open stream: No such file or directory in /home/proph102/public_html/catalog/includes/column_left.php on line 39

 

Fatal error: main(): Failed opening required 'DIR_WS_BOXESwhats_new.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/proph102/public_html/catalog/includes/column_left.php on line 39

 

Can anyone help please, VERY URGENT--THIS IS A LIVE SHOP!

If only I was the one helping you...

 

.:::::For complete data-driven and multi-media website creations:::::.

http://www.innocentinnovations.com

 

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

Get instructions, visit the documentation site:

http://wiki.oscommerce.com/Top

Link to comment
Share on other sites

Jack_mcs, I wish I could help you but I am having my own problems with the STS v1.8.

 

Warning: main(DIR_WS_BOXESwhats_new.php): failed to open stream: No such file or directory in /home/proph102/public_html/catalog/includes/column_left.php on line 39

 

Fatal error: main(): Failed opening required 'DIR_WS_BOXESwhats_new.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/proph102/public_html/catalog/includes/column_left.php on line 39

 

Can anyone help please, VERY URGENT--THIS IS A LIVE SHOP!

NP, it was a question to everyone.

 

As far as your problem is concerned, keeping in mind I'm new to this myself, it appears to be saying that you are missing your whats_new.php file. What do you have at line 39 in your column_left.php file? I would guess that it is require(DIR_WS_BOXES . 'whats_new.php');. Could be totally off here but it may be worh looking at.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi everyone,

 

I am very impressed with this contribution, thanks. :D

 

I do however have a problem with STS (v.1.8), which is either due to my mistake or the contributions being incompatible. :( The problem sounds very basic and easy to fix, but I have been unable to resolve it for some time now.

 

The problem is that when you click on an image to enlarge, the popup box does not display the images but instead displays the template. If anyone has an idea to where the problem is and how to fix, I would be most grateful.

 

Thank you for you time,

 

Gareth

Link to comment
Share on other sites

Yeah, here's what I've got for lines 509 to 512:

 

  // STS: ADD

  // Capture text between application_top.php and header.php

  require(STS_START_CAPTURE);

  // STS: EOADD

 

Still no progress.

Link to comment
Share on other sites

Jack_mcs, I wish I could help you but I am having my own problems with the STS v1.8.

 

 

I have dropped my database and deleted my osc files. I re-created my database and installed a fresh version of osc MS2.2. After installing the STS contrib I get this error:

 

 

Warning: main(DIR_WS_BOXESwhats_new.php): failed to open stream: No such file or directory in /home/proph102/public_html/catalog/includes/column_left.php on line 39

 

Fatal error: main(): Failed opening required 'DIR_WS_BOXESwhats_new.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/proph102/public_html/catalog/includes/column_left.php on line 39

 

Can anyone help please, VERY URGENT--THIS IS A LIVE SHOP!

It looks like you do not have your DIR_WS_BOXES variable or defined at all.

 

The error references Warning: main(DIR_WS_BOXESwhats_new.php) the fact that it has DIR_WS_BOXES in the filename indicates that you do not have it defined properly (or at all) in configure.php.

 

Check that out.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

I love this template system, and I have it working on one install.

 

Today I tried to use it on another install of osc and I am getting this message when I attempt to access my catalog via http://www.propheticminstries.net/catalog/

 

Warning: main(DIR_WS_TEMPLATESmain_page.tpl.php): failed to open stream: No such file or directory in /home/proph102/public_html/catalog/index.php on line 159

 

Fatal error: main(): Failed opening required 'DIR_WS_TEMPLATESmain_page.tpl.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/proph102/public_html/catalog/index.php on line 159

The error message mentions the file DIR_WS_TEMPLATESmain_page.tpl.php. The fact that it contains the string DIR_WS_TEMPLATES and not the value that the varible should contain indicates that you do not have a DIR_WS_TEMPLATES variable defined in your configure.php file. Check that the STS variables at the bottom of configure-SAMPLE.php are included in your configure.php file (before the final ?> line).

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Hey folks, running a new install of osCommerce. The only other installed module is Easy Populate.

 

I followed the sts instructions to the letter, and here are the errors I get when I try to go to the /catalog/ page:

 

Warning: main(STS_START_CAPTURE): failed to open stream: No such file or directory in /var/www/html/catalog/includes/application_top.php on line 511

 

Fatal error: main(): Failed opening required 'STS_START_CAPTURE' (include_path='.:/php/includes:/usr/share/php') in /var/www/html/catalog/includes/application_top.php on line 511

 

 

Any help would be greatly appreciated.

 

Accidentally first posted in its own thread.

Undefined variables - three in a row today :-)

 

Since the variable STS_START_CAPTURE is showing up as the filename that php is trying to find, that indicates that you do not have it defined.

 

Make sure that you have the STS variables from the bottom of the configure-SAMPLE.php file copied into your production configure.php script before the final ?> line.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

DiamondSea - did you see my question about the manufacturerbox? Here's what I posted.

 

When I click on an item in the manufacturers box, it opens up the Advanced Search page with an error (since no fields are filled in). Before STS, clicking on an item would do the search and display items for that manufacturer. Does anyone know how to fix this or what might be wrong?

 

No one seems to have an answer, or a problem for that matter. Any idea what I might have wrong or what to check for?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

You were sort of right.

 

I had copied the variables again from configure-SAMPLE.php to configure.php and uploaded the new configure.php to my site. Although it was saying that it was overwriting the old configure.php, it was not doing so at all.

 

I had to delete the old copy of configure.php off the server and then upload the modified version.

 

It's always the small things...

Link to comment
Share on other sites

It looks like you do not have your DIR_WS_BOXES variable or defined at all.

 

The error references Warning: main(DIR_WS_BOXESwhats_new.php) the fact that it has DIR_WS_BOXES in the filename indicates that you do not have it defined properly (or at all) in configure.php.

Thanks Brian, I am glad that you are still supporting your contribution. I emplimented your suggestion to add a DIR_WS_BOXES variable to the configure.php file, and it worked as promised. The weird thing is, if I needed that variable defined (which I did), why was it not in the original configure file when I downloaded it?

 

 

Thanks a lot

If only I was the one helping you...

 

.:::::For complete data-driven and multi-media website creations:::::.

http://www.innocentinnovations.com

 

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

Get instructions, visit the documentation site:

http://wiki.oscommerce.com/Top

Link to comment
Share on other sites

Hello,

I'm kind of new to OSCommerce and tried to install the Simple Template System (STS) contribution.

 

I made sure everything worked before I added:

// STS: ADD: Define Simple Template System files

define('STS_START_CAPTURE', DIR_WS_INCLUDES . 'sts_start_capture.php');

define('STS_STOP_CAPTURE', DIR_WS_INCLUDES . 'sts_stop_capture.php');

define('STS_RESTART_CAPTURE', DIR_WS_INCLUDES . 'sts_restart_capture.php');

define('STS_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.html');

define('STS_DISPLAY_OUTPUT', DIR_WS_INCLUDES . 'sts_display_output.php');

// STS: EOADD

to the end of my configure file. I added it (before the ?>) and uploaded all the files. Everything seemed right, I check and double checked. When I open the catalog page:

 

http://s90183069.onlinehome.us/catalog/

 

I get the following error:

Template file doesn't exist: [includes/sts_template.html]

Warning: fopen("STS_DEFAULT_TEMPLATE", "r") - No such file or directory

 

yet I can see that file here:

http://www.divotmat.net/catalog/includes/sts_template.html

 

What am I missing?

 

Thanks a ton for the help and great work on all this code. It's much nicer than the other store software I've used.

Link to comment
Share on other sites

// STS: ADD: Define Simple Template System files

define('STS_START_CAPTURE', DIR_WS_INCLUDES . 'sts_start_capture.php');

define('STS_STOP_CAPTURE', DIR_WS_INCLUDES . 'sts_stop_capture.php');

define('STS_RESTART_CAPTURE', DIR_WS_INCLUDES . 'sts_restart_capture.php');

define('STS_TEMPLATE_DIR', DIR_WS_INCLUDES . 'sts_templates/');

define('STS_DEFAULT_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.html');

define('STS_DISPLAY_OUTPUT', DIR_WS_INCLUDES . 'sts_display_output.php');

define('STS_USER_CODE', DIR_WS_INCLUDES . 'sts_user_code.php');

// STS: EOADD

 

Is what I should have added to the config file.

Link to comment
Share on other sites

I'm still working on trying to get the manufacturers box to work correctly on my site. I thought to create a template of my own and use that instead of the one supplied by STS but I can't see how to do that since the required code is too long ( beyond my knowledge of php). Does anyone know how to create such a template?

 

Can someone verify for me that $manufacturer does actually work. That is, if you click on one of the entries, does it display a list of items for that manufacturer? I'm sure it works but my head is starting to hurt from pounding it against this wall and it would be nice to know I'm not battling broken code before continuing.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack_mcs, $manufacturer tag working perfect  for me (demo) .

 

Did you installed STS over a clean copy of 2.2?

Thanks for testing it. At least that's one worry gone.

 

No, the version had other contriutions. Guess I'm going to have to start over and install STS first. Ugh!

 

Thanks for the help. :)

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

It looks like you do not have your DIR_WS_BOXES variable or defined at all.

 

The error references Warning: main(DIR_WS_BOXESwhats_new.php) the fact that it has DIR_WS_BOXES in the filename indicates that you do not have it defined properly (or at all) in configure.php.

Thanks Brian, I am glad that you are still supporting your contribution. I emplimented your suggestion to add a DIR_WS_BOXES variable to the configure.php file, and it worked as promised. The weird thing is, if I needed that variable defined (which I did), why was it not in the original configure file when I downloaded it?

 

 

Thanks a lot

 

I'm still trying to support it, but in the last month I've had a relative pass away, my toddler broke her arm, my car blew up (I had the nerve to finally pay it off, so it had to blow the engine to punish me) and I bought a house. So, I've been a bit busy. :o

 

Anyway, I'm leaving my day job to kick off my consulting company (BG Innovations) full time at the beginning of January, so hopefully I'll have a bit more time to do support on here.

 

As to why you didn't have the DIR_WS_BOXES defined, my best guess is that it got deleted accidentally while modifying the file for something else. It's in the default MS2.2 distribution...

 

That or gremlins in your computer. :P

 

- Brian

Edited by DiamondSea

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Is it possible to use the specials box with this contribution? Can anyone tell me how?

Ok I have now worked out how to get the specials box on my page, however I would like the specials box header and border to be red to make it stand out, can I do this so that only this box is changed and the others remain the standard colour?

Link to comment
Share on other sites

Ok, I've figured out what was causing my manufacturers box not to work. I had added a seach function in my header and apparently that was being parsed when the manufacturer list was selected and, since it was empty, it caused the advanced page to be shown.

 

So does anyone know how to add a search function to the header? I checked the forums and there are solutions but they apparently do not work with STS. I tried to create a template by making a file called mysearch.php (which is a copy of search.php without the html code). I then made a template for STS as

$template['testsearch'] .= 'require(DIR_WS_BOXES . 'mysearch.php');

This sort of works. It places a search box at the very top of my page and both it and the manufacturers search function works. But I have no control over where it is placed it seems.

 

Then I tried changing the template to

$template['testman'] .= '<a href="' .tep_href_link('mysearch.php') . '">';

This was out of desperation - no idea if this is valid or not. Apparently not, since it doesn't display the search box.

 

Can anyone see a way around this problem? I would think this would be a nice feature as it is quite common to have a search box in the header.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

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