Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

This is a dumb question but how do i upload the header.sql file? Im REALLY new at this stuff... and trying teach myself as I go... But I have no idea where to start with the sql stuff... i can do html... but newbie to php also... :( thanks sherriz :ph34r:

Link to comment
Share on other sites

This is a dumb question but how do i upload the header.sql file? Im REALLY new at this stuff... and trying teach myself as I go... But I have no idea where to start with the sql stuff... i can do html... but newbie to php also... :( thanks sherriz :ph34r:

Are you using cPanel? If so, go to "MySQL Databases" scroll all the way down on that page, click on "phpMyAdmin" then find your osc databases in the drop-down menu on the left, and then click the SQL tab toward the top and then click browse and then find your file and then hit Go.

 

Hopefully that helps. Sorry for the long sentence that I wrote, even though it is not really a sentence.

Link to comment
Share on other sites

Hi all.. this is my first post on this forum .. so let me know how it goes for you..

 

I have read countless threads and contributions to enable the categories and subcategories to display in title of the page. All of them i had problems with and struggled through until i came up with the following answer. Please bare in mind that i am a complete noob to both OSC and PHP but thought i'd post to possibley help.. no matter how dirty my solution.

 

BTW i have the STS installed also

 

ok here goes

 

in index.php find the following at around line 67

 

 <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

replace with

 

<td class="pageHeading"><?php echo $category['categories_name']; ?></td>

 

then find at about line 227

 

    }
   }
?>

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<?php

 

and replace with

 

    }
   }
?>
<?php
$category_query1 = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$category1 = tep_db_fetch_array($category_query1);
?>
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo $category1['categories_name']; ?></td>
<?php

 

 

Hope this works for you if it's what you are looking for....

 

Like i said i'm a complete noob in both OSC and PHP.

 

the above solution was a combination of loads of peoples contributions and thread posts which with a lot of trial and error you can finally get there.. Thanks to everyone :)

 

Sorry but i doubt if i will be able to answer any questions about this if it doesn't work.. i just know it works for me :P

Link to comment
Share on other sites

Can someone tell me how to get my product templates to be the same as whichever category the product appears in? If you check out my site,

 

www.unlimitedperfumes.com

 

You will see what I mean. Once you get to one of the product pages, it reverts back to the "Home" tab being highlited, as opposed to the "Women's" or "Men's" depending on which category the product is in. Does anyone have any suggestions?

 

JP

Link to comment
Share on other sites

Love the STS template system, couple of things though, I cant get the other templates to display in my sts_template directory, just the standard template shows for all my pages, Im using the sts contribution with support for header tags etc. which brings me onto question number 2. my BOF: Generated Meta Tags only show up on the main page, on all other pages such as product info, there are no meta tags :huh: anyone know why this happens?

Link to comment
Share on other sites

Will STS work with MS3 right out of the box ? This is probably the only concern I have about this contrib.

I have a store that has lots of contribs installed (around 7), and I am thinking of modifying the stock look of os commerce.

 

Can anybody offer a suggestion on how to do this in the shortest time possible ?

Link to comment
Share on other sites

Love the STS template system, couple of things though, I cant get the other templates to display in my sts_template directory, just the standard template shows for all my pages, Im using the sts contribution with support for header tags etc. which brings me onto question number 2. my BOF: Generated Meta Tags only show up on the main page, on all other pages such as product info, there are no meta tags :huh: anyone know why this happens?

For question 1, is the folder called sts_template, or sts_templates? It needs to be sts_templates. Question 2, don't know. Sorry

Link to comment
Share on other sites

Can someone tell me how to get my product templates to be the same as whichever category the product appears in?  If you check out my site,

 

www.unlimitedperfumes.com

 

You will see what I mean.  Once you get to one of the product pages, it reverts back to the "Home" tab being highlited, as opposed to the "Women's" or "Men's" depending on which category the product is in.  Does anyone have any suggestions?

 

JP

