Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] STS v4


Guest

Recommended Posts

Rob,

 

There is a section in the STS User Manual that specifically covers this topic; Section 6.3

It is under the Tips and Tricks as it doesn't really relate to STS but it is assumed most STS site owners would benefit from this information.

 

Hi Bill

 

Thats the one!!!! , i found what i needed , also i must be in need for new glasses tho ;-)

Link to comment
Share on other sites

Also, as Rob has just asked, I have no idea as to where does the "What's New Here?" title, that is displayed on my shop home, come from?

 

Thanks,

Dan

 

I found that on the "index.php" file , somewere near the bottom - on line 313 - this function gets called , i just deleted it but left the td thingies like this:

 

         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
         <td></td> [i][b]( <<<in here was the code)[/b][/i]
         </tr>
<?php
   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>

 

 

It now works without the whole " whats new" field.

 

 

 

Gr, Rob

Link to comment
Share on other sites

Thanks Rob. What I didn't know (and just understood) is that there were 2 of each php file in osCommerce - one in the main catalogue directory and one for each language. I was looking at the index.php in the English folder and was not understanding where all the variables were coming from and where they were being used...

 

Dan

Link to comment
Share on other sites

Hi,

 

Did some more reading and now I have a good feeling of PHP and HTML. Thanks again for the links, George. While now I can read the scripts and tell what they should do, I am still very confused as to how exactly osCommerse works. There are lots of variables all over the place shared by several PHP files and I am getting lost in all this. The PHP files don't have sufficient comments to understand what's going on. Is there some place that lists all the variables and structure of osCommerce?

 

For instance, there is a line at the top of the home page:

 

"Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account?"

 

Which I have no idea where does it come from???

 

Thanks,

Dan

Link to comment
Share on other sites

Did some more reading and now I have a good feeling of PHP and HTML. Thanks again for the links, George. While now I can read the scripts and tell what they should do, I am still very confused as to how exactly osCommerse works. There are lots of variables all over the place shared by several PHP files and I am getting lost in all this. The PHP files don't have sufficient comments to understand what's going on. Is there some place that lists all the variables and structure of osCommerce?

Well, osCommerce is not a php tutorial and I think it's not made in the purpose to help self education in this matters. It's a selling tool made in the purpose to work.

 

For instance, there is a line at the top of the home page:

 

"Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account?"

 

Which I have no idea where does it come from???

This question is not related to STS, so, in the future for general questions like this please find an older similar topic to ask, or open a new one. Lets keep this thread clean and strict STS related.

 

Anyway, for now:

 

In your index.php you will see near the bottom following line

            
<td class="main"><?php echo tep_customer_greeting(); ?></td>

This is calling a function. This function you will see in file includes/functions/general.php where it says

// Return a customer greeting
 function tep_customer_greeting() {
   global $customer_id, $customer_first_name;

   if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
     $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));
   } else {
     $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
   }

   return $greeting_string;
 }

 

The actual text is in file includes/languages/english.php

 

You need to invest some time to understand how everything works. Read the forum, most questions are already answered.

Edited by multimixer
Link to comment
Share on other sites

Hi,

 

This is a great contrib,I'm just new and try to figure out how is this work correctly.

I read the STS User Manual,but still get some confuse with it.

I have a clean Osc MS2 installed with STS4.6 ,the following is my setup:

 

1.Default - enable and select "test" as my template. There is only 1 file sts_template.html in the folder.

2.Product info - enable,the other parameters are all default setup.

 

So,here is my problem.I'm going to test the content page in product info,so i have a file product_info.php_3.html copy to my working template folder (catalog\includes\sts_templates\test\).

Then i run the browser to view my site,there is only ID=3 product apply this contant page,when i turn off this module "product info" in admin,the content page of ID=3 product looks like the rest of other pages,everything works fine.

 

But,when i rename product_info.php_3.html to product_info.php.html,even i turn off the module "product info" (still have "default" one on),but all content pages of my products still apply this content module.

 

I can't figure out what happened,is there any wrong in my install? or It just run like this...

(Sorry for my bad English grammar and spell..)

Link to comment
Share on other sites

Right I've pretty much got my site up and running but I have a small problem. Im just using one template file (for the moment) and with a $headercontent tag in the head section, a $breadcrumbs tag and a $content tag. Shop

 

Problem 1:

 

The page title in the header info generated by $headercontent is always the same, the shop name. I thought it would be the name of the product?

 

Problem 2:

 

