Jump to content
rigadin2

[Contribution] STS v4

Recommended Posts

Hi!

 

I'm trying to install country_state_selector_ajax1.5.5 contrib. I've STS ialready installed.

 

The problem is that the functions of the ajax.js.php are not imported. I've installed this contribution in a clean OsCommerce installation and it works.

Installation instructions says that the way to invoke that functions is:

 

<?php
// +Country-State Selector
require('includes/form_check.js.php');
require('includes/ajax.js.php');
// -Country-State Selector
?>

 

I've that files included in that path.

 

When comparing both source codes i've notice these differences:

 

Working installation - It has the functions of ajax.js.php embebed in the HEAD of create_account.php

Broken installation - It hasn´t the functions of ajax.js.php embebed in the HEAD. By firebug I realize that ajax.js.php file is externally called by create_account.php and even I can see the functions needed to work. but these function are not executed. It gets an error

 

getStates is not defined
[Break on this error] getStates(this.value, "states");

 

 

That is, the function is called and I can see in Firebug, but it's not executed. In STS templates can't be included php code, however the functions included in form_check.js.php, are been executed.

 

What is the proper way to include the functions in the ajax.js.php file and that they'll be executed?

 

Thanks in advance

Share this post


Link to post
Share on other sites

Hi, I would like to add something to my shopping_cart.php page (add to cart page) and also the checkout page. I apologize if this is already mentioned somewhere but I couldn't find it. Can someone please help me on how to do this with STS?

 

Many thanks in advance,

Erik.

Share this post


Link to post
Share on other sites
Hi, I would like to add something to my shopping_cart.php page (add to cart page) and also the checkout page. I apologize if this is already mentioned somewhere but I couldn't find it. Can someone please help me on how to do this with STS?

 

Many thanks in advance,

Erik.

Erik,

Sure, you can do this very easily with STS. You should create a template and use the following naming syntax (as described in the STS User Manual): scriptname.php.html and save it in your template set.

 

For example: checkout__payment.php.html.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
Hey guys,

 

I'm sure I'm forgetting something here - for some reason I think I've been down this road before :blush:

 

I am trying to run php in the template for the home page. I need it to check and see which customer ID is logged in and display a message accordingly. For some reason - the PHP is being ignored.

 

Here is what I am trying to run:

<?php 
// BOF Separate Price per Customer
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
} else {
$customer_group_id = $sppc_customer_group_id;
}
// EOF Separate Price per Customer

if ($customer_group_id != 1) { 
?>
  <h3 align="center">Retail Special!!</h3> 
  <p><strong>Entire month of December - receive 10% off your order (before shipping) by using coupon code RTSLE1208 during checkout!</strong></p> 
 <?php
} 
 ?>

 

The section between BOF and EOF Separate Pricing per Customer is on the catalog/index.php page (as well as all pages in the catalog directory and most of the pages in the other folders). So I technically shouldn't need it on the index template - but gave it a shot since it was ignoring the check for customer_group_id.

 

How do I get this running on my index.php_0.html template?

 

Thanks ;)

 

Tracy,

 

If I understand you correctly, all you are wanting to accomplish is show some text if the user is part of a certain customer group. If that is the case, then try this:

 

<?php 
// BOF Separate Price per Customer
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
} else {
$customer_group_id = $sppc_customer_group_id;
}
// EOF Separate Price per Customer

if ($customer_group_id != 1) { 
echo '<h3 align="center">Retail Special!!</h3> 
  <p><strong>Entire month of December - receive 10% off your order (before shipping) by using coupon code RTSLE1208 during checkout!</strong></p>' 
} 
 ?>

Edited by bkellum

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
Hi!

 

I'm trying to install country_state_selector_ajax1.5.5 contrib. I've STS ialready installed.

 

The problem is that the functions of the ajax.js.php are not imported. I've installed this contribution in a clean OsCommerce installation and it works.

Installation instructions says that the way to invoke that functions is:

 

<?php
// +Country-State Selector
require('includes/form_check.js.php');
require('includes/ajax.js.php');
// -Country-State Selector
?>

 

I've that files included in that path.

 

When comparing both source codes i've notice these differences:

 

Working installation - It has the functions of ajax.js.php embebed in the HEAD of create_account.php

Broken installation - It hasn´t the functions of ajax.js.php embebed in the HEAD. By firebug I realize that ajax.js.php file is externally called by create_account.php and even I can see the functions needed to work. but these function are not executed. It gets an error

 

getStates is not defined
[Break on this error] getStates(this.value, "states");

 

 

That is, the function is called and I can see in Firebug, but it's not executed. In STS templates can't be included php code, however the functions included in form_check.js.php, are been executed.

 

