Jump to content
rigadin2

[Contribution] STS v4

Recommended Posts

The correct tag to use would be $langid.

 

 

Hi, after looking around a bit, I came up with a solution that works, but the question is why doesn't $languages_id work and $GLOBALS[languages_id] does in my header.

 

The script is java based for the header menu.

 

Thanks

Johnny


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

Bill,

My configuration is as you stated except that instead of using

define('HTTPS_SERVER', 'https://glimmer.com');

I use

define('HTTPS_SERVER', 'https://host8.webserver1010.com/glimmer');

which is pointing to exactly the same directory. The reason I

do this is so I can then use the server's Secure Cert

and do not need a Cert for each domain name that has a cart.

 

Since this does not seem to be a problem for anyone else, and it

also manifests itself in the use of $templatedir when referencing the

search .gif in your template, I will just make the changes locally.

 

Thanks for your help. It is really nice to have someone to

talk with about these problems. Great product and great support.

 

John

Share this post


Link to post
Share on other sites

Thanks Bill,

 

You'll never guess what I learned over the weekend :blush: - LOL

 

The a/b split testing with google's tools is done through a tool called "website optimizer" rather than the "google analytics" tool. I just have to tell that tool which pages I want to test, and it will handle serving half the viewers one page and half the viewers the other page and tracking which one gets better results :)

 

So - in order to create two separate templates for the home page, I'm thinking I can save a copy of index.php as index2.php and then create a template for index2.php.html and then just tell the "website optimizer" to alternate between those two for the home page of the site.

 

I'll let you know if I run into any issues, but I think this will work - :blush:

 

Tracy,

The code above is what creates the STS tag: $templatedir

 

I'm confused as to what your "switch" will be based? The closest switch tag currently in place is the $langid tag that will switch images based on the language ID selected by the "user".

 

Here is an idea...

 

Create a global variable in which your switch is based on. Let's call it $templateswitch.

 

 

in index.php_0.html, remove everything and only add the following:

<?php

Global $templateswitch;

include (STS_TEMPLATE_DIR.'template_'.$templateswitch.'.html');

?>

 

Now, create your separate homepage templates naming them "template.a.html" and "template.b.html".

 

To the newbie...please ignore the above. Tracy and I are throwing out ideas for her custom project. :blink:


~Tracy
 

Share this post


Link to post
Share on other sites

Hi Bill

Did your clients site with ultrapics and lightbox contribution ever show the next and previous buttons when using the lightbox.

 

cheers Brian

Share this post


Link to post
Share on other sites

Bill,

You were correct, my analysis was faulty. The glimmer directory in my https configuration was the problem. I just couldn't see the forest for the trees.

 

Briefly here is what is happening:

My HTTPS server path has a directory in it:

https://host8.webserver1010.com/glimmer

 

<--$headers--> correctly sets

<base href="https://host8.webserver1010.com/glimmer/catalog/">

So far so good.

 

however

$templatedir is: /catalog/includes/sts_templates/modernrc2a......

 

Note the proceeding "/" before "catalog" makes this path relative to the host in the "base ref".

So the paths using $templatedir ignore both the "glimmer" and "catalog" directories in "base href" and the path becomes

host8.webserver1010.com/catalog/includes/sts_templates/modernrc2a......

rather than the correct:

host8.webserver1010.com/glimmer/catalog/includes/sts_templates/modernrc2a......

 

Note that if you don't have a directory in your server path there isn't a problem. The proceeding "/" just has the effect of striping the catalog directory from "base href" which is just what you want if $templatedir has the catalog directory included.

 

To solve this problem I created another variable with the value of the template path relative to the catalog directory without the proceeding "/".

Its value is: includes/sts_templates/modernrc2a....

 

This produces a pure relative link with respect to "base href" and works whether or not you have a directory in your server path.

 

Your comments have been very helpful in resolving this issue. I probably have spent way more time on this than I should have, but it just was bugging me.

 

Thanks again,

John

Share this post


Link to post
Share on other sites

It worked!! YAY!!

 

If anybody else wants to try this some day - I used googles Website Optimizer tool to setup an A/B Split test. I wanted to test two different versions of our home page. So, I have:

 

catalog/index.php STS template is index.php_0.html

catalog/index2.php STS template is index2.php.html

 

Then, the URL's for testing are:

original: http://www.myurl.com/index.php

Test: http://www.myurl.com/index2.php

 

