Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

I?m sorry for being in s loop with this question, but how can I display the regular price with a line thru when there?s a special price in the product page.

everything but that is running fine with sts on my site....

Thanks again for any help

Link to comment
Share on other sites

OK, open up sts_product_info.php and change

 

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
 $template['specialprice'] = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']));
} else {
 $template['specialprice'] = '';
}

 

to

 

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
 $template['specialprice'] = "<s>" . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . "</s>";
} else {
 $template['specialprice'] = '';
}

Link to comment
Share on other sites

Hello:

 

I just installed STS on a brand new install of OSC. I checked to see if it was working and then I followed the instructions for the "easy" install.

 

I got this error:

 

Warning: mysql_connect(): Access denied for user: 'tlc_osc1@localhost' (Using password: YES) in /home/tlc/public_html/catalog/includes/functions/database.php on line 19

Unable to connect to database server!

 

HELP!

 

Ronda

did you copy the few lines into your existing configure.php file or just replace with the one supplied in the STS install pack?? If the latter, then this is why. You only need to copy/paste the final few lines (as highlighted by the comments bit).

I used my original confiure file and just copied the extra lines. That's why I don't understand the error.

 

Thanks for your help,

Ronda

Link to comment
Share on other sites

I used my original confiure file and just copied the extra lines. That's why I don't understand the error.

 

Thanks for your help,

Ronda

Double check your database settings in your configure.php file as that error message always shows up when something is not matching.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Thanks Spike, based on your help this is what I ended up with:

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
 $template['regularprice'] = "<s>".$currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))."</s>";
 $template['specialprice'] = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']));
} else {
 $template['specialprice'] = '';
}

 

Thanks and Thanks again

Link to comment
Share on other sites

brian can you help me with the line thru over the regular price when there?s a special price?

On line 112 of sts_product_info.php (after the special price calculations), insert:

 

if ($template['productspecialprice'] != "") {
 $template['productregularprice'] = "<strikeout>$template['productregularprice']</strikeout>";
}

 

See if that helps.

 

- Brian

 

(Code off top of head, not tested yet)

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

Posted this in its own topic, but it seems this is where the action is.

Everything was working great and now I'm not sure what I've done to cause the message below when I click on the link for the product detail. This seems to be the only snag, and I double checked for correct sts code in the configure file.

 

Warning: main(includes/sts_product_info.php): failed to open stream: No such file or directory in /blah/blah/blah/spiceswest.com/httpdocs/catalog/includes/sts_display_output.php on line 132

 

Fatal error: main(): Failed opening required 'includes/sts_product_info.php' (include_path='.:/usr/lib/php4/php') in /blah/blah/blah/spiceswest.com/httpdocs/catalog/includes/sts_display_output.php on line 132

 

am using just one main template, not a sepaprate one for products or categories.

Any hlep is appreciated. Thanks so much.

Brooke

<_<

Link to comment
Share on other sites

STS & PayPal_Shopping_Cart_IPN_v2.6,

 

I tried installing the new Paypal there are afew new additions to the code in account_history_info.php, checkout_success.php. which breaks the STS. I would assume that there would need to be new mods to the STS for this new paypal_ipn.

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

an example.

checkout_success.php,

old: paypal_reset_checkout_cart_session();

new: paypal_order::reset_checkout_cart_session();

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

PayPal_Shopping_Cart_IPN_v2.4 works ok, do not go higher unless you can fix it, it is beyond me to do it.

 

If anybody can get it to work please let me know

 

Jimmy

I'm not a coder just a splicer.

Link to comment
Share on other sites

STS & PayPal_Shopping_Cart_IPN_v2.6,

STS & PayPal_Shopping_Cart_IPN_v2.6,

 

Anybody working on this.

 

At checkout processs I get

 

Fatal error: Call to a member function on a non-object in \catalog\includes\sts_display_output.php on line 200

 

Any thoughts ?

I'm not a coder just a splicer.

Link to comment
Share on other sites

Shure you can, just make a table and set the background of the cell to the graphic you want then place the $***** in it. it may need some tweaking if you have an infobox where the menu expands. Look at my site the left menu is a table filled with color, then look at "Top>>Catalog" an the graphics on the right of it. they are all in a table and the gunmetal finish isset to the table background.

 

Jimmy

I'm not a coder just a splicer.

Link to comment
Share on other sites

Hi jimmy,

 

I know hot to set a background with a color in a table, I know how to insert a picture like background for header table... But, with STS, I don't know how to insert a pic like background for column left or right. Do you know what I mean?

 

Thx

 

Fab

Link to comment
Share on other sites

You are just going th have to play with the sts_template.html table properties using your html editor ( this is very basic html ) like golive or frontpage, creat a table inside a table. If you are looking on how to code it, I can't I do it graphicly in Golive.

Edited by RI Downlink

I'm not a coder just a splicer.

Link to comment
Share on other sites

STS & PayPal_Shopping_Cart_IPN_v2.6

 

 

Is anybody looking into the problems with this contrib using the STS, or does this new file structure for PayPal mod conforms more to MS3 which the current version 2.01 may not work with yet, I not shure.

 

I don't know if we need to put aditional start & stop captures in files located @

catalog\includes\modules\payment\paypal

 

application_top.inc.php

application_bottom.inc.php

 

 

Thanks

Edited by RI Downlink

I'm not a coder just a splicer.

Link to comment
Share on other sites

Did someone already find a solution against the incompatibility between the simple template system (STS) and the Credit Class & Gift Voucher contribution? The problem is, if both are installed no more confirmation messages are indicated.

Link to comment
Share on other sites

I'm trying to get a search box to show up anywhere on a template page. This is the html code I have, but the problem is that I keep losing the session ID when the search results are shown. How can I pass the session ID to the search results page? Can I somehow use the "$sid" command included with STS?

 

<form name="quick_find" action="advanced_search_result.php" value="$sid" method="get">
          Search
    <input type="text" name="keywords" value="Type word(s) and press enter" onFocus="form.keywords.value='';" size="27" maxlength="35" style="" >
    <input type="hidden" name="osCsid" value=" ">
     </form>

Link to comment
Share on other sites

Ok, I just solved my own problem. This is how to add a search box anywhere on an html template:

 

In sts_display_output.php, find the following line of code:

 

$template['sid'] =  tep_session_name() . '=' . tep_session_id();

 

Add this code below it:

 

$template['id'] = tep_session_id();

 

Now add the following html anywhere on your html templates where you'd like a search form (to replace the generic search box):

 

<form name="quick_find" action="advanced_search_result.php" method="get">
          Search
    <input type="text" name="keywords" value="Type word(s) and press enter" onFocus="form.keywords.value='';" size="27" maxlength="35" style="" >
 <input type="hidden" name="osCsid" value="$id">
 </form>

 

Have fun!

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