Jump to content
rigadin2

[Contribution] STS v4

Recommended Posts

I would like to be proven wrong about that too. i'm not sure what you are refering to about not being able to use STS with an index.html in the root directory. Have you tried it?

 

As far as STS not supporting an index.php.html template without creating separate templates for all other pages. I know that is kinda of a pain - especially since there is no clear mention of it in the documentation. It would also be handy to have a list of all the necessary templates (default catalog file names) that one would have to create if they choose to use an index.php.html.

 

hi,

A great contribution and appreciate sharing your effort.

 

is this the same thing for default.php.html? I am fairly new to osc and wasn't quite sure about index.php so i used the default mode. wanted a separate look just on the top page so i created default.php.html. everything seemed to be ok until i switched languages, it showed content of the includes/"language"/default.php and not from the default.php.html.

 

that is:

http://mydomain/default.php -> ok.

http://mydomain/default.php/language/ja -> not using default.php.html or

http://mydomain/default.php/language/en -> not using default.php.html

 

before i edited the default.php directory which worked but i have to use the same template. also sts_template.html works just fine for all pages.

 

btw i have tweaked it to work on MS1 which is currently the supported japanese version. i know it's not supported version but i would very much apprecaite for a pointer.

Share this post


Link to post
Share on other sites
There is a new index module on the contribution page. Changelog is as follow:

 

Changes:

- BUG CORRECTED: index.php_0.html template for main page was not working.

- ADDED: new module parameter to set in admin.

=> You now have the choice to look or not for templates of parent categories, if there is no template for the current category.

 

No need to create a template for each category if you want to have a template specific to the home page.

 

@rodrico: you have not copied all the STS files to your store, check your installation again, some files are missing.

 

- Rigadin

 

 

This seems to work great. Thanks alot!

Share this post


Link to post
Share on other sites

hi all,

i love that contribution, cause it?s simple great.

but: has anybody a idea how i can integrate ultrapics up to 6 images in a product content template?

i think i will have to define variables for all of them and feed in the correct query for the product id, but i am not very good in php and can not figure out how to manage it.

 

can please anybody help with this? maybe somebody did it already?

 

thanks,

Armin

Share this post


Link to post
Share on other sites

here is a tricky question for all the php gurus out there:

 

i posted earlier on the subject of integrating UltraPics contribution into a product_info.php.html template.

here is how far i came:

 

i copied what MaxiDVD changes for UltraPics in the original product_info.php file to the one that comes with sts 4.

replacing this:

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

with the right query for UltraPics like this:

 

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

here all the additional images are also loaded into the $product_info_array.

 

now i declare a new variable like this:

 

if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') {

$template_pinfo['ultrapics']=include(DIR_WS_MODULES . 'additional_images.php') ;

}

 

where the 'additional_images.php' file is a file from the UltraPics contribution that parses the pictures and gives it back in an HTML table layout.

 

finally i place the so created $ultrapics$ placeholder in a table in my product_info.php.html file

 

This works just fine, with one major error: the 'additional_images.php' file gets included at the top of the template file and not in the table wher it should be. Where it should be, i just get "1" - probably stating that the include was a success.

 

i think this would be a very interesting question to be answered, because so one could use the UltraPics contibution in ones content templates from STS 4.

 

I was searching the forum for hours, before i tried to do this, but found no answer to any question about to implement these two contributions and use ultrapics in a content template.

 

i will this also post in the UltraPics contribution support hoping that someone might come up with a solution.

 

thanks a lot for any answer how to implement this!

 

ps: what is the right STS forum to post this in? there is one STS Plus 4 and one STS 4 - but as much as i can see both are for the same contribution, but different versions?

Share this post


Link to post
Share on other sites

hi

I have a problem with a http://sklep.front.pl/create_account.php page. in a $content is an empty space (blank content). there is no register fields. other pages are displaying correctly. what must i do?

please help.

 

ps. login is tester and pasword is testing.

Edited by duch

Share this post


Link to post
Share on other sites

btw. it is not show in my template and in full or test template also. it's a bug or i must do something?

Share this post


Link to post
Share on other sites

ok, i have a pro version of oscommerce from oscommerce.pl, i replace create_account.php from my shop with this from milestone and now it works fine..

strange... :blink:

Share this post


Link to post
Share on other sites

hi,

 

i have installed STS 4.1 in my test store, everything works fine.

 

if i use SSL i can not see my background images if i go to a https side.

 

this is the way how have integrated the background images.

 

background="http://www.domain.de/images/hintergrund/header-links.gif"

 

how must i change the image link to see the images in SSL ?

 

hope someone can help me.

thanks in advance.

 

 

bg

Michael

Share this post


Link to post
Share on other sites

You can try that for Ultimate Images, add in includes/sts_inc/product_info.php:

 

