Jump to content
rigadin2

[Contribution] STS v4

Recommended Posts

Hey Bill,

 

This is interesting to me. On my templates I have found I need to reference images in my template folders this way:

includes/sts_templates/Full/images/IMAGE.jpg

 

However, when my image is in the images folder on the root I can reference it this way:

images/myimages/title2.jpg

 

This caused me to think that the template doesn't pull from where it is truly located, but pulls from where the page it affects is located (index.php for example is in the root folder, as is product_info.php).

 

Did I somehow install it wrong? :huh:

 

This is not completely accurate...

 

With STS, you can put your images in any folder you want as long as it is inside your template folder (all core osCommerce images could reside in the core images folder or you can replace those as well by simply uploading the core image by the same name into your template image folder -read the STS User Manual for more details on this feature).

 

Look at your HTML coding. You have place a dot before the forward slash on each of your image source URL's.


~Tracy
 

Share this post


Link to post
Share on other sites

Hey Bill,

 

This is interesting to me. On my templates I have found I need to reference images in my template folders this way:

includes/sts_templates/Full/images/IMAGE.jpg

 

However, when my image is in the images folder on the root I can reference it this way:

images/myimages/title2.jpg

 

This caused me to think that the template doesn't pull from where it is truly located, but pulls from where the page it affects is located (index.php for example is in the root folder, as is product_info.php).

 

Did I somehow install it wrong? huh.gif

 

 

 

 

thumbsup.gif You should get in the habbit of referencing them like this: $templatedir/images/IMAGE.jpg

 

This will be VERY IMPORTANT whenever I finally get to packaging the next release (STSv4.6) as it makes switching between existing template folders easier as well as fixes some bugs relating to the $templatedir variable when using infobox templates.


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

Okay I'm having some issues attempting to impliment the above. I tried to use the category and the product both. Changed them to c21 which is my first category and edited the file. Nothing is changing. I'm not sure what I'm doing wrong. I had great success using the index.php_21.html for my customized category template so I know it should be working. Anyone assist?? Thanks!!

 

 

What STS modules do you have enabled (installed) in your Admin?

What STS version are you using?


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
In your admin->Modules->STS you need to make sure you have Product Info templates turned on

 

Yup, that's what I was forgetting. Thank you!!!


Cristina

 

Share this post


Link to post
Share on other sites

Thanks Bill! I figured there had to be an easier way - LOL :blush:

 

thumbsup.gif You should get in the habbit of referencing them like this: $templatedir/images/IMAGE.jpg

 

This will be VERY IMPORTANT whenever I finally get to packaging the next release (STSv4.6) as it makes switching between existing template folders easier as well as fixes some bugs relating to the $templatedir variable when using infobox templates.


~Tracy
 

Share this post


Link to post
Share on other sites

YAY - I finally got it working. This is what worked (just in case anyone else searches for something like this):

 

$xsell_extracts_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id='" . (int)$HTTP_GET_VARS['products_id'] . "'");
while ($_xsell_results = tep_db_fetch_array($xsell_extracts_query)) {
        $xsell_results[] = $_xsell_results;
        $categories_id[] = $_xsell_results['categories_id'];
        }

if (in_array('87', $categories_id)) {

 

Hi Guys,

 

I am having a hard time learning how to deal with arrays, and the forum board for the contribution I'm working on doesn't appear to have much going on. Would someone here be able to see what it is I need to change? Some of my products are in more than one category. I need to pull the array of category id's for a product, and then check to see if a specific category id is in that array.

 

This is what I have so far, which works if the product is only in the one category I'm looking for, but doesn't seem to grab the entire array to try to check through all of the category id's:

$xsell_extracts_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id='" . (int)$HTTP_GET_VARS['products_id'] . "'");
$xsell_results = tep_db_fetch_array($xsell_extracts_query);

if ($xsell_results['categories_id'] == '87') {

 

Any help would be greatly appreciated :)


~Tracy
 

Share this post


Link to post
Share on other sites

Hi to you all, any idea on how to make this work in sts_inc/product_info.php?

<!--Begin Sold Out-->

<?php

If ($product_info['products_quantity']>0) {

$submit_button = tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);

} else {

$submit_button = tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/esaurito3.gif', 'Sold Out', IMAGE_BUTTON_SOLD_OUT);

}