What is the proper way to include the functions in the ajax.js.php file and that they'll be executed?

 

Thanks in advance

 

FYI: PHP code CAN BE INSERTED INTO THE ACTUAL TEMPLATES.

 

There are a couple of different methods of including external files but first you should try to add the file name in the STS Modules in the admin. You would do this by creating a file called sts_form_check_ajx.js.php and upload it to your includes/modules/sts_inc/ folder.

 

The content of sts_form_check_ajax.js.php file should only contain the following:

 

 

<?php



/*



 $Id: sts_form_check_ajax.js.php, v 1.0 12/3/2008 bkellum Exp $

  osCommerce, Open Source E-Commerce Solutions

 [url="http://www.oscommerce.com/"][color="#0000ff"]http://www.oscommerce.com[/color][/url]

 Copyright (c) 2008 osCommerce

Released under the GNU General Public License







STS v4 include module by bkellum ([email="billkellum@soundsgoodpro."][color="#0000ff"][email="billkellum@soundsgoodproDOTcom"]billkellumATsoundsgoodpro[/color][/email]DOTcom[/email]) for [font="Verdana"]country_state_selector_ajax1.5.5 contrib[/font]



*/

$sts->start_capture();



 if ( file_exists(DIR_WS_INCLUDES . '[font="Verdana"]form_check.js.php'[/font]) ) {





require(DIR_WS_INCLUDES . '[font="Verdana"]form_check.js.php'[/font]);

 } 

 if ( file_exists(DIR_WS_INCLUDES . 'ajax[font="Verdana"].js.php'[/font]) ) {





 require(DIR_WS_INCLUDES . '[font="Verdana"]ajax.js.php'[/font]);

 }  

 $sts->stop_capture('header_ajax');

?>

 

Test your site to see if everything is working. If not, add $header_ajax to your template in the head section.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
FYI: PHP code CAN BE INSERTED INTO THE ACTUAL TEMPLATES.

 

There are a couple of different methods of including external files but first you should try to add the file name in the STS Modules in the admin. You would do this by creating a file called sts_form_check_ajx.js.php and upload it to your includes/modules/sts_inc/ folder.

 

The content of sts_form_check_ajax.js.php file should only contain the following:

 

 

<?php



/*



 $Id: sts_form_check_ajax.js.php, v 1.0 12/3/2008 bkellum Exp $

  osCommerce, Open Source E-Commerce Solutions

 [url="http://www.oscommerce.com/"][color="#0000ff"]http://www.oscommerce.com[/color][/url]

 Copyright (c) 2008 osCommerce

Released under the GNU General Public License







STS v4 include module by bkellum ([email="billkellum@soundsgoodpro."][color="#0000ff"][email="billkellum@soundsgoodproDOTcom"]billkellumATsoundsgoodpro[/color][/email]DOTcom[/email]) for [font="Verdana"]country_state_selector_ajax1.5.5 contrib[/font]



*/

$sts->start_capture();



 if ( file_exists(DIR_WS_INCLUDES . '[font="Verdana"]form_check.js.php'[/font]) ) {





require(DIR_WS_INCLUDES . '[font="Verdana"]form_check.js.php'[/font]);

 } 

 if ( file_exists(DIR_WS_INCLUDES . 'ajax[font="Verdana"].js.php'[/font]) ) {





 require(DIR_WS_INCLUDES . '[font="Verdana"]ajax.js.php'[/font]);

 }  

 $sts->stop_capture('header_ajax');

?>

 

Test your site to see if everything is working. If not, add $header_ajax to your template in the head section.

 

 

 

Thanks a lot, Bill, it works perfect now!

Share this post


Link to post
Share on other sites

Thanks Bill - gave it a try and it doesn't recognize customer group. I can login as customer group "1" (which should not see the message) and then navigate back to the homepage - even refresh it - and it still shows me the message. I did try moving the first bit that checks for the customer_group_id to the <head> section of the template as well, but still no dice. That bit of code checking for customer_group_id is directly under the call for application_top on the catalog/index.php page as well - so I'm perplexed as to why the template PHP isn't getting the customer_group_id info :huh:

 

Tracy,

 

If I understand you correctly, all you are wanting to accomplish is show some text if the user is part of a certain customer group. If that is the case, then try this:

 

<?php 
// BOF Separate Price per Customer
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
} else {
$customer_group_id = $sppc_customer_group_id;
}
// EOF Separate Price per Customer

if ($customer_group_id != 1) { 
echo '<h3 align="center">Retail Special!!</h3> 
  <p><strong>Entire month of December - receive 10% off your order (before shipping) by using coupon code RTSLE1208 during checkout!</strong></p>' 
} 
 ?>


~Tracy
 

