Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Hi

 

Is any one using the gift voucher and credit class contribution with STS?

 

If so did you mange to get the coupon error messages to display?

(eg invalid coupon code etc)

 

It shows with normal output but not with the template activated.

 

Any Ideas.

 

Many Thanks

 

Ian

Link to comment
Share on other sites

Help!

 

I am using the STS and everything is fine except when I am using my category templates, somehow the path to add the product to the basket is changing (or not changing) to the one I need to use.

 

The path I get is:

 

<form name="cart_quantity" action="http://domain.com/store2/product_info.php?cPath=1_46&products_id=50&action=add_product" method="post">

 

The path I want is:

 

<form name="cart_quantity" action="http://domain.com/store2/product_info.php?products_id=68&action=add_product" method="post">

 

Where is that annoying cpath variable coming in to the URL - and what do I do to keep it away?

 

Thanks!

 

Deborah

Edited by deborahgsmith
Link to comment
Share on other sites

Hi

I have exactly the same problem between STS and credit class/gift voucher contribution. Can realy nobody help us????

Thanks Patrik - I was beginning to feel like it was something I have done. I also have that contrib installed - and I am still looking for an answer to it without much time left before the deadline.

 

I will post if I figure it out - else I have to back out of the credit contrib and just go with a base plus STS.

 

I hate meeting deadlines right at the deadline!

 

Let me know if you have any luck either.

 

Deborah

Edited by deborahgsmith
Link to comment
Share on other sites

STS FIX - For displaying error messages during the checkout process

 

Ian, Patrick, Deborah:

 

This fix should solve your problem with the credit class/gift voucher contribution not displaying a coupon code error during checkout. I just tried this code and it works great. You can thank Tom Thumb, who used to frequent the STS forum. This STS fix should solve problems with any contribution that is supposed to display error messages during checkout (including Authroize.Net concolidated for AIM 1.7):

 

Look for this in includes/sts_display_output.php:

 

// Prepend any error/warning messages to $content
 if ($messageStack->size('header') > 0) {
   $template['content'] = $messageStack->output('header') . $template['content'];
 }

 

Add this right after it:

 

////////Start Error Messages - Tom Wojcik
 if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
$messageStack->add('error_message', $HTTP_GET_VARS['error_message']);
$template['content'] =  $messageStack->output('error_message') . $template['content'];
 }
////// End Error Messages

 

Let me know if this works for you.

I think this code would be worth adding to the next version of STS.

Link to comment
Share on other sites

Thanks so much Philip, that worked a treat.

 

I did search for this quite a bit so I hope it wasnt something I overlooked.

 

Incidently if anyones still having problems with the popup (more info) coupon window. It can be fixed by adding this:

 

<script language="JavaScript" type="text/JavaScript">

<!--

function couponpopupWindow(url) {

  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re

sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l

eft=150')

}

//-->

</script>

 

to the STS_template.html file. (Thanks elswhere in the forum for help with this)

 

Many thanks again Philip. Its the community helping like this that makes oscommerce what it is!

 

Cheers

 

Ian

Link to comment
Share on other sites

Hi all,

 

I am having a very strange problem.

 

I have installed STS fine, but I get a double layout on the index page- in other words, the sts default template loads AND oscommerce's default template.

 

Any clues??

Link to comment
Share on other sites

hey i just posted that problem recently, not sure if someone answered, but it's bascially if you set sts_display_output.php to '1' for two views, say normal and template, then you'll see two.

Hi

Thanks for replying. I am not sure i follow though, where would i set it? and would i set it to "0" to get just one output? thanks

Link to comment
Share on other sites

Hi Guys,

 

I am using STS files for Linda contribution and I am finding a problem while trying to use the product_info.php.html.

 

Using the default one included with STS 2.01, I have found that it messes up the options, the text option in particular as well as setting the "buy" URL to something that doesnt add anything to the cart.

 

**********************

Where I had the following code for the text option while not using STS:

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt="" width="1" height="1"></td>

<td width="100%" height="14" class="infoBoxHeading">Line 1:</td>

<td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>

 

</tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">

<tr>

<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>

</tr>

<tr>

<td class="boxText">Up to 64 characters<br><input type="text" name ="id[txt_8]" size="50" maxlength="64" value="more text number 4"></td>

 

</tr>

<tr>

<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>

</tr>

</table>

 

**********************

I now have the following code:

**********************

 

Option Header: Available Options:<br>

<table border="1"><tbody><tr><td>Option Names:</td><td>Option Choices</td></tr>

<tr><td>

Line 1::<br>

 

</td><td>

<select name="id[8]"><option value="0" selected="selected">TEXT</option></select>

 

**********************

Where I have the following code for "add to cart" while not using STS:

**********************

 

<form name="cart_quantity" action="http://domainname.com/store3/product_info.php?products_id=8%7Btxt_8%7Dmore%20text%20number%204&action=add_product" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<tr>

<td align="right" class="main">

 

<snip ...>

 

<input type="hidden" name="products_id" value="8"><input type="image" src="includes/languages/english/images/buttons/button_in_cart.gif" border="0" alt="Add to Cart" title=" Add to Cart "> </td>

</tr>

</table></td>

</tr>

<tr>

<td><br>

</td>

 

</tr>

</table></form></td>

<!-- body_text_eof //-->

**********************

I now have this:

**********************

 

<form name="cart_quantity" action="http://domainname.com/store3/product_info.php?products_id=8%7Btxt_8%7Dmore%20text%20number%204&action=add_product" method="post"><input name="products_id" value="8" type="hidden">

 

<snip ...>

 

