Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Using v3.00 Beta 2 from Jul 31 2005 by DiamonSea

 

While working on integrating the Authorize Net AIM module (GPL) I ran into what appears to be a bug with STS. Please help me confirm this bug or, if possible, point me in the right direction.

 

After clicking to confirm my order on the checkout_confirmation.php page, I am sent (correctly) back to the checkout_payment.php page due to an error processing the credit card. The problem is, the error_message text which is included in the URL (GET params) is not displayed in the $content section and not available (as best I can tell) from an STS variable.

 

I looked at the STS variables and the $sysmsgs looked like it might work but it didn't. I then looked closer and saw this code in sts_display_output.php around line# 313 that should stick the error_message at the top of the $content area:

 

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

 

Since this wasn't working as expected, I did some research in header.php. Looks like all the configurable oscommerce warning checks do get put into the messageStack if there's a problem. After those checks, there is code that checks the GET parameters for error_message and info_message then creates some HTML if they exist. These message are not, however, added to messageStack. That's where the bug with STS is I think. To fix this, I added putting the error_message and info_message into the messageStack with this code in header.php:

 

<?php
 if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
  $messageStack->add('header', htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])), 'error');
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerError">
<td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>
 </tr>
</table>
<?php
 }

 if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
  $messageStack->add('header', htmlspecialchars(urldecode($HTTP_GET_VARS['info_message'])), 'info');
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerInfo">
<td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>
 </tr>
</table>

 

Is there a way that this should have been handled in sts_display_output.html via one of the STS variables?

 

Nathan

Link to comment
Share on other sites

Hi there, im using the sts contrib which is excelent and i need to configure the '$content' (the main content of the page) variable when its displayed on my site. I need to change the amount of products that gets displayed under 'New Products For ...' and also only have 2 column of products listed instead of 3!

 

I also need to know how to change the table size that displays the product info?

 

Just wonderin if you know how this is done??

 

Thanks in advance

Link to comment
Share on other sites

Hi there, im using the sts contrib which is excelent and i need to configure the '$content' (the main content of the page) variable when its displayed on my site. I need to change the amount of products that gets displayed under 'New Products For ...' and also only have 2 column of products listed instead of 3!

 

I also need to know how to change the table size that displays the product info?

 

Just wonderin if you know how this is done??

 

Thanks in advance

 

The "New Products for..." can be changed directly via your Admin CP. It's under configuration, and I believe it is under Maximum Values.

 

 

You can resize the product info table by opening up mysite/product_info.php.html .

Link to comment
Share on other sites

Hey guys... I have setup a store but I seem to be having a major problem with the products actually being added to the cart. If you are browsing through the search list and click 'buy now' it will add it to cart. But once you actually click on the product to display the product_info.php.html template page, when you click on "add to cart" it sends you to the cart, but the cart says that it is empty. Is there some code missing? Or a bug which I don't know about. A fast reply would be much appreciated!

Link to comment
Share on other sites

I haven't worked with this, but maybe try index.php_48_0.html ? It seems like it would work, but again, I haven't worked with different templates for individual pages.

 

Thanks Civic but that didn't seem to work....anyone else have an idea or solution for this. I am in need of some major help!

Link to comment
Share on other sites

Don't know if this is an STS issue or not, but would someone please have a look at this work-in-progress and see if you can figure out what's going on?

 

When you put something in the shopping cart, the right side of the first (left) column gets partially blocked, at least in Windows Explorer. The cents portion of the total amount in the cart (currently $0.00 because all the test items have a zero price) doesn't totally display--as thought the next column to the right is slightly "on top of" the first column.

 

Thanks in advice for any ideas.

 

Mike

Mike in Key West

Link to comment
Share on other sites

HELP PLEASE.....

 

Hi all,

 

I have created my first OSC Site using the STS Contribution (Excellent Contribution:thumbsup:), it all works fine.

What I would really like to be able todo is list my Products in the Content area with:

 

Image - Brief Description - Price - Quantity(they would like to order) - Add to Cart

 

and I would like this to display on the index page, enabling me to remove the catagory menu from the left.

 

I hope this makes sense :huh:

 

 

I have been searching the whole Forum/Site for any similar requests or a solution for several days now, but with no luck

 

If anybody has any suggestions, please let me know.

 

 

Thanks in advance

 

 

 

Lee

Link to comment
Share on other sites

Does Coolmenu work with STS, I have both installed, first STS which was all fine then coolmenus, which doesn't work. There is no change to my catalogue box at all. I have checked and re-checked my insallation.

 