You add the JavaScript google wants on the pages to the templates for those pages.

 

I wanted to see which one resulted in more orders, so I created a template page for catalog/checkout_success.php (template is named checkout_success.php.html) and put the script google wanted on the template for that page as well.

 

Now - my only question is:

 

If I wanted to test two completely different versions of the entire website to see if a redesign idea is liked better by our customers than our existing site: How would I do that? Any ideas Bill?

 

Thanks Bill,

 

You'll never guess what I learned over the weekend :blush: - LOL

 

The a/b split testing with google's tools is done through a tool called "website optimizer" rather than the "google analytics" tool. I just have to tell that tool which pages I want to test, and it will handle serving half the viewers one page and half the viewers the other page and tracking which one gets better results :)

 

So - in order to create two separate templates for the home page, I'm thinking I can save a copy of index.php as index2.php and then create a template for index2.php.html and then just tell the "website optimizer" to alternate between those two for the home page of the site.

 

I'll let you know if I run into any issues, but I think this will work - :blush:


~Tracy
 

Share this post


Link to post
Share on other sites

Hi Bill,

 

I am not sure if you can help me or not, but I am going to give it a shot anyways.

 

I am planning on switching over my main site from a basic HTML site tied into osC w/STS to a Joomla based one, and in doing so I want to convert my tableless Joomla based CSS styled template to a STS CSS Styled template.

 

I am currently teaching myself CSS, but still not very good at it. I have contacted the designer of the template and their plate is full.

 

How possible is it to make this conversion? I have all the source files as well as stylesheets and anything else I would need to modify the template.

Edited by Eighteen48

Powered By osC 2.2RC2a STS 4.5.8 - HTC 2.6.3 - FP 1.5.9 - BCH 1.0.0

Share this post


Link to post
Share on other sites

I want to put just the name of someone when they have logged in into the header, so instead of all the greeting text just the name. I found a post regarding $greeting# which i can't find anywhere. is it possible to create a placeholder for $greeting?

Share this post


Link to post
Share on other sites

At last I found the solution to get the next and previous buttons to display in the lightbox, it took me a few hours to find through trial and error, you would not believe that a full stop was causing the problem. In lightbox.css change from this

 

#prevLink:hover, #prevLink:visited:hover { background: url(../images/prevlabel.gif) left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url(../images/nextlabel.gif) right 15% no-repeat; }code]

to this

[code]#prevLink:hover, #prevLink:visited:hover { background: url(./images/prevlabel.gif) left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url(./images/nextlabel.gif) right 15% no-repeat; }

 