?>

<td class="main" align="left"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . $submit_button; ?></td>

<!--End Sold Out-->

thanks

Share this post


Link to post
Share on other sites

Hi to you all, any idea on how to make this work in sts_inc/product_info.php?

<!--Begin Sold Out-->

<?php

If ($product_info['products_quantity']>0) {

$submit_button = tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);

} else {

$submit_button = tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/esaurito3.gif', 'Sold Out', IMAGE_BUTTON_SOLD_OUT);

}

?>

<td class="main" align="left"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . $submit_button; ?></td>

<!--End Sold Out-->

thanks

I would do as follows:

 

In sts_inc/product_info.php find the line

$template_pinfo['addtocartbutton'] = tep_image_submit('button_in_cart.png', IMAGE_BUTTON_IN_CART);

And add the same if/else to it, something like this

if ($product_info['products_quantity'] > 0) {
$template_pinfo['addtocartbutton'] = tep_image_submit('button_in_cart.png', IMAGE_BUTTON_IN_CART);
} else {
$template_pinfo['addtocartbutton'] = tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/esaurito3.gif', 'Sold Out', IMAGE_BUTTON_SOLD_OUT);
}

Share this post


Link to post
Share on other sites

I would do as follows:

 

In sts_inc/product_info.php find the line

$template_pinfo['addtocartbutton'] = tep_image_submit('button_in_cart.png', IMAGE_BUTTON_IN_CART);

And add the same if/else to it, something like this

if ($product_info['products_quantity'] > 0) {
$template_pinfo['addtocartbutton'] = tep_image_submit('button_in_cart.png', IMAGE_BUTTON_IN_CART);
} else {
$template_pinfo['addtocartbutton'] = tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/esaurito3.gif', 'Sold Out', IMAGE_BUTTON_SOLD_OUT);
}

That worked! It allows the SoldOut (but displayed) - v0.3 contribution http://addons.oscommerce.com/info/3076 to work also in the case of a content template for a specific product.

Thanks a million mate

Share this post


Link to post
Share on other sites

Hello

I'm trying to use header for my template (as described from Mr. Bill Kellum in STS Power Pack contribution) but my template header overlap page content. When I use view source from browser everything is OK, but its not show on screen

Any ideas will be appriated. Thank You

Share this post


Link to post
Share on other sites

Hi Bill,

 

I'm wondering if you can advise me on this -- I'm using STS with the product info template for content.

 

I'm trying to figure out how i can call the following information and write the following meta tag / link into the <head> of the output:

 

<meta name="title" content="products_name" />

<link rel="image_src" href="products_image" / >

 

Any ideas?

 

Thanks in advance

 

Steven

Share this post


Link to post
Share on other sites

Alright here is my situation. I have a website I made using dreamweaver at www.wannaspeed.com, I like the layout, but adding products is difficult as I have to go to paypal merchant services and generate code buttons, also it's difficult putting the thumbnail images in nice rows.

 

So I have been searching for a free cart software, I tried Agora Cart but it changed my site completely and looked difficult to edit the code to look anything like what it did. I tried Zen cart but was having lots of problems getting it to work, I signed up for 1freecart but trying to get it to do what I wanted was frustrating and confusing. Now I've downloaded oscommerce and I think it might work well if I can get the STS installed correctly.

 

The normal oscommerce installed easy with little trouble and I had a basic site I could view ect but I wanted to easily edit it so I downloaded STS. Every time I try to integrate it into oscomerce my store comes back with errors like this