can any body help.

 

thanks

Link to comment
Share on other sites

I'm not sure if anyone has had this problem but I'm experiencing it and can't figure it out.

 

I have my website done but wanted to make some changes to the sts_template file. I open it and make the changes and upload and then, all of the sudden, the text for the links throughout the whole page are HUGE.

 

Anyone know what the problem could be?

Link to comment
Share on other sites

I'm using STS 3 Beta 2 and it works like a charm. However, I would like to implement a contribution for search engine optimization / better URLs and I'm thinking of "Search Engine Friendly URL" or "Ultimate SEO URLs".

 

Can any one point me in the right direction, does one of these or both work with STS and if so, how is it done?

 

I need to implement that very very soon, possibly tomorrw. Please reply if you know how to do. Thanks!!

Link to comment
Share on other sites

I'm successfully using a great contribution called Actual Price in Pull Down on an STS site where I didn't have to modify the Product Info page. The mod changes the attribute pricing drop down so that it says (for example) "Large $35" instead of "Large +$10".

 

But when I try to use the Actual Price in Pull Down contribution on another site, on a page where I'm using STS to display the price drop down (using the $optionchoices tag), it still displays (again, for example) "Large +$10".

 

I suspect this is because STS is handling the displaying of the drop down.

 

Does anyone have a suggestion about how to make this work? I'm using STS-3_00b2.

 

Thanks a lot.

Mike in Key West

Link to comment
Share on other sites

Hello all!

 

I am having a problem combining STS with FastEasyCheckout. When integrating FEC with STS I am having problems with ANY credit card module registering properly. The data is not being set correctly. It is being passed to all pages and I have worked with some code for "checkout_confirmation.php" that is needed with FEC to deal with some of the credit card modules when having this problem,

//fast easy checkout start
foreach ($_SESSION as $key => $val) {
// print $key.' => '.$val.' - ';print_r($val);echo "<br>";
$HTTP_POST_VARS[$key] = $val;

}
// first two lines are for ccgv
//tep_session_unregister('gv_redeem_code');
//tep_session_unregister('credit_covers');
tep_session_unregister('payment');
tep_session_unregister('cc_number');
tep_session_unregister('cc_expires_month');
tep_session_unregister('cc_expires_year');
tep_session_unregister('cc_owner');
tep_session_unregister('cc_checkcode');
tep_session_unregister('authorizenet_cc_number');
tep_session_unregister('authorizenet_cc_expires_month');
tep_session_unregister('authorizenet_cc_expires_year');
tep_session_unregister('authorizenet_cc_owner');
//fast easy checkout end

 

which needs to be added after

require('includes/application_top.php');

in checkout_confirmation.php. But is it has been to no avail. I have been fighting with this for a week or 2 and am about to give up on it.

 

STS seems to capture the code between

require('includes/application_top.php');

and the "head" tag, which seems to be creating the issue, but I am not sure. I have tried moving the code around the file, but nothing has worked for me so far. This is being done on a VERY heavily modified package, but all is well until I add STS, so I know that whatever is happening is connected to this particular contrib.

 

Any one have any suggestions on this?

I appreciate any and all suggestions, Craig :)

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: [email protected]

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Link to comment
Share on other sites

Hello all,

 

After viewing each of the files on the STS contribution page, one is left to wonder which link holds the latest and greatest version and not just an update or modification.

 

On a new installation of OsCommerce, which file should one download that includes the core files and installation instructions?

 

Thanks,

 

Bill

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

Hello STS users!

 

I have just posted a new revision of STS: version 4.1 .

 

This is a major release of this excellent contribution, the code has been changed quite much from STS v2 or v3 and requires that you first uninstall your previous version

before installing this one.

 

The main advantages of this release are:

 

- Less code and several improvements, so should be faster..

- All templates are in their own folder, selection of folder is made in admin. Folder choice can be overwritten from URL for testing purposes.

- Use of modules for code specific to some pages (product_info.php for example), parameters accessible from admin (like shipping, payment or order total modules).

- Write own module for checkout, create account or else: easy to share like payment modules.

- Switch STS on/off from admin. When off, you will see your store like it was before STS installation.

- Debug mode still available from URL, but with a code defined by admin => works like a password.

- If STS is off, using debug mode from URL will turn it on only for you. Useful for testing without disturbing visitors.

- Ready for product page caching. Not implemented yet, but doors are open.

