Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Hi,

 

I have created an STS template for my oscommerce store, but I'm running into a few problems.

 

1) I want to display a default image on the front page using one template (index.php.html)

2) When the user navigates away from the index page it would apply a different template to the rest of the site. (sts_template.html)

 

I have posted some test urls for you to look at:

 

http://hussein787.t35.com/index.php.html (template with image - used google image for example purpose)

 

http://hussein787.t35.com/sts_template.html (template for rest of site - without image)

 

(I'm sorry about the pop-up ads, just a temporary free host for this example) smile.gif

 

I have looked at the examples found at:

 

http://www.diamondsea.com/sts/sites.html

 

As you can see they place sts_template.html in the includes folder so (includes/sts_template.html)

and they place the index.php.html in the subdirectory so (includes/sts_templates/index.php.html)

 

I have tried this method but does not work, Do I need to change anything in the STS module in the Admin Panel.

 

Hope you can help.

 

Thanks in advance.

 

Hussein

Unique skins and accessories for your media player device - iPod / iPhone / PSP / Nintendo / Xbox - www.iangel.co.uk

Link to comment
Share on other sites

Hi all,

Well done for this nice contrib I'm successfully using since V1.9

 

I've a little problem, for my STS v4.3 with Header Tags Controller v2.5.9 bundle.

I'm using only the default template.

 

I just want to add this line in the product_info.php page, but it shows nothing :

<a name="<?php echo $tags_array['title']; ?>"></a>

Any idea ? I'm not sure wether it is a sts or HTC problem ;) so may be i'm in the wrong forum.

Thanks for your help.

Seb

Osc 2.2 MS2

Link to comment
Share on other sites

Hi,

 

I have created an STS template for my oscommerce store, but I'm running into a few problems.

 

1) I want to display a default image on the front page using one template (index.php.html)

2) When the user navigates away from the index page it would apply a different template to the rest of the site. (sts_template.html)

 

I have posted some test urls for you to look at:

 

http://hussein787.t35.com/index.php.html (template with image - used google image for example purpose)

 

http://hussein787.t35.com/sts_template.html (template for rest of site - without image)

 