Warning: require(includes/classes/sts.php) [function.require]: failed to open stream: No such file or directory in /home/dudemaaa/public_html/catalog/includes/application_top.php on line 501

 

Warning: require(includes/classes/sts.php) [function.require]: failed to open stream: No such file or directory in /home/dudemaaa/public_html/catalog/includes/application_top.php on line 501

 

Fatal error: require() [function.require]: Failed opening required 'includes/classes/sts.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dudemaaa/public_html/catalog/includes/application_top.php on line 501

 

I'm not sure what I'm doing wrong, I'm using the right files and following the install to the T, I've seen what the template should look like by opening it in dreamweaver, but all I get is errors when i visit my www.wannaspeed.com/catalog here's another error just now

 

Fatal error: Call to a member function add_current_page() on a non-object in /home/dudemaaa/public_html/catalog/includes/application_top.php on line 312

 

Does anyone have an oscommerse STS file already integrated. Seems like that would make it much easier to install. I tried combining the STS/OSC files first on my 3rd attempt and that didn't work either.

 

Been working on just the cart stuff for 2 full days and I'm mentally drained. All I want is an easy way to add products without changing the whole design of my page to some cookie cutter store. Please help.

Share this post


Link to post
Share on other sites

Correct me if I'm wrong - but I am pretty sure there are two sets of instructions in the STS Contribution download. One set for manually adding the contribution - and one set (and folder of files) for those who have not yet modified their osC stores. So if you have not made any modifications, you can follow the set of instructions to simply upload the changed files and follow the instructions.

 

The errors you are getting are mostly telling you that you have not uploaded all the necessary files so it cannot find those files.

 

Myself personally, I would remove the store files from the server (not the database, just the files), then upload a clean osC install and then upload STS using the instructions for stores that are not modified (so you can just upload the already changed files). Follow the instructions and don't forget to turn on STS in Admin area, and then you'll be ready to roll with creating your templates.

 

Does anyone have an oscommerse STS file already integrated. Seems like that would make it much easier to install. I tried combining the STS/OSC files first on my 3rd attempt and that didn't work either.


~Tracy
 

Share this post


Link to post
Share on other sites

How can i make the product listing 2 columsor 3 instead of 1?

 

Tried some things like

<tr>

<td>

$content

</td>

<td>

$content

</td>

</tr>

 

But ain'tworking.

 

Dennis,

Share this post


Link to post
Share on other sites

By installing a contribution - such as this: http://addons.oscommerce.com/info/112

 

How can i make the product listing 2 columsor 3 instead of 1?

 

Tried some things like

<tr>

<td>

$content

</td>

<td>

$content

</td>

</tr>

 

But ain'tworking.

 

Dennis,


~Tracy
 

Share this post


Link to post
Share on other sites

Hi Bill,

 

I'm wondering if you can advise me on this -- I'm using STS with the product info template for content.

 

I'm trying to figure out how i can call the following information and write the following meta tag / link into the <head> of the output:

 

<meta name="title" content="products_name" />

<link rel="image_src" href="products_image" / >

 

Any ideas?

 

Thanks in advance

 

Steven

 

nevermind, i got this sorted, thanks!

Share this post


Link to post
Share on other sites

I'm not currently using that contribution so it would be hard to troubleshoot. Have you posted on the forum for that contribution to see what may cause the problem you are having? Did you make changes to includes/modules/sts_inc/product_info.php ? (sometimes you need to make modifications there as well as catalog/product_info.php) or do you need to make any adjustments to includes/modules/sts_inc/sts_user_code.php ?

 

Have you checked the links in Bill's signature? There is a contributions page where people have posted their code when they use other contributions with STS - there might be one for the products columns and STS contributions already setup.

 

I installed it, if I choose standardit is working! If I'm choosing "COLUMNS" There is nothing coming at all?

What's wrong?


~Tracy
 