Share this post


Link to post
Share on other sites

Hi All!

Sorry to barge in like this here... Just wondered if anyone has made an attempt at a "separate template per customer"...

//Micke

Share this post


Link to post
Share on other sites
Hi All!

Sorry to barge in like this here... Just wondered if anyone has made an attempt at a "separate template per customer"...

//Micke

 

Yes, this can be done.

Create a template for each customer that you want to have a specific template for and name them: template_1.html for customer id 1, template_2.html for ID 2 and so on.

 

You would want to add something like the following code to your sts_template.html file (only this code):

<?php
Global $customer_id;
if (tep_session_is_registered('customer_id')) {
include (STS_TEMPLATE_DIR.'template_'.customer_id.'.html');

} else {
include (STS_TEMPLATE_DIR.'index.php.html');
  }
?>

I have not tested the above so you may have to play around with it. There are other ways of doing this as well.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
Happy Memorial's Day!

 

I have a quick question. I know with v.3 you were able to add the xsell mod to the sts_output_code.php file using this code:

$sts_block_name = 'xsell';
require(STS_START_CAPTURE);
require(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
require(STS_STOP_CAPTURE);
$template['xsell'] = $sts_block['xsell'];

 

 

When I used it with this version it threw everything off and I got this message:

 

 

Do I need to make a change somewhere else as well?

 

Quoting an old post, I know.

I tried to add the XSell contrib to STS but can't find the file mentioned in this post, I checked the document and said I needed to add it to sts_user_code.php in the sts_inc folder, but I end up with an error:

 

Warning: require(STS_START_CAPTURE) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\includes\modules\sts_inc\sts_user_code.php on line 34

Fatal error: require() [function.require]: Failed opening required 'STS_START_CAPTURE' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\includes\modules\sts_inc\sts_user_code.php on line 34

 

The XSell contrib doesnt mention anything about STS ((

 

btw

The problems I had with the add-to-cart not working been sold. The $startform$ was somehow caught in the header tag which made it inactive.

Edited by Toyz

Share this post


Link to post
Share on other sites
Quoting an old post, I know.

I tried to add the XSell contrib to STS but can't find the file mentioned in this post, I checked the document and said I needed to add it to sts_user_code.php in the sts_inc folder, but I end up with an error:

 

Warning: require(STS_START_CAPTURE) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\includes\modules\sts_inc\sts_user_code.php on line 34

Fatal error: require() [function.require]: Failed opening required 'STS_START_CAPTURE' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\includes\modules\sts_inc\sts_user_code.php on line 34

 

The XSell contrib doesnt mention anything about STS ((

 

btw

The problems I had with the add-to-cart not working been sold. The $startform$ was somehow caught in the header tag which made it inactive.

 

 

/* xsell box */
  $sts->start_capture();
  require(DIR_WS_MODULES . 'xsell_products.php');
  $sts->stop_capture('xsell', 'box');


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hi,

As a complete PHP-nitwit I've tried to install STSv4.

I can see the 4 modules for STS in my Administrator. I even see an install-button. But however I click this button, nothing will happen.

You might think that if I see the 4 modules, there's no need to click the install-button?

Yes, I can see the modules. The system seems to be changeable, however I cannot activate the Default into yes.

The thing does not work, and I cannot figure out what went wrong.

Can anybody help, please?

 

the website is located at www.mooitijdloos.nl/web

 

 

I haven't got the faintest idea about PHP, therefore I'm hoping I can get this STS working, so I can switch back to good old HTML....

Many thanks in advance!

Share this post


Link to post
Share on other sites
You may have an older version of osCommerce that was affected by the modules refresh bug. See the following link: http://forums.oscommerce.com/index.php?s=&...t&p=1028560

 

Thank you Bill,

With this I was able to change the default into 'yes'. But it seems that nothing else happened. Shouldn't the looks/functions in my manager have to change now that STS is enabled?

My manager still looks the same; I do not see any changes or extra functions appear.

Very strange...

Does the installation have another bug I should know?

Thanks again!

Share this post


Link to post
Share on other sites
Thank you Bill,

With this I was able to change the default into 'yes'. But it seems that nothing else happened. Shouldn't the looks/functions in my manager have to change now that STS is enabled?

My manager still looks the same; I do not see any changes or extra functions appear.

Very strange...

Does the installation have another bug I should know?

Thanks again!

 

Nicole,

 

Keep in mind that the bug that I referenced to was NOT a STS bug, but rather a bug in an older version of osCommerce (060817). The fix was added to the newer versions of osCommerce (RC1, RC2 and RC2a).

 

Follow the documents in the "DOCS" folder that came with the STS contribution to make sure you have everything setup correctly. The default setting are fine except for the template folder. Change the template folder to "full" and then play around with the templates in that folder to see the changes on the frontend (what your customers will see).


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
Nicole,

 

Keep in mind that the bug that I referenced to was NOT a STS bug, but rather a bug in an older version of osCommerce (060817). The fix was added to the newer versions of osCommerce (RC1, RC2 and RC2a).

 

Follow the documents in the "DOCS" folder that came with the STS contribution to make sure you have everything setup correctly. The default setting are fine except for the template folder. Change the template folder to "full" and then play around with the templates in that folder to see the changes on the frontend (what your customers will see).

 

Bill,

Thanks again. But I don't seem to get it right. I have followed everything several times now... Still, my customers see the following: Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.

 

I must be an idiot not to get it right...

And I do not know what to do about this, since I have no clue whatsoever on how to enable anything with PHP.

:(

 

Sorry to be such a waste on your time. Still hope you can endulge me my stupidity and help once more...

Share this post


Link to post
Share on other sites

If you aren't familiar with working in your .htaccess file you can call your hosting company and ask them if they can turn on Register Globals. This is a server setting. If they will not turn it on (some won't for security reasons) then there is a contribution you can install to run osC on a server with Register Globals turned off.

 

PS: This has nothing to do with STS.

 

Bill,

Thanks again. But I don't seem to get it right. I have followed everything several times now... Still, my customers see the following: Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.

 

I must be an idiot not to get it right...

And I do not know what to do about this, since I have no clue whatsoever on how to enable anything with PHP.

:(

 

Sorry to be such a waste on your time. Still hope you can endulge me my stupidity and help once more...

Edited by TracyS

~Tracy
 

Share this post


Link to post
Share on other sites

Ok - I'm stuck again - LOL

 

I finally figured out that my login.php was not allowing customers to log in to existing accounts if the session ID was in the URL because I had taken the following block of code out of the login.php file:

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

 

Unfortunately, when I put that block of code back into the file, it causes me to have two such blocks of code upon viewing the source of login.php from the browser. My guess is because the template is calling in the $htmlparams on top of the above being in the login.php file.

 

Any thoughts on how I can have the above without having a duplicate set of htmlparams ?


~Tracy
 

Share this post


Link to post
Share on other sites
If you aren't familiar with working in your .htaccess file you can call your hosting company and ask them if they can turn on Register Globals. This is a server setting. If they will not turn it on (some won't for security reasons) then there is a contribution you can install to run osC on a server with Register Globals turned off.

 

PS: This has nothing to do with STS.

 

Thank you very much Tracy! I have mailed my provider. Hopefully that will do the trick.

I'm sorry I cannot help you with your problem... [stupid remark-mode-on]: may be the echo in your code? ;)

Share this post


Link to post
Share on other sites

for a new site I am designing using STS, I want to move the page heading into the blue line above. So in this example, move "Specials This Month" into the blue line above and delete the corny image all together.

 

How can I go about this?

 

As well, how can I remove the border on the categories box on the left?

 

Thanks,

Dale

 

rockthewatch.gif

Share this post


Link to post
Share on other sites

i don't know if this has been asked but is their a way to edit or convert a standard OSC template to be used with STS system i am using the pre packages MNK Edition of osc and it is full of mods like OSCmax. i just dont know if i ctill can use my old template i would realy like to be able to because i paid for it not to long ago

 

thanks

jeff

Share this post


Link to post
Share on other sites

i don't know if this has been asked but is their a way to edit or convert a standard OSC template to be used with STS system i am using the pre packages MNK Edition of osc and it is full of mods like OSCmax. i just dont know if i ctill can use my old template i would realy like to be able to because i paid for it not to long ago

 

thanks

jeff

Share this post


Link to post
Share on other sites
i don't know if this has been asked but is their a way to edit or convert a standard OSC template to be used with STS system i am using the pre packages MNK Edition of osc and it is full of mods like OSCmax. i just dont know if i ctill can use my old template i would realy like to be able to because i paid for it not to long ago

 

thanks

jeff

 

Yes, see the following post in this thread:

http://forums.oscommerce.com/index.php?sho...p;#entry1131089


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Sorry this was originally posted in templates and images can a mod delete the orignal please.

STS - HTC php pages in red under text control

 

Hi Bill

I am still trying to get my head around the google dup content issues on our site and want to drill down the HTC side of things. What I have noticed and to be honest never really picked up on it, is that all my php pages like index, reviews, whats new are all in red instead of black text in text control. The only page on the text control admin in black is my default title entry, description and key words. However index shows in red but the tags are populated OK, this is the only red page that will properley populate the header tags.

 

I installed your complete package with htc rather than hack it. Have I missed something out.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×