Note: remove one dot from { background: url(..images/prevlabel.gif)

 

Happy Bunny, hope it helps others

Share this post


Link to post
Share on other sites

Hi all,

 

Has anyone got this (or another similar) contribution to work with STS?

 

http://addons.oscommerce.com/info/5196 (the contrib is meant to give you a box where people can input their email address to sign up for a newsletter)

 

It works with STS turned off as far as I can make out correctly. I've added it as an extra box and thus a placeholder for my template. With STS on it shows up fine until pressing the submit/action button, then I just get my STS template showing with the placeholder names instead of all the boxes - strange! If you go back to home or another page the template works fine again.

 

Any ideas on this one? If not is there a contrib you use that does the same job?

 

 

Many Thanks once again...

Share this post


Link to post
Share on other sites

Hi

 

I am struggling to get a menu to contain shopping cart contents, I can get the header to contain the shopping cart info box ($cartbox), but that comes with everything header and contents.

 

Can anyone help me to get the shopping cart contents into the header without the rest of the info box.

 

Thanks

 

Johnny


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites
I want to put just the name of someone when they have logged in into the header, so instead of all the greeting text just the name. I found a post regarding $greeting# which i can't find anywhere. is it possible to create a placeholder for $greeting?

 

 

Add the following code directly in your template where you want the name to appear:

 

<?php
 if ( tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id') ) {
echo tep_output_string_protected($customer_first_name);
 }
?>


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 Bill,

 

Im trying to get the $reviews tag to display "Current Reviews: 0" when no reviews have been written, rather than nothing being displayed at all. I have been given the code to acheive this (http://forums.oscommerce.com/index.php?showtopic=326544) however it does not work with STS.

 

Is there a way to acheive this with STS?

 

Many thanks.

Lee,

 

I'm not sure I know what you mean since a stock osC with STS will never display a "blank" reviews box or reviews page. It will either display "There are currently no product reviews." or "Write a review on this product!" in the Reviews Infobox or give a brief blurb of one of the current reviews for the product.

 

Seems to me that you want to modify the language text TEXT_NO_REVIEWS to display "Current Reviews: 0" instead of "There are currently no product reviews." or "Write a review on this product!"


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 all,

 

Has anyone got this (or another similar) contribution to work with STS?

 

http://addons.oscommerce.com/info/5196 (the contrib is meant to give you a box where people can input their email address to sign up for a newsletter)

 

It works with STS turned off as far as I can make out correctly. I've added it as an extra box and thus a placeholder for my template. With STS on it shows up fine until pressing the submit/action button, then I just get my STS template showing with the placeholder names instead of all the boxes - strange! If you go back to home or another page the template works fine again.

 

Any ideas on this one? If not is there a contrib you use that does the same job?

 

 

Many Thanks once again...

 

This is fairly simple. All you need to do is create a STS tag for the new infobox.

 

Here is what I like to use for a Newsletter Infobox:

 

http://www.oscommerce.com/community/contributions,535

 

As I stated above, the only thing needed to make this work in STS is to create a new variable for the newly created newsletter infobox:

 

   $sts->start_capture();
  require(DIR_WS_BOXES . 'newsletter.php');
  $sts->stop_capture('newsletter', '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

 

I am struggling to get a menu to contain shopping cart contents, I can get the header to contain the shopping cart info box ($cartbox), but that comes with everything header and contents.

 

Can anyone help me to get the shopping cart contents into the header without the rest of the info box.

 

Thanks

 

Johnny

 

Take a look at my solution here: Post #4183

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


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 Bill,

 

I am not sure if you can help me or not, but I am going to give it a shot anyways.

 

I am planning on switching over my main site from a basic HTML site tied into osC w/STS to a Joomla based one, and in doing so I want to convert my tableless Joomla based CSS styled template to a STS CSS Styled template.

 

I am currently teaching myself CSS, but still not very good at it. I have contacted the designer of the template and their plate is full.

 

How possible is it to make this conversion? I have all the source files as well as stylesheets and anything else I would need to modify the template.

 

Be sure to take a look at the sample "Blank" template that is provided in the download. This template will show you what you need in order to make "any" template an STS template (the bare essentials anyway).


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

I am using the template system (just learning and so far its great). I have changed the color of the head of all of my containers (boxes, manufacturers, information, whats new, etc.). When I did that the top right of those headers must be an image because they remained the original color.

 

im at uwearusa.com/store

Share this post


Link to post
Share on other sites
I am using the template system (just learning and so far its great). I have changed the color of the head of all of my containers (boxes, manufacturers, information, whats new, etc.). When I did that the top right of those headers must be an image because they remained the original color.

 

im at uwearusa.com/store

 

Chris,

 

The stock osCommerce shop has some "hard coded" infobox images for the corners. An easy way to take care of this in order for the boxes to flow with your design is to upload some transparent gifs that are named the same as the stock images.

 

Use the following to do this very easily:

 

http://www.oscommerce.com/community/contributions,4764/

 

http://www.oscommerce.com/community/contributions,2034

 

Hope this helped,


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
Lee,

 

I'm not sure I know what you mean since a stock osC with STS will never display a "blank" reviews box or reviews page. It will either display "There are currently no product reviews." or "Write a review on this product!" in the Reviews Infobox or give a brief blurb of one of the current reviews for the product.

 

Seems to me that you want to modify the language text TEXT_NO_REVIEWS to display "Current Reviews: 0" instead of "There are currently no product reviews." or "Write a review on this product!"

 

Hi bill, i dont mean on the reviews page, i mean on the actual product info page. When a review is written for a product, on the product info page it displays "Current reviews: 1", however when no reviews are written, nothing displays at all.

 

Please compare the two...at the bottom of each page:

http://www.game101.co.uk/product_info.php?products_id=30

http://www.game101.co.uk/product_info.php?products_id=28

 

Somone has got the current reviews:0 to work without STS, however it doesnot work with it, is there a way around this?

Thanks for your help.

Share this post


Link to post
Share on other sites
Hi bill, i dont mean on the reviews page, i mean on the actual product info page. When a review is written for a product, on the product info page it displays "Current reviews: 1", however when no reviews are written, nothing displays at all.

 

Please compare the two...at the bottom of each page:

http://www.game101.co.uk/product_info.php?products_id=30

http://www.game101.co.uk/product_info.php?products_id=28

 

Somone has got the current reviews:0 to work without STS, however it doesnot work with it, is there a way around this?

Thanks for your help.

OK. This is VERY simple to do and it has NOTHING to do with STS. You need to comment out two lines in a stock catalog/product_info.php file.

 

In catalog/product_info.php, find the following line:

 

	if ($reviews['count'] > 0) {

Comment it out:

   // if ($reviews['count'] > 0) {

 

Now, you also need to comment out the trailing "}" as well:

 

On line 231 of a stock catalog/product_info.php file, find:

 

	} else {
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
 }
?>

 

Comment out the last "}" as so:

 

	} else {
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
// }
?>

 

Now, the text will display no matter if the current reviews are zero or many just as you wanted.

 

It should be noted that if you are using the Product_info content templates (you didn't mention if you were), then you would need to do the same thing for the catalog/includes/modules/sts_inc/product_info.php file.

 

Find:

 

 

if ($reviews['count'] > 0) {

 $template_pinfo['reviews'] = TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; 

} else {

 $template_pinfo['reviews'] = '';

}

 

Remove the "if" statement by commenting out the following as so:

 

 

//if ($reviews['count'] > 0) {

 $template_pinfo['reviews'] = TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; 

//} else {

//  $template_pinfo['reviews'] = '';

//}

 

Now you will see the Current Reviews count text no matter if there are zero reviews or many just as you wanted.

 

Hope this helped you out,


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

*** ABOVE EDITED****

OK. This is VERY simple to do and it has NOTHING to do with STS. You need to comment out two lines in a stock catalog/product_info.php file.

 

In catalog/product_info.php, find the following code:

	if ($reviews['count'] > 0) {
?>
  <tr>
	<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
}

 

Replace it with:

	/* if ($reviews['count'] > 0) { */
?>
  <tr>
	<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 /*  } */

Now, the text will display no matter if the current reviews are zero or many just as you wanted.

 

It should be noted that if you are using the Product_info content templates (you didn't mention if you were), then you would need to do the same thing for the catalog/includes/modules/sts_inc/product_info.php file.

 

Find:

 

 

if ($reviews['count'] > 0) {

 $template_pinfo['reviews'] = TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; 

} else {

 $template_pinfo['reviews'] = '';

}

 

Remove the "if" statement by commenting out the following as so:

 

 

//if ($reviews['count'] > 0) {

 $template_pinfo['reviews'] = TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; 

//} else {

//  $template_pinfo['reviews'] = '';

//}

 

Now you will see the Current Reviews count text no matter if there are zero reviews or many just as you wanted.

 

Hope this helped you out,


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
*** ABOVE EDITED****

OK. This is VERY simple to do and it has NOTHING to do with STS. You need to comment out two lines in a stock catalog/product_info.php file....

 

Bill that is absolutley fantastic thanks so much! Somone told me the first paart about commenting out the catalog/product_info.php code in the general support forum, however it did not work when i enabled sts in the admin, it must have been because i am using a content template, commenting out the code in the sts_inc/product_info.php done the trick.

 

Thanks again i really appreciate it!

Share this post


Link to post
Share on other sites

I am creating a shop in my native language. I have set in the admin that the default language had to be Bulgarian. But when I open the main page of the shop in Opera browser it shows the English content.

I dont have any texts in English.

I want to add the language in the menu links. But I don't know how.

This is what I use for the category links:

 

<a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>">Category Name Here</a>

What symbols I have to add in the links to display the category in Bulgarian?

Share this post


Link to post
Share on other sites

Hi Bill!

Im trying to manage to inlude additional_image.php in product_info.php.html. from thiscontribution ( Ultra Pics 2.07.01 - incl. STS + CCGV + LightBox_1 )

 

I tryed to replicate the function of this beeacuse that was the only function that i found that reminded me of what im trying to do.

 

$sts->start_capture();

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_also_purchased(3600);

} else {

include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

}

$sts->stop_capture ('alsopurchased'); // Get the result to the main array

$template_pinfo['alsopurchased']= $sts->template['alsopurchased']; // Put it in the product info

 

I thought that this would work beacuse that file also includes from modules as additional_image also do

 

but i cant make this work...

any idea how to get it to work so i only put $additionalimage in product_info under content?

 

Regards Tony

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

×