Share this post


Link to post
Share on other sites

I'm not currently using that contribution so it would be hard to troubleshoot. Have you posted on the forum for that contribution to see what may cause the problem you are having? Did you make changes to includes/modules/sts_inc/product_info.php ? (sometimes you need to make modifications there as well as catalog/product_info.php) or do you need to make any adjustments to includes/modules/sts_inc/sts_user_code.php ?

 

Have you checked the links in Bill's signature? There is a contributions page where people have posted their code when they use other contributions with STS - there might be one for the products columns and STS contributions already setup.

 

Did you make changes to includes/modules/sts_inc/product_info.php ? (sometimes you need to make modifications there as well as catalog/product_info.php) or do you need to make any adjustments to includes/modules/sts_inc/sts_user_code.php ?

 

No I didn't change anything there? And posted there to? Don't know what it can be? What can I try?

Share this post


Link to post
Share on other sites

No I didn't change anything there? And posted there to? Don't know what it can be? What can I try?

 

Did you notice that this here is the STS forum? It's not the column listing forum. And that since you posted there too (as you say) you don't need to post here again?

 

This here is the place where people discuss their STS issues and they will just get confused by your column issues.

 

But probably you don't care.......

Share this post


Link to post
Share on other sites

Did you notice that this here is the STS forum? It's not the column listing forum. And that since you posted there too (as you say) you don't need to post here again?

 

This here is the place where people discuss their STS issues and they will just get confused by your column issues.

 

But probably you don't care.......

 

My apologize, but it's not working because of STS so thats why I asked it here.

Share this post


Link to post
Share on other sites

My apologize, but it's not working because of STS so thats why I asked it here.

 

 

This is NOT true as STS would not have anything to do with how Products in Columns works. STS will automatically pull in the code that is created by that contribution. I use it in all of my STS installations and I do not have to modify either to make them work together.


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

Hardware > Mices - a different template?

 

Hello!

 

Should I be concerned that when I view Hardware > Mices, it accesses a different template (index.php_1_9.html) than all the other categories?

 

The template I arranged looks like this: http://www.hellodoodle.com/index.php?cPath=1_4

 

And the Hardware > Mices template looks like the default osCommerce set up: http://www.hellodoodle.com/index.php?cPath=1_9

 

None of these default categories will exist when I am done setting everything up, but I am just curious about why that one doesn't use the sts_template.html all the other categories use.

 

Thanks for any input you all can give me!

 

~ Jessica

Share this post


Link to post
Share on other sites

Hardware > Mices - a different template?

 

Hello!

 

Should I be concerned that when I view Hardware > Mices, it accesses a different template (index.php_1_9.html) than all the other categories?

 

The template I arranged looks like this: http://www.hellodood...x.php?cPath=1_4

 

And the Hardware > Mices template looks like the default osCommerce set up: http://www.hellodood...x.php?cPath=1_9

 

None of these default categories will exist when I am done setting everything up, but I am just curious about why that one doesn't use the sts_template.html all the other categories use.

 

Thanks for any input you all can give me!

 

~ Jessica

 

 

Jessica,

 

You are using the sample template folder named "full". This sample set includes a category template as an example (index.php_1_9.html). Since it is in the template set, STS automatically thinks you want to use this template for this category which just happens to be your hardware - mice category.

 

STS is doing what it is supposed to.

 

Please view:

 

Important Posts for the STS newbie:

 

Post #3755: http://forums.oscomm...p;#entry1226986

 

Post #4326: http://forums.oscomm...p;#entry1303555

 

Post #4974: http://forums.oscomm...p;#entry1361366

 

Post #3772: http://forums.oscomm...p;#entry1227769

 

Post #3757: http://forums.oscomm...p;#entry1227006

 

Please review the above for insight on how the Simple Template System allows you to make templates for pages, categories, home page, products and infoboxes.

 

Hope this was helpful,


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

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

×