- Possibility to avoid sorting a big array (speed optimization), by adding a special char at the end of the placeholders, for example "$languages" becomes "$languages#". (Can be different on each template).

- Installation is still very easy, modifications only at beginning and end of some files.

- Possibility to have a template for header/columns/footer like always + a template for the content area. Useful with product_info: main template comes from the category where the product is, while the content itself is defined according to the product_info template.

- All boxes are now also available separately, no need to show specials if you want to show tell a friend box, no need to show best sellers if you want to show product notifications.

- Boxes that should not appear on certain pages will have an empty tag => customer won't see the placeholder name (try, in v2.x, $banner without having banner or $languages in checkout process page, you'll see what I mean.

- Possibility to write php script in the templates, like in STS v3.

- Compatible with templates made for STS v2 or v3

- Compatible with templates made for STS PLUS (STS v4.1 is based on STS PLUS 4.0.7).

 

 

STS v4.1 is based on STS PLUS v4.0.7. STS PLUS itself is based on STS v3 but with so many changes in the code that I released it as a separate contribution.

Now, after positive feedback from the community and the blessing from the original author, Brian (great contribution, thanks Brian!), the code is back to where it belongs: STS.

 

I have created a new support thread for STS4, please post only problems related to STS v4, not to previous versions: http://www.oscommerce.com/forums/index.php?showtopic=204381

 

- Rigadin

Link to comment
Share on other sites

Ok I've been trying to figure this out but it just doesn't seem to want to work!! sts runs great but how do I specify a template for a single page that has only one value in the cPath.

 

For instance if my URL is - index.php?cPath=48 my template would be index.php_48.html which does work for that category BUT it also applies that specific template to ANY of the other pages that are within that category. In other words index.php?cPath=48_50 uses the template that should ony be specified for cPath=48 ONLY.

 

I've placed an index.php.html within the sts templates dir but that doesn't work. Anybody out there have a solution for this?

 

Thanks in advance.

 

RobD,

 

Did you get an answer for this or work out how to do it?

Link to comment
Share on other sites

Does Coolmenu work with STS, I have both installed, first STS which was all fine then coolmenus, which doesn't work. There is no change to my catalogue box at all. I have checked and re-checked my insallation.

 

can any body help.

 

thanks

 

 

Dont know, but i use chemos css category menu which IMHO is better as you can do whatever you want with the css..

Link to comment
Share on other sites

I'm not sure if anyone has had this problem but I'm experiencing it and can't figure it out.

 

I have my website done but wanted to make some changes to the sts_template file. I open it and make the changes and upload and then, all of the sudden, the text for the links throughout the whole page are HUGE.

 

Anyone know what the problem could be?

 

Have you ensured that you have kept the correct path to the stylesheet in your new file?

Link to comment
Share on other sites

I'm using STS 3 Beta 2 and it works like a charm. However, I would like to implement a contribution for search engine optimization / better URLs and I'm thinking of "Search Engine Friendly URL" or "Ultimate SEO URLs".

 

Can any one point me in the right direction, does one of these or both work with STS and if so, how is it done?

 

I need to implement that very very soon, possibly tomorrw. Please reply if you know how to do. Thanks!!

 

 

Ultimate SEO URLS works, there is a little work to be done, whereby in the instructions it tells you to update the files TITLE tags, you shouldnt do that you just comment them out and add the code suggested for that part to the sts_output file where the title tags are

Link to comment
Share on other sites

Ok having tried o help some of you Im looking for some help!

 

I want to add the coupons box from the coupons by Ingo contribution:

 

So I have added $coupons_box to my sts_template

 

 

and added:

 

//BEGIN Coupons box

$sts_block_name = 'coupons_box';

require(STS_START_CAPTURE);

require(DIR_WS_BOXES . 'coupon.php');

require(STS_STOP_CAPTURE);

$template['coupons_box'] = strip_unwanted_tags($sts_block['coupons_box'], 'coupons_box');

//END Coupons box

 

 

to sts_user_code but it doesnt appear, the template obviously tries to read it as I can see it in debug mode, but there is nothing populated within it?

Link to comment
Share on other sites

Ok having tried o help some of you Im looking for some help!

 

I want to add the coupons box from the coupons by Ingo contribution:

 

So I have added $coupons_box to my sts_template

and added:

 

//BEGIN Coupons box

$sts_block_name = 'coupons_box';

require(STS_START_CAPTURE);

require(DIR_WS_BOXES . 'coupon.php');

require(STS_STOP_CAPTURE);

$template['coupons_box'] = strip_unwanted_tags($sts_block['coupons_box'], 'coupons_box');