(I'm sorry about the pop-up ads, just a temporary free host for this example) smile.gif

 

I have looked at the examples found at:

 

http://www.diamondsea.com/sts/sites.html

 

As you can see they place sts_template.html in the includes folder so (includes/sts_template.html)

and they place the index.php.html in the subdirectory so (includes/sts_templates/index.php.html)

 

I have tried this method but does not work, Do I need to change anything in the STS module in the Admin Panel.

 

Hope you can help.

 

Thanks in advance.

 

Hussein

Hussein, first things first...

 

You have to be careful about which version of STS you are using and follow the instructions for that version only when working on your site. For example, the earlier STS versions are structured completely different from versions after 4.1.

 

OK...the easiest way to accomplish what you want to do is create a home page template using index.php_0.html and then use index.php.html for the rest of your site.

 

Your templates should be in your template folder. The default "out of the box" template folder is catalog/includes/sts_templates/test. I suggest changing to the "full" template folder (be sure to set this as the default template folder in the admin) and take advantage of the other options in STS such as content templates and others.

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,

 

I use STS 4.3.3 with the discount coupon codes module. One issue can up during integration which I was wondering if anyone could comment.

 

Basically there seems to be an issue with the code that displays error messages in the checkout_payment.php module. The sections of code that display the error messages are normally held in the header.php file. I looked at my installation files and this code was indeed where it shouod be but there were no error messages displayed when STS was installed.

 

By copy the error displaying code directly into the checkout_payment.php module everything behaves as it should. So finally my question:

 

Does STS use the normal header file ( /includes/header.php ) when it displays my checkout_payment.php file via a template or is the header.php file not used?

 

Does STS have it's own version of header.php in a different location maybe?

 

Just wondering if anyone could thouw any light on this.

 

FYI - the brief discussion I raised on the discount coupon codes support thread starts here:

 

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

 

Cheers,

 

Bill

Edited by bill99
Link to comment
Share on other sites

  • 2 weeks later...
Hi all,

Well done for this nice contrib I'm successfully using since V1.9

 

I've a little problem, for my STS v4.3 with Header Tags Controller v2.5.9 bundle.

I'm using only the default template.

 

I just want to add this line in the product_info.php page, but it shows nothing :

<a name="<?php echo $tags_array['title']; ?>"></a>

Any idea ? I'm not sure wether it is a sts or HTC problem ;) so may be i'm in the wrong forum.

Thanks for your help.

Seb

 

With sts v4.x, variables are placed in $sts->template array and in $template_pinfo array for product info content template. Check the manual to see what is the variable name you can use instead of $tags_array['title']

 

- Rigadin

Link to comment
Share on other sites

Hi Rigadin,

Thanks for your reply. I've dealed with the problem by adding the page where are the variables I need , in the application_top page. Thus those variables can be accessed from everypage using STS.

So in application_top.php I added at the end :

require('includes/header_tags.php');

And now the $tags_array['title'] is accessible on every page of my website.

Seb

Osc 2.2 MS2

Link to comment
Share on other sites

hello all....

 

I'm using the sts template system and i love it...

only thing that i miss (or could not find :-) is a way to change bottons and images for each template.

keeping the option to switch the template off reverting to stock osc..

 

so coded it , and it works great...

 

here it is :

in includes/functions/html_output.php

put :

 
//BOF STS MOD TO DISPLAY IMAGES FROM TEMPLATE DIR ONLY IF THEY EXIST
// YOU NEED TO PUT THEM IN THE FULL PATH LIKE catalog/includes/sts_templates/test/includes/languages/dutch/images/buttons/button_buy_now.gif

if (MODULE_STS_DEFAULT_STATUS=="true") {
	if ($_GET['sts_template']=="") {
		if (file_exists('includes/sts_templates/'.MODULE_STS_TEMPLATE_FOLDER.'/'.$src)) {
			$src='includes/sts_templates/'.MODULE_STS_TEMPLATE_FOLDER.'/'.$src;
		}
	} else {
		if (file_exists('includes/sts_templates/'.$_GET['sts_template'].'/'.$src)) {
				$src='includes/sts_templates/'.$_GET['sts_template'].'/'.$src;
		}
	}
}
//EOF STS MOD

 

directly after :

 function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {

 

thats it ... if you have a image in the right template dir it uses it , otherwise it picks the origenal.

tested in stock osc and imagemagic.

 

Let me know if you found it usefull , maybe post it to the contribution...

 

grtx , arnold

Link to comment
Share on other sites

and a little update to show buttons from forms also..

 

again in includes/functions/html_output.php :

 

just after :

  function tep_image_submit($image, $alt = '', $parameters = '') {
global $language;

 

put :

 
//BOF STS MOD TO DISPLAY IMAGES FROM TEMPLATE DIR ONLY IF THEY EXIST
	// YOU NEED TO PUT THEM IN THE FULL PATH LIKE catalog/includes/sts_templates/test/includes/languages/dutch/images/buttons/button_buy_now.gif

 if (MODULE_STS_DEFAULT_STATUS=="true") {
	  if ($_GET['sts_template']=="") {
		  if (file_exists('includes/sts_templates/'.MODULE_STS_TEMPLATE_FOLDER.'/'.DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image)) {
			  $image_submit = '<input type="image" src="' . tep_output_string('includes/sts_templates/' . MODULE_STS_TEMPLATE_FOLDER .'/'. DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
		  }
	  } else {
		  if (file_exists('includes/sts_templates/'.$_GET['sts_template'].'/'.DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image)) {
			  $image_submit = '<input type="image" src="' . tep_output_string('includes/sts_templates/' . $_GET['sts_template'] .'/'. DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
		  }
	  }
  }
  //EOF STS MOD

 

and add to slashed to the next line so it looks like :

 //  $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';

 

grtx

Link to comment
Share on other sites

Thanks Arnold for the code, this is really interesting and simple. I'll see if I can integrate it into the next STS release.

 

To know which template folder is in use, you don't need to check $_GET, as STS has done it already. The actual template folder in use can be found in

 

DIR_WS_INCLUDES . 'sts_templates/' . $this->template_folder .'/'

or in STS_TEMPLATE_DIR (but this constant is not available in case of pages not using template, like the popup_image.php)

 

To use $sts inside a function, you'll need to declare $sts as global:

global $sts;

 

The image mod would look like this: (not tested)

 

	//BOF STS MOD TO DISPLAY IMAGES FROM TEMPLATE DIR ONLY IF THEY EXIST
// YOU NEED TO PUT THEM IN THE FULL PATH LIKE catalog/includes/sts_templates/test/includes/languages/dutch/images/buttons/button_buy_now.gif

if (MODULE_STS_DEFAULT_STATUS=="true") {
  global $sts;
  if (file_exists('DIR_WS_INCLUDES . 'sts_templates/' . $this->template_folder .'/'.$src)) {
	  $src='DIR_WS_INCLUDES . 'sts_templates/' . $this->template_folder .'/'.$src;
  }
}
//EOF STS MOD

 

In a future release it'll be something like this:

global $sts;
$sts->image($src);

 

 

Great idea Arnold!

 

- Rigadin

Link to comment
Share on other sites

Hi,

 

I copied all the files over to my not yet installed catalog. Then uploaded, installed the database as normal. Without any other contributions.

 

Where it should be displaying 'STS' under the modules menu it says BOX_MODULES_STS

 

I click this but nothing happens. Infact it says the module directory is catalog/includes/modules/payment/

 

So under the BOX_MODULES_STS menu I display payment modules.

 

How I managed this I don't know.

 

Any help would be appreciated

 

Steve

Link to comment
Share on other sites

Hi,

 

I copied all the files over to my not yet installed catalog. Then uploaded, installed the database as normal. Without any other contributions.

 

Where it should be displaying 'STS' under the modules menu it says BOX_MODULES_STS

 

I click this but nothing happens. Infact it says the module directory is catalog/includes/modules/payment/

 

So under the BOX_MODULES_STS menu I display payment modules.

 

How I managed this I don't know.

 

Any help would be appreciated

 

Steve

Link to comment
Share on other sites

@rigadin ...

 

Thanks for the recoding , i'm a little new to php so not used to using classes as you can see..

 

But it works great....

 

grtx , arnold

Arnold and Rigadin....this is really good stuff! I love it! I'm thinking a popup_image template maybe? Hmm...

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

Arnold and Rigadin....this is really good stuff! I love it! I'm thinking a popup_image template maybe? Hmm...
Forget the above post...STSv4.4 has just been uploaded and it now includes a POPUP image template. Very Cool. :thumbsup: :thumbsup: :thumbsup:

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

Have you installed both "new_files" and "modified_files" folders?

 

Yes, I installed both twice, verifying if gone be a mistake, but, same problem appears.

 

 

With default install, I have problem to update via administrator and subtitute the following sentence in /catalog/admin/modules.php:

 

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

 

for thisone:

 

foreach ($HTTP_POST_VARS['configuration'] as $key => $value){

 

And the problem dissappers, I can update all I need.

 

What do you think about thisone ?

 

TKSvery much for your answer.

Link to comment
Share on other sites

If you like to see the address of my web is the following:

 

http://www.jardinesjaponeses.com/catalog/index.php

 

http://www.jardinesjaponeses.com/catalog/admin/index.php

 

I leave it now without password check ok ?

 

Again, thanks very much

I took a look and it appears everything is good on the admin side (as far as I can tell anyway) so I would assume that something on the catalog side (catalog/includes) didn't get configured correctly. :blink:

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 took a look and it appears everything is good on the admin side (as far as I can tell anyway) so I would assume that something on the catalog side (catalog/includes) didn't get configured correctly. :blink:

 

TKS, I gone see again, but really I dont know what happen about. Really, any changes was make about me. Simply I copy and paste via FTP like STS instructions manual.

Link to comment
Share on other sites

I find the mistake. UUUpiiiii !!!!

 

I dont update folder \modified_files\catalog\admin and thats all.

 

Its working !!!

 

Another reply is that I modify the following to correct a bug on the update of any payment, shipping, or STS via the module attributes in adminstrator tool.

 

I change de following in /catalog/admin/modules.php:

 

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

 

to:

 

foreach ($HTTP_POST_VARS['configuration'] as $key => $value){

 

and it work ok.

 

Refer to:

 

http://www.oscommerce.com/forums/index.php?sho...mp;#entry923577

 

Once again, thanks !!!

Link to comment
Share on other sites

I find the mistake. UUUpiiiii !!!!

I dont update folder \modified_files\catalog\admin and thats all.

Its working !!!

Another reply is that I modify the following to correct a bug on the update of any payment, shipping, or STS via the module attributes in adminstrator tool.

I change de following in /catalog/admin/modules.php:

while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

to:

foreach ($HTTP_POST_VARS['configuration'] as $key => $value){

and it work ok.

Refer to:

http://www.oscommerce.com/forums/index.php?sho...mp;#entry923577

Once again, thanks !!!

The bug you are referring to is not STS related but rather the 060817 osCommerce update itself. The correct way to fix this "module update problem" is to use the "reset" variable. You could do what you did above but the correct way is to use the reset option as listed in the 060817 patch that has been made available in the STS download page as a conveinence to all STS users. ;)

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

has anyone used sts with extra images and lightbox conntrib.

If so can you help me with what changes i need to do in my files if i have already installed lightbox and extra images before using sts.

All help is welcome and greatly appreciated.

Thanks

Nilesh

Link to comment
Share on other sites

I am trying to install STSv4.4 with the dynamenu contribution.

Has anyone got these to work together?

I have it installed ok but when I roll over the menu I get an object expected error.

Any help would be great.

Link to comment
Share on other sites

I am trying to install STSv4.4 with the dynamenu contribution.

Has anyone got these to work together?

I have it installed ok but when I roll over the menu I get an object expected error.

Any help would be great.

Sarah, try the following link and you may find what you are looking for: (STS 4 Power Pack download site)

http://www.oscommerce.com/community/contributions,4456

I have a tutorial for getting these two contributions to work together.

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