This maybe related to the first problem, but the the breadcrumb navigation doesn't show the name of the products at all. It shows the categories names and then the seperator and then a blank.

 

Problem 3:

 

The new products table and the also purchased table are generated without a header eg on a default install you get the table that says "New products for..." on the index page. As im using the $content tag, I thought this would be pulled in automatically?

 

Sorry for the long post! Any help would be greatly appreciated.

 

My setup:

 

2.2rc2a

OptionTypes 2.1.3_1

STS 4.6

Link to comment
Share on other sites

Bill

 

with the supposedly impending release of v2.3 (which was going to be last month) will an update to STS be required to continue using it with this new version as i see it has seperated a lot of the html away from the php in the code i have seen.

Link to comment
Share on other sites

Bill

 

with the supposedly impending release of v2.3 (which was going to be last month) will an update to STS be required to continue using it with this new version as i see it has seperated a lot of the html away from the php in the code i have seen.

 

I just began playing with v2.3 last week and since then the code has already been changed regarding the tables....

 

 

So... Yes, STS will need to be updated to be used with v2.3. I have begun doing that but until the final release of v2.3, I really do not know what I will be working with.

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Checkout the solution that I use quite often as I'm sure it will meet your needs:

 

Shopping Cart in Header (or anywhere for that matter). Post #4183

 

Bill, thank you very much for your time. I finally found the problem. This piece of code:

 

 $info_box_contents = array();

 

was missing in the image_in_cart.php file. Now it works :)

Link to comment
Share on other sites

Hello Everyone,

 

Got a relatively new shop and have been looking for a new checkout process. I have found 2 one page processes that don't seem to work with STS. Does anyone know of a simple way to modify the checkout process so that it will work with STS? Is it just best to create a template for each page and keep the 4 steps or can it be done in one page?

 

Thanks in advance for any help.

 

Steve

Link to comment
Share on other sites

  • 2 weeks later...

Hi Bill,

 

I would like to use CSS buttons, is it possible?

I downloaded the contribution Ultimate buttons http://addons.oscommerce.com/info/7307 and the buttons show when I deactivate sts template. If the template is activated some kind of basic css buttons can be seen, but not the ones from the contribution.

 

The instruction says:

Open includes/functions/html_output.php

Find:

function tep_image_submit($image, $alt = '', $parameters = '') { global $language; $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
$image_submit .= '>';
return $image_submit;
}

 

Replace with:

/* BOF Ultimate Buttons */
function tep_image_submit($image, $value = '-AltValue-', $parameters = '') {
global $language;
$css_submit = '<div class="buttons"><input type="submit" class="buttons_submit" value="' . tep_output_string($value) . '" /></div>';
return $css_submit;
}
/* EOF Ultimate Buttons */

 

Find:

function tep_image_button($image, $alt = '', $parameters = '') { global $language;
return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
}

 

Replace with:

/* BOF Ultimate Buttons */
function tep_image_button($class, $value = '-AltValue-', $parameters = '' ) {
global $language;
$width = round((strlen($value) * 5.8),0) + 38;
$image = '<div class="buttons"><span>' . tep_output_string($value) . '</span></div>';
return $image;
}
/* EOF Ultimate Buttons */

 

but my html_output.php looks a bit different:

 

 function tep_image_submit($image, $alt = '', $parameters = '') {
   global $language;

	// START STS v4.4:
  global $sts;
	  $src = $sts->image_button($image,$language);
	  if ($src!='')
	    $image_submit = '<input type="image" src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';
		else 
  // END STS v4.4
   $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';

   if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

   if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

   $image_submit .= '>';

   return $image_submit;
 }

 

and

  function tep_image_button($image, $alt = '', $parameters = '') {
   global $language;

// START STS v4.4:
  global $sts;
	$src = $sts->image_button($image, $language, true); // 3rd parameter to tell tep_image that file check has been already done
	if ($src!='') { // Take image from template folder if exists.
	  return tep_image ($src);
	}
// END STS v4.4

   return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
 }

 

Could you please give me advice how to change the code?

Thank you very much.

Link to comment
Share on other sites

Hi Bill,

 

I would like to use CSS buttons, is it possible?

I downloaded the contribution Ultimate buttons http://addons.oscommerce.com/info/7307 and the buttons show when I deactivate sts template. If the template is activated some kind of basic css buttons can be seen, but not the ones from the contribution.

 