if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') {

ob_start();

include(DIR_WS_MODULES . 'additional_images.php') ;

$template_pinfo['ultrapics']= ob_get_contents();

ob_end_clean();

}

 

and use $ultrapics in your content template.

 

- Rigadin


STS v4.5 SP5 is out, and check the STS Power Pack contribution too!

New thumbnailer using phpThumb: oscThumb. Works great.

Share this post


Link to post
Share on other sites

Hi,

 

On the older versions of sts you had product_info.php.html and you could add and take away attributes like $productdesc, $imagesmall etc and move them around to place them where they looked best. But on this version you just get the attribute $content.

 

I don't want things like 'This product was added to our catalog on...' etc.. which files need editing to remove things like this?

 

Thanks

Share this post


Link to post
Share on other sites
You can try that for Ultimate Images, add in includes/sts_inc/product_info.php:

 

if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') {

ob_start();

include(DIR_WS_MODULES . 'additional_images.php') ;

$template_pinfo['ultrapics']= ob_get_contents();

ob_end_clean();

}

 

and use $ultrapics in your content template.

 

- Rigadin

 

thanks for the help - i managed to do it a bit different. i have now 6 variables for all 6 pictures that are possible with ultrapics - so i can put them wherever i want.

Share this post


Link to post
Share on other sites

If you have a lot of product templates already done for an older STS version, you can enable the STS3 compatibility mode in the product info module.

 

Otherwise, create a content template product_info.php.html in the "content" of your template folder. Check that you have enabled the product info module in admin. In this content template, do not place header, columns nor footer: this content template will replace the $content of the "main" template used (like sts_default.html). There is an example in the template folder "full" of the contribution.

 

- Rigadin


STS v4.5 SP5 is out, and check the STS Power Pack contribution too!

New thumbnailer using phpThumb: oscThumb. Works great.

Share this post


Link to post
Share on other sites

I'm trying to center and create a fixed width page. I used the Fixed Width Site with CSS contribute, and it works great, but not with STS. How can I get my site to be fixed-width and centered? Thanks in advance.

Share this post


Link to post
Share on other sites

Hi All STSers,

 

Just installed STS 4.1, because my knowledge og PHP is minimal.

 

Where do I begin in terms of creating my new look website with STS 4.1.

 

What files do I need to touch and modify.

 

Thanks to all in advance.

Share this post


Link to post
Share on other sites
Hi All STSers,

 

Just installed STS 4.1, because my knowledge og PHP is minimal.

 

Where do I begin in terms of creating my new look website with STS 4.1.

 

What files do I need to touch and modify.

 

Thanks to all in advance.

 

 

ps.

 

I have activates STS through the admin panel, and found that my original site appeared in the center of the sts template.

 

Can anyone guide me to using STS with a view to creating my own templates.

 

Any assistance would be greatly appreciated.

 

Regards

Share this post


Link to post
Share on other sites

@itnchans

you can start in /catalog/includes/sts_templates/ folder. There you have two templates, Test and Full, but first you have to enable the shop to use templates, from the Administration side, by going to Modules -> STS -> Default -> Install. You can set it up to use the Test template for starters, and then start modifying the way sts_template.html looks (found in the includes/sts_templates/test/ folder). And also read the documentation, because there are lots of usefull informations there too... (STS4.doc, found in the sts4.1 archive)

 

@contrib developers

I thought of a feature that is not present in the contribution and some people might find usefull...

For example, I had to modify the templates so they wouldn't show some boxes and informations when an affiliate is loged in, so I had to design a template for each page (and for the affiliate there are about 20 or so files) that can show up when an affiliate is logged in. It's basically the same html, but with different names... affiliate_banners.php.html, affiliate_clicks.php.html, etc...

Wouldn't it be a nice ideea to have a feature somewhere in the administration panel where you could say something like "I want to use <this> template for the following pages: <script1>,<script2>..." ? Or is there another way in the present to do this ? Because in this case, the different affiliate files are not like cathegories or products where you could just pass an ID or smth... it would be very good to have something like that, cause in that way you could design a single html and modify it easily so it would show in all cases, instead of copying the file for each script, each time you modify it :)

 

Best of luck for everybody...

 