//END Coupons box

 

 

to sts_user_code but it doesnt appear, the template obviously tries to read it as I can see it in debug mode, but there is nothing populated within it?

 

Fixed it dumb ass user mode off - I spent all night trying to fix something that wasnt broken! I forgot to click the install button.

Link to comment
Share on other sites

I'm trying to incorporate the master/slave contrib with STS and can't get non-master products to appear without the master/slave quantity box. I could do this with a new template page specifically for my master products - is there is an 'easy' way to make an individual page template?

Link to comment
Share on other sites

I'm trying to incorporate the master/slave contrib with STS and can't get non-master products to appear without the master/slave quantity box. I could do this with a new template page specifically for my master products - is there is an 'easy' way to make an individual page template?

 

I've managed to work out how to do this but in regards to STS and Master Products (and I'm assuming this is an STS issue not a MP problem, but feel free to correct me if I'm wrong!) - how do I 'hide' the slave product listings? I tick the 'hide product' box - but it doesn't hide.

Edited by mpm
Link to comment
Share on other sites

On my sts template, what other file should I change to remove the image from the page title-my code is below to save time-the problem I'm having is when you are on the index page their is an image that isn't called to here - it is: table_background_default.gif I notice similar images on the other pages, but I can't figure out where to remove them- they lie with in $content .... Thanks in advance!

 

<body bgcolor=#6633cc>

<table width=780 bgcolor=#ffffff border=0 align="center">

<tr>

<td>

<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="780" HEIGHT="117" background=pipper.gif>

<TR><td colspan=5></td>

<TD ROWSPAN="1" COLSPAN="2" ><div align="right"><font size="1" face="Arial, Helvetica, sans-serif" color=#6633cc>$myaccountlogoff<BR>$cartcontents<BR>$checkout<BR><BR>$searchbox</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="9" align="center"><a href="index.php" class="lo">

HOME</a>

 

 

<A HREF="new_products.php" class=lo>WHAT'S NEW</A>

 

<A HREF="" class=lo>COLLECTIBLES</A>

 

<A HREF="http://3" class=lo>BY ARTIST</A>

 

<A HREF="http://4" class=lo>BY STYLE</A>

 

<A HREF="http://5." class=lo>FREQUENTLY ASKED QUESTIONS</A></TD>

 

</td>

</TR>

</TABLE>

<table width="780" border="0" cellpadding="0" cellspacing="0">

<tr>

<td width="125" valign="top" bgcolor="#85aebc"> <table width="100%">

<tr>

<td width=125><p><font size="1" face="Arial, Helvetica, sans-serif" color="white">$categorybox</font></p>

<font size="1" face="Arial, Helvetica, sans-serif">$manufacturerbox</font>

<p><font size="1" face="Arial, Helvetica, sans-serif" color="white">$cartbox</font></p>

 

<p><font size="1" face="Arial, Helvetica, sans-serif" color="white">$maninfobox</font></p>

 

<p><font size="1" face="Arial, Helvetica, sans-serif" color="white">$reviewsbox</font></p>

 

<p><font size="1" face="Arial, Helvetica, sans-serif" color="white">$bestsellersbox</font></p>

 

<p><font size="1" face="Arial, Helvetica, sans-serif" color="white">$specialfriendbox</font></p>

<p align=center><font size="1" face="Arial, Helvetica, sans-serif">$catmenu</font></p></td>

 

</tr>

</table>

</td>

<td valign="top" bgcolor="#c1d6dd" >$content

</td>

</tr>

</table>

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

<tr>

<td><div align="center"><font size="1" face="Arial, Helvetica, sans-serif"><font size="1" face="Arial, Helvetica, sans-serif">$informationbox <BR> $orderhistorybox</font><hr color=#6633cc>

Link to comment
Share on other sites

On my sts template, what other file should I change to remove the image from the page title-my code is below to save time-the problem I'm having is when you are on the index page their is an image that isn't called to here - it is: table_background_default.gif I notice similar images on the other pages, but I can't figure out where to remove them- they lie with in $content .... Thanks in advance!
The easiest way for you to do this would be to use the following contribution:

 

Remove Default Images (click for direct link to download)

 

Here is a set of images that replace the original pictures with a single transparent pixel in .gif - as far as your customers are concerned, the pics don't exist!

 

Simple to install - saves you the effort of copying and renaming 28 image files. The install will rename your default images so that you still have them for archive use.

 

Hope this helps,

 

Bill Kellum

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