but my html_output.php looks a bit different:

 

 function tep_image_submit($image, $alt = '', $parameters = '') {
   global $language;

	// START STS v4.4:
  global $sts;
	  $src = $sts->image_button($image,$language);
	  if ($src!='')
	    $image_submit = '<input type="image" src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';
		else 
  // END STS v4.4
   $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';

   if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

   if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

   $image_submit .= '>';

   return $image_submit;
 }

 

and

  function tep_image_button($image, $alt = '', $parameters = '') {
   global $language;

// START STS v4.4:
  global $sts;
	$src = $sts->image_button($image, $language, true); // 3rd parameter to tell tep_image that file check has been already done
	if ($src!='') { // Take image from template folder if exists.
	  return tep_image ($src);
	}
// END STS v4.4

   return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
 }

 

Could you please give me advice how to change the code?

Thank you very much.

 

Comment out the old function(both) you have completely, and use the code of the css addon. The STS code is looking to find image buttons in the template folder, where you probably have them

Link to comment
Share on other sites

Comment out the old function(both) you have completely, and use the code of the css addon. The STS code is looking to find image buttons in the template folder, where you probably have them

 

Thank you George,

 

but when I do that, website stops using template buttons, but it doesn´t use the new ones from images folder either. (New buttons should be placed to images folder according to stylesheet of the contribution):

.buttons_submit {

background: transparent url('images/button_left.png') no-repeat;

font-weight: normal;

 

When I comment the old code and replace it with the new one, buttons are probably created only by css (I don´t have buttons like them in any of my folders). If I deactivate STS, new buttons (from the contribution) show up... :(

Link to comment
Share on other sites

 

but when I do that, website stops using template buttons, but it doesn´t use the new ones from images folder either. (New buttons should be placed to images folder according to stylesheet of the contribution):

 

When I comment the old code and replace it with the new one, buttons are probably created only by css (I don´t have buttons like them in any of my folders). If I deactivate STS, new buttons (from the contribution) show up... :(

 

You can place the new button background images in any folder you like, since you refer to this folder directly in the css. And yes, if you do this, then none of your old image buttons will show up, just the css buttons

 

Example

 

1) My includes/html_output.php

//// ---------------------------------------------------------------------------------------------------------- ////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
/* original
 function tep_image_submit($image, $alt = '', $parameters = '') {
   global $language;

	// START STS v4.4:
  global $sts;
	  $src = $sts->image_button($image,$language);
	  if ($src!='')
	    $image_submit = '<input type="image" src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';
		else 
  // END STS v4.4

   $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
   if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
   if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
   $image_submit .= '>';
   return $image_submit;
 }
*/  

// BOF Ultimate Buttons 
//
function tep_image_submit($image, $value = '-AltValue-', $parameters = '') { // regular submit button
global $language;
$css_submit = '<div class="buttons"><input type="submit" class="buttons_submit" value="' . tep_output_string($value) . '" /></div>';
return $css_submit;
}

 

2) My CSS (Placed in folder /sts_templates/)

.buttons, .buttonsPIca {
background: url('images/buttons/black30_1_right.png') no-repeat scroll top right;
font: normal 12px Verdana, arial, sans-serif;
color: #eeeeee;
display: block;
height: 30px;
float: left;
text-decoration: none;
margin-right: 6px;
padding-right: 12px;
border: none;
   }

.... etc etc

 

3) The background images are placed in folder includes/sts_templates/images/buttons

 

If you have your mages in another folder, or your css ie in the root folder, you need to correct the paths accordingly

Link to comment
Share on other sites

Problem with just a single category for template.

Mr. Bill Kellum I've read just about all your topics and for the life of me I can't figure a way to do this.

I want to use a different category template for just 1 category only in my case this one patiodoorrepair.net Now using freeosc_60 template. All the images are the same for each product. Just need the pure listing with no images for products page. The one image for all the products would be under the category heading.

 

1. Would I use

Index.php_181_182_191.html or

product_info.php_181_182_191.html or

product_info.php-c-181_182_191.html

for new cat template? I tried all but can't get any to work or even show in the working store.

 

2. If I get a category page to work would I need to copy all the index.php code to this template to turn off product images or just a snippet for this category?

 

This can't be as hard as I'm making it. Maybe someone could just point me in the right direction if you would.

 

Thanks in advance.

Nick

"Do what I'm thinking Not what I said." https:windowanddoorparts.us

Link to comment
Share on other sites

 

Hi George,

Thank you for your time and your patience. I have modernrc2a template with grey buttons.

 

I placed the code in the includes/functions/html_output.php