Sounds like your having the same problem I am, the product info template doesn't seem to be kicking in and its reverting to the default sts index template. Try deleting the product_info.php.html and if there is no change your having the same prob as me..

Edited by Vince76
Link to comment
Share on other sites

Just tried the 25 Aug 2004 - STS 2.01 Bug fixes but page-specific templates still not working. If I revert back to the sts 2.00 sts_display_output.php they work but then I lose the meta tags and header tag options. Any ideas?

 

Cheers..

I should have been a little more specific, when I say page specific templates not working I mean product_info.php.html specifically. I can delete that file and there is no change even though I have applied the latest fix..

Link to comment
Share on other sites

Ok Fixed it! All I did was revert back to the original code for override popup window section.

 

Replaced

/*  /////////////////////////////////////  ERROR FIXED by Walo /////////////
/////////////////////////////////////////  ERROR FIXED by Walo /////////////
/////////////////////////////////////////  ERROR FIXED by Walo /////////////
// Override if we need to show a pop-up window
$scriptname = $_SERVER['PHP_SELF'];
$scriptname = getenv('SCRIPT_NAME');
$scriptbasename = substr($scriptname, strrpos($scriptname, '/') + 1);
// 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 (strpos($scriptname, "popup") !== false || strpos($scriptname, "info_shopping_cart") !== false) {
$display_normal_output = 1;
$display_template_output = 0;
}
/////////////////////////////////////////  ERROR FIXED by Walo /////EOF/////
*/


// Override if we need to show a pop-up window
$scriptname = $_SERVER['PHP_SELF'];
// Returns file name without path nor parameters
$scriptbasename = substr($scriptname, strrpos($scriptname, '/') + 1);
$scriptname1 = strstr($scriptname, "popup");
$scriptname2 = strstr($scriptname, "info_shopping_cart");
// 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 ($scriptname1 != false || $scriptname2 != false) {
$display_normal_output = 1;
$display_template_output = 0;
}

 

With original version

// Override if we need to show a pop-up window
$scriptname = $_SERVER['PHP_SELF'];
$scriptname = getenv('SCRIPT_NAME');
$scriptbasename = substr($scriptname, strrpos($scriptname, '/') + 1);
// 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 (strpos($scriptname, "popup") !== false || strpos($scriptname, "info_shopping_cart") !== false) {
$display_normal_output = 1;
$display_template_output = 0;
}

 

Seems to work fine for me now.

 

Cheers..

Link to comment
Share on other sites

Love the STS template system, couple of things though, I cant get the other templates to display in my sts_template directory, just the standard template shows for all my pages, Im using the sts contribution with support for header tags etc. which brings me onto question number 2. my BOF: Generated Meta Tags only show up on the main page, on all other pages such as product info, there are no meta tags  :huh: anyone know why this happens?

For question 1, is the folder called sts_template, or sts_templates? It needs to be sts_templates. Question 2, don't know. Sorry

The dir is named sts_templates

Link to comment
Share on other sites

Can anyone give some ideas on how to add contributions to sts. I been going all day without success. I have been through 80 pages of this thread but no answers. I have tried searching the forums and google, and even experimenting myself with poor results.

 

I am trying to use, EZfeilds, master products, and text feild option attributes with sts but can't seem to get anything working.

 

Is there a special way we are supposed to go about adding contribs to sts? Could someone write up maybe some short docs as to what kind of things we need to think about when trying to use contribs with sts?

 

Sts is a great idea but it's not much good if us php noobs can't use it with other contribs. I'd prefer to lose cosmetics over functionality anyday but would be nice to have both ;-)

 

cheers..

Link to comment
Share on other sites

Can anyone give some ideas on how to add contributions to sts. I been going all day without success. I have been through 80 pages of this thread but no answers. I have tried searching the forums and google, and even experimenting myself with poor results.

 

I am trying to use, EZfeilds, master products, and text feild option attributes with sts but can't seem to get anything working.

 