PS: I have STS 4.1 and HTC 2.5.9 and they work great together. Before, I had STS 3 and HTC 2.5.5, but the HTC didn't work ok. I didn't update to get to the new versions, instead I removed the old versions completelly and then reinstalled the new ones. Maybe some of you would say that it's too difficult to remove them, but I had installed other contributions in the meanwhile, so I know how it is, but still it's the best way to make sure the instalation works fine... (when you install HTC, don't modify the files from the catalog, just copy the new ones, and in the admin side remember to specify at the STS module that "Files for normal template" would have to use sts_user_code.php;headertags.php)

Edited by umc

Share this post


Link to post
Share on other sites

Hi,

Just want to know how to apply this contrib to different languages, i.e one template for each language. Is it possible ?

 

Thx :rolleyes:

Share this post


Link to post
Share on other sites

As you can include php inside your templates, you can do quite many things!

 

When writing php code inside your template, you have to remember that the template file is included from within the sts class, so you have access to sts class properties and methods by using '$this->' variable, but you don't have access to "outside" variables without using a 'Global' definition.

 

Simple example for language specific templates:

Create template template_1.html for language id 1, template_2.html for ID 2 and so on.

 

in sts_default.html, put only this:

<?php

Global $languages_id;

includes (STS_TEMPLATE_DIR.'template_'.$languages_id.'.html');

?>

 

I have not tested and it could be better but you can get the idea.

 

- Rigadin


STS v4.5 SP5 is out, and check the STS Power Pack contribution too!

New thumbnailer using phpThumb: oscThumb. Works great.

Share this post


Link to post
Share on other sites
As you can include php inside your templates, you can do quite many things!

 

When writing php code inside your template, you have to remember that the template file is included from within the sts class, so you have access to sts class properties and methods by using '$this->' variable, but you don't have access to "outside" variables without using a 'Global' definition.

 

Simple example for language specific templates:

Create template template_1.html for language id 1, template_2.html for ID 2 and so on.

 

in sts_default.html, put only this:

<?php

Global $languages_id;

includes (STS_TEMPLATE_DIR.'template_'.$languages_id.'.html');

?>

 

I have not tested and it could be better but you can get the idea.

 

- Rigadin

 

Thx for the tip :thumbsup: . I wa struggling to make it works until I notice that u've put an 's' to include.

I've remove the extra 's' and now it works fine. I bet that that same logic can be used if we want a specific homepage. Is there a global variable that might indicate that i'm in my home page(ie index)..

;)

Share this post


Link to post
Share on other sites

Sorry for the s.

 

With the latest index module, you can create a home page template named index.php_0.html.

This feature was already in STS3 but was buggy in previous releases of index STS4 module.

 

- Rigadin

Edited by rigadin2

STS v4.5 SP5 is out, and check the STS Power Pack contribution too!

New thumbnailer using phpThumb: oscThumb. Works great.

Share this post


Link to post
Share on other sites

Hi

I got a problem with my shop.

I have sts 4.1 and HTC v2.5.9 with the headertags.php in sts.inc.

 

The problem is that when I?m go from http --> https I?m getting a warning.

 

When i take off the file headertags.php in admin modul, default

Like:

Files for normal template

sts_user_code.php;headertags.php

WARNING

to

Files for normal template

sts_user_code.php

 

i get no warning.

 

what?s wrong?

/Bj?rn

Share this post


Link to post
Share on other sites

I'm still confused about how sts works. I'm using the full folder. activate use of index in admin.

 

Now on my home page, the index.php.html is being used and when i click on a category,i'm still in index template. When I click on my account, checkout and others, the sts_template.html is used. Is this how this should normally works with the above settings.

 

I've downloaded the latest update. How do I make use of the index.php_0.html. I've just create it to act as my home page. Where do I call it ?

 

Can some1 pls help..i'm really new to all the php and osc stuff.. :blush:

Share this post


Link to post
Share on other sites

You don't need to call any template, it's STS that finds the template to use according to the script being run.

 

index.php.html is used when running script is index.php

checkout_shipping.php.html is used when running script is checkout_shipping.php

and so on.

 

If you enable the index module in admin, you can make templates based on the category ID, so index.php_32.html will be the template used for category 32. ID 0 is for the home page. Check from the contribution page that you have the index module corrected to work with ID 0.


STS v4.5 SP5 is out, and check the STS Power Pack contribution too!

New thumbnailer using phpThumb: oscThumb. Works great.

Share this post


Link to post
Share on other sites
You don't need to call any template, it's STS that finds the template to use according to the script being run.

 

index.php.html is used when running script is index.php

checkout_shipping.php.html is used when running script is checkout_shipping.php

and so on.

 

If you enable the index module in admin, you can make templates based on the category ID, so index.php_32.html will be the template used for category 32. ID 0 is for the home page. Check from the contribution page that you have the index module corrected to work with ID 0.

 

Thx a lot, I understand better. Ok index.php_0.html is working fine. Now what I want is to have 2 Home Page(one for english and one for french). I'm using using ur logic and replace index.php.html with:

 

<?php
Global $languages_id;
include (STS_TEMPLATE_DIR.'index.php_'.$languages_id.'_0.html');
?>

 

Note that index module is set to false in admin.In the above code I've hardcoded '0'. What i need is a global variable that will be 0 when i'm in my home page. Any idea ? Or are there a better way out..

 

Thx

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

×