AddToCart Button: <input src="includes/languages/english/images/buttons/button_in_cart.gif" alt="Add to Cart" title=" Add to Cart " border="0" type="image"><br>

Using any image (such as the logo) as an AddToCart button: <input src="images/oscommerce.gif" type="image"><br>

<p></p>

</form>

**********************

 

Something is happening in the sts_display_output I fear. It seems like it is not catching all the variables. I used the default STS files for this example.

 

Fellow STS Gurus - Any ideas? I have to use the product_info.php.html to layout the page as the client wants it.

 

Thanks,

 

Deborah

Link to comment
Share on other sites

hey i just posted that problem recently, not sure if someone answered, but it's bascially if you set sts_display_output.php to '1' for two views, say normal and template, then you'll see two.

i tried doing that and still get the same double index page i have normal set to "0" and templ set to '1'

Link to comment
Share on other sites

I am using the extra fields contribution and also sts. I cannot do without sts :) so does anyone know what to do to get the fields to show up in a product_info.php.html file ? I mean is there something that you can use like $extrafields or something :) Any help would be greatly appreciated

Link to comment
Share on other sites

Hi Everyone!

 

I am trying to create customer Header tags for my product_info.php.html pages.

 

I know there are ones that already work such as $productmodel etc, (Which I am using) but I would like to extend this further to create my own. I.e. Product_location, etc.

 

I have followed a post from Brian that said to put some code in the sts_display_output.php form, which works fine for boxes etc, but I only want to create this for fields.

 

Sorry I cant post up the site I am working on, because I dont have a development server yet.

 

Can anyone help me out here?

 

Much appreciated

Please let me know if you need any more info

 

Thanks

 

Chirag

Link to comment
Share on other sites

Erik, i got the same problem. Did you resolve this?

Nope.

This is regarding using templates other than the basic sts_template.php file...

 

I'm facing the same problem. To be clear, is the presence of the substitute templates (e.g. product_info.php.html, index.php.html) in the catalog/includes/sts_templates/ folder all that is required to activate their use?

Edited by greggo
Link to comment
Share on other sites

While I'm still beginning to learn this system (which btw, appears to be extremely nice.....great job Brian) several pages back I found an answer to this...Here's what I did to get things working correctly

 

around line 51 just before the following:

 

/////////////////////////////////////////////
// Allow the ability to turn on/off settings from the URL
// Set values to 0 or 1 as needed
/////////////////////////////////////////////

 

add these 2 lines:

 

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

 

It seems that w/ the last 2 updates, the base script name was not being defined. I added these and all appears to be working correctly

 

hth.

Greg

I only do what my Rice Krispies tell me to do!

Link to comment
Share on other sites

Brian..

 

Here's a suggestion for future versions (maybe this can already be done and I'm just a bonehead and can't figure it out)

 

It would be great to be able to define a top level category template (such as index.php_3.html) and then all subsequent subcats default to the same top level cat template as well as product info pages unless there are specific templates defined for each subcat and product info page.

 

For example: from a stock OSC install. Define your default template (sts_template.html) Develop a template for DVD movies, then all subcats of DVD movies (action, comedy, ....) will all use the overall DVD movie template, and all products will also utilize the same basic structure keeping the standard OSC product info output the stock output. Ideally, I would like to be able to develop a different theme for each top level category without having to develop a template for each subcat and product to match the theme.

 

I hope I explained myself well enough.

 

Thanks again for a wonder contribution. This is great work!!!

Greg

I only do what my Rice Krispies tell me to do!

Link to comment
Share on other sites

I'm just about to start my third client site with STS but I have come across a problem I hope theres a solution to.

 

Is there anyway to place the $content variable inside a iframe??

 

My client would like the content panel (product listing etc) to be the only part of the page that moves. The header and left/right colums need to be static.

 

Has anyone achieved this?

Link to comment
Share on other sites

I created a template file and saved it as sts_template.html. I then changed the name of the included template to sts_template_bak.htm and uploaded my new file. The layout was fine but the stylesheet settings would not apply. What have I missed?

Learning is not attained by chance, it must be sought for with ardor and attended to with diligence.

Link to comment
Share on other sites

I'm facing the same problem. To be clear, is the presence of the substitute templates (e.g. product_info.php.html, index.php.html) in the catalog/includes/sts_templates/ folder all that is required to activate their use?

I had the same problem when using Apache on Windows. Templates in the sts_templates folder were not recognized. The same script worked fine on my online web server, which is a linux/apache system.

 

erik_1099, Nickster and greggo

Are you using Windows or *nix?

Link to comment
Share on other sites

Can anyone help?

I'm setting up my first site using STS and have been able to configure the header and boxes, but can't seem to find out where I configure the elements for the $content tag.

I want to remove the "Welcome Guest...." text and change the look of the main content of the front page.

Can anyone point me in the right direction?

 

Thanks v much

:rolleyes:

Link to comment
Share on other sites

catalog/includes/languages/<yourlanguage>/index.php

 

Scroll the code and make changes to whatever you wish to the body

 

"This is a default setup of the osCommerce project, products shown are for demonstrational purposes, any products purchased will not be delivered nor will the customer be billed. Any information seen on these products is to be treated as fictional"

 

 

To change the "Welcome Guest", open and edit catalog/includes/languages/english.php

Learning is not attained by chance, it must be sought for with ardor and attended to with diligence.

Link to comment
Share on other sites

Thanks daddyrabbit,

This is where the definition of TEXT_GREETING_GUEST is defined, but where do I set in on or off?

 

You can't really turn it on and off. If you don't want anything to appear just delete everything in between the quotes.

I only do what my Rice Krispies tell me to do!

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