I placed the code in the sts_templates/modernrc2a/stylesheet.css

and I saved my new images into sts_templates/modernrc2a/images (the new images are blue)

 

now I can see some kind of basic css beige (#ECE9D8) buttons on my website.

If I delete the code from the stylesheet.css and delete my blue buttons from images folder, the buttons that I see on my website don´t change (beige)

Does it mean that something in my sts_templates/modernrc2a/stylesheet.css interfere with the new code? Because, if I place the same code in my old catalog/stylesheet.css and then I save the file in sts_templates/modernrc2a folder, my blue buttons show up... But of course the look of modernrc2a template is gone. :'(

Link to comment
Share on other sites

Hello,

 

okay so really new to all this stuff but have powered my way through most of it till now, i've hit a wall,

 

Using a temple for sts and can't get the year make model contribution to work.

 

Everything shows up in the product info section properly but i can't get the drop downs which i want in the left column to show up at all. I have tried adding it as a box that didn't work just was hoping someone here could look at the code and see if it was possible. Thanks

 

year make model contribution:

http://addons.oscommerce.com/info/6684/v,22

Link to comment
Share on other sites

Hi,

 

I have my web still on localhost. Everything seems to work fine in Firefox and IE6.

In Opera, pages load a lot faster than in Firefox (I can´t imagine why). But it looks like they load so fast that sometimes I can see the page before the sts template loads.

 

Usually the top of the page and the left column stay (or at least it seems that they don´t load again and again), but every 5 - 20 clicks the whole page gets refreshed and I see what I am not supposed to see. The page has white background, buttons or menu are just underlined hyperlinks. It is just for a little moment, then the template appears. But it does look really bad. :'(

 

Do you know why this could happen please? Or is it normal behavior of Opera? It doesn´t depend on what I click on, it is totally random. And sometimes it is three times in row, sometimes just once in a while.

 

And one more question: the product_info.php is refreshed every time from top to bottom in IE6. In Opera and Firefox the top of the page and the left column stay. Is it IE problem? Can I do something about it please?

 

Thank you very much for any tip.

Link to comment
Share on other sites

I'm having a problem with the admin side that I can't figure out. I've narrowed it down to STS - meaning it works without STS and the only contribution I installed is STS and it has this problem.

 

My site worked fine on my local host - wamp server, Apache 2.2.11 (win32), php 5.2.11, and mysql 5.1.36.

My ISP is using Apache 1.3.41(Unix), PHP 5.2.6 and mysql 5.1.45.

 

Once I upload, the site admin/modules shows the modules I've installed but does not allow me to configure them. It has the install button and when pressed - looks like it is trying to process but nothing happens. The directory location for the module is shown in the center part of the screen.

 

I have started from a fress install twice now - works fine locally and when I move to the ISP - it dies. I have checked the permissions, directory structure, etc. several times and had my ISP check them. All seems ok. On the last fresh install it works with just OSc 2.2 and when I add in STS it has this problem.

 

My ISP is telling me that it is an issue with fastCGI. I'm not a php person so I would not know how to look at that. Has anyone else experienced this and have any idea how to solve it?

 

Thanks in advance for your help.

Link to comment
Share on other sites

I'm having a problem with the admin side that I can't figure out. I've narrowed it down to STS - meaning it works without STS and the only contribution I installed is STS and it has this problem.

 

My site worked fine on my local host - wamp server, Apache 2.2.11 (win32), php 5.2.11, and mysql 5.1.36.

My ISP is using Apache 1.3.41(Unix), PHP 5.2.6 and mysql 5.1.45.

 

Once I upload, the site admin/modules shows the modules I've installed but does not allow me to configure them. It has the install button and when pressed - looks like it is trying to process but nothing happens. The directory location for the module is shown in the center part of the screen.

 

I have started from a fress install twice now - works fine locally and when I move to the ISP - it dies. I have checked the permissions, directory structure, etc. several times and had my ISP check them. All seems ok. On the last fresh install it works with just OSc 2.2 and when I add in STS it has this problem.

 

My ISP is telling me that it is an issue with fastCGI. I'm not a php person so I would not know how to look at that. Has anyone else experienced this and have any idea how to solve it?

 

Thanks in advance for your help.

 

Are you simply transferring the local site to the remote site? What version of osC are you using? Is it the same version on both sites?

 

This appears to be nothing more than a bad FTP transfer. Try uploading all of the files again or change FTP client software.

Bill Kellum

 

Sounds Good Productions

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

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