Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

STS for the BTS


Recommended Posts

The STS-for-the-BTS is targetted at users that have the BTS pre-installed but, for whatever reason :'( , would rather use the STS to edit or add their template(s).


First (and maybe last ;) ) version, so please beware of bugs and backup before installation!


Please note that I'm not an STS user myself, I really don't know much about the STS, I only copied and pasted its code to make it easy to install on top of the BTSv1.5f (installing on other BTSv1.5, and even older, verions should be quite easy too).


Surely it's possible some or several STS features won't work as they should or even won't work at all (as I don't know how the STS should work I really would not know).


B.t.w. only basic php knowledge is required to do the same, and more, using the BTS as is possible with the STS.


Feedback welcome, but please don't ask me anything about the STS itself!


download link will follow...

Edited by PandA.nl
Link to comment
Share on other sites

I am very interested in this. Has anyone installed it yet?

I have :D


What BTS version do you have?


B.t.w. installing it won't do any harm (and will only cost a minute) since no files are overwritten or changed, only some sts files are added and a special STS template is added next to the others. It won't work as it is on older (<1.5) BTS versions though. With the BTSv1.5a to 1.5e you have to overwrite (or edit) the configure_bts.php file, so you should be safe by backing that one up if needed.

Link to comment
Share on other sites

So the world should get prepared ...

Q: "What template system do you have ?"

A: "Both ! "

:D :)


I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!


Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Hoi Carine!


So the world should get prepared ...

Q: "What template system do you have ?"

A: "Both ! "



And with a little luck it will soon be:


Q: "What template system do you have ?"

A: "All three !"




I am working on a HTML template for the BTS now (w.o. the STS), and the first tests seem promising.


PHP is fun :)

Link to comment
Share on other sites

  • 2 weeks later...

I'm really interesting in youre contribution


I'm trying to integrate it into OSC_CRE.


After a couple of modifications i gat the logo, the items pics for account kart shipping

The folders

Links for account, kart and shipping


and then i gat this error message:


Warning: main(templates/fallback/content/.tpl.php): failed to open stream: No such file or directory in c:\program files\easyphp1-8\www\cre_loaded_osc_6.0_sp1.2_rc2\catalog\templates\STS\main_page.tpl.php on line 77

Fatal error: main(): Failed opening required 'templates/fallback/content/.tpl.php' (include_path='.;C:\PROGRA~1\EASYPH~1\\php\pear\') in c:\program files\easyphp1-8\www\cre_loaded_osc_6.0_sp1.2_rc2\catalog\templates\STS\main_page.tpl.php on line 77


on line 77:


        require (bts_select ('content')); // BTSv1.5


corresponding to:

function bts_template_switch() {
 if ((TEMPLATE_SWITCHING_ALLOWED == 'true') && (isset($_GET['tplDir'])) && is_dir(DIR_WS_TEMPLATES_BASE . basename($_GET['tplDir'])) ) {
   $tplDir = basename($_GET['tplDir']);
 } else {
if ((tep_session_is_registered('tplDir'))&&(TEMPLATE_SWITCHING_ALLOWED == 'true') && is_dir(DIR_WS_TEMPLATES_BASE . basename($_SESSION[tplDir]))){
  $tplDir = basename($_SESSION[tplDir]);	
 if ((ereg('^[[:alnum:]|_|-]+$', $tplDir)) /*&& (is_dir (DIR_WS_TEMPLATES_BASE . $tplDir))*/){
   // 'Input Validated' only allow alfanumeric characters and underscores in template name
   define('DIR_WS_TEMPLATES', DIR_WS_TEMPLATES_BASE . $tplDir . '/' ); 
 } else {
   if($bts_debug === TRUE) echo strip_tags($tplDir) . '<br>';
   exit('Illegal template directory!');
 return $tplDir;





I think it is a problem with this: TEMPLATE_SWITCHING_ALLOWED


If someone could help me :)


Tenshu, Paris

Edited by tenshu
Link to comment
Share on other sites

I think it is this part of the code which go wrong:


case 'content':
   // pages or content (middle area)
   // extra security: added basename()
     if (isset($content_template)) {
       if(is_file(DIR_WS_CONTENT . basename($content_template))) { $path = (DIR_WS_CONTENT . basename($content_template)); } elseif (is_file(DIR_WS_CONTENT_FALLBACK . basename($content_template))) { $path = (DIR_WS_CONTENT_FALLBACK . basename($content_template)); }
       } else {
         if(is_file(DIR_WS_CONTENT . basename($content . '.tpl.php'))) { $path = (DIR_WS_CONTENT . basename($content . '.tpl.php')); } else { $path = (DIR_WS_CONTENT_FALLBACK . $content . '.tpl.php'); }


$content variabale is empty :'(

Edited by tenshu
Link to comment
Share on other sites

$content variabale is empty  :'(

That's strange, I do not know cre very well, but $content has been in use by the BTS since the first version and stayed in use until today.


As far as I know cre is based on the first BTS version, I think some changes have been made but I wouldn't know what the changes are.


Btw, recently I uploaded the "HTML template for the BTS" http://www.oscommerce.com/community/contributions,3127. This also adds a pure HTML template to the BTS. I think it's a much better choice, because it runs a lot faster and is specially written for the BTS (v1.5x). This "STS for the BTS" was just an experiment, but the "HTML template for the BTS" is the one I hope to be able (depending on the amount of spare time I'll have) to develop and support.


Anyhow for both systems, the best way would be to upgrade to the BTSv1.5 first. Not sure if it's easy in this case, maybe the upgrade instructions included in the BTSv1.5 could help?

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.

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