Is there a special way we are supposed to go about adding contribs to sts? Could someone write up maybe some short docs as to what kind of things we need to think about when trying to use contribs with sts?

 

Sts is a great idea but it's not much good if us php noobs can't use it with other contribs. I'd prefer to lose cosmetics over functionality anyday but would be nice to have both ;-)

 

cheers..

Well, I have never used those contributions, but I have about 10 others installed. How are you doing it? Are you just putting the files up that are in the contribution? Most of the contributions come with advanced instructions that tell you exactly what needs to be put where. So, you actually have to copy and paste code into your files that are already up in order for them to work. It can take some time to do this however. If you are already doing this, then I really don't know what is going on.

Link to comment
Share on other sites

Adding contributions can be tricky. The easiest way to do it is to make a list of the files that have been modified by contributions as you add them and then compare that list so you have a decent idea which files are virgin osc in your store.

 

Given that some of the contribs use files that are slightly out of date as well you really, really need some way to find the differences in them. I'm sure the folks here all have their favs and can suggest some. I'm on a Mac and use BBedit to diff my files.

 

Keep in mind that as you add contributions you WILL, at some point, run into a contrib that steps on another and WILL have to combine code. Not for the faint of heart but overall if you're persistent, have a little experience with php and can deal with sifting through many, many posts you'll probably find an answer or pointer here on the forums.

 

Hope that helps a bit and good luck!

 

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

i can create a "product specific templates" in sts. did this method can apply to index & catagories pages??? because sts isnt support mutil-language in index & catagories pages at this moment?

Link to comment
Share on other sites

i can create a "product specific templates" in sts. did this method can apply to index & catagories pages??? because sts isnt support mutil-language in index & catagories pages at this moment?

 

Hi Brian or Anyone,

 

Please help me, I hang in this stage for the loooooooooooong time :(

Many Thanks

Link to comment
Share on other sites

i can create a "product specific templates" in sts. did this method can apply to index & catagories pages??? because sts isnt support mutil-language in index & catagories pages at this moment?

 

Hi Brian or Anyone,

 

Please help me, I hang in this stage for the loooooooooooong time :(

Many Thanks

STS supports the default OSC language settings, and you can further control how your template displays images by using the $langid variable in your file names.

 

For example, if you want a button that says "Shopping Cart" in various languages, in your template file where you would normally have

 

<img src="images/cart_button.gif"> (or whatever you call it)

 

change it to be

 

<img src="images/cart_button-$langid.gif">

 

and then create the graphics $cart_button-1.gif for English, $cart_button-2.gif for German, $cart_button-3.gif for French, etc. The numbers should match the LANGID variables in your database.

 

Hope this helps.

 

- 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

Hi Brian,

 

Thank you for your very fast respond.

 

I've hear this method before, but I think this is not a suitable solution for my request.

 

Because I want to creat the template like amazon.com.

2.gif

i think this solution cant create a hyper link for both language.

 

I hope you have a other solution to solve the problem.

 

 

Many Thanks

Link to comment
Share on other sites

Hi Brian,

 

Since you're in here I'm hoping I can pick your brain as well. Are there plans to incorporate some of the individual product_info.php template solutions into STS or is there a particular method you'd recommend or have used?

 

Thanks!

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

Hi Brian,

 

Thank you for your very fast respond.

 

I've hear this method before, but I think this is not a suitable solution for my request.

 

Because I want to creat the template like amazon.com.

2.gif

i think this solution cant create a hyper link for both language.

 

I hope you have a other solution to solve the problem.

 

 

Many Thanks

You could do this, just have the graphics in the menu as button1-$langid.gif", button2-$langid.gif etc.

 

The graphics would then appear in whatever language you want, and they would go to the same URL/links regardless of the language, since OSC is multi-language by default.

 

Of course, if you really want a different language for each page, just make your links like <a href="thispage-$langid.html"> or <a href="thatspage-$langid.php"> or whatever you want.

 

- 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

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