Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Warning: main(includes/sts_product_info.php): failed to open stream: No such file or directory in /atexvhxu/www.atenzio.de/catalog/includes/sts_display_output.php on line 134

 

I checked line 134 in my sts_product_info.php.

Then I inserted a path like this:

/////////////////////////////////////////////
////// if product_info.php load data
/////////////////////////////////////////////
if ($scriptbasename == 'languages/german/product_info.php') {
 require(STS_PRODUCT_INFO);
}

After I uploaded the changed file, the warning message didn't show up again.

Instead the product info page showed up (generated from the sample template).

Everything looked fine except the content area. Instead of the content only the variables appeared.

Then I copied my sts_template.html to the sts_templates directory, and renamed it to replace the old product_info.php.html file.

And guess what - it works!

I'm not sure if I solved the problem the right way, but maybe someone of you guys can tell me?

 

Cheers, Tim

 

Hi there,

I'm facing exactly the same problem as described below.

Meanwhile I've searched the whole forum, but I couldn't find a solution for my prob. I really hope that there is someone out there who can help me, because I spent already a couple of weeks on this problem, and I really don't know what to do.

So pleeeeaase, give me a hint!

 

Cheers, Tim

Link to comment
Share on other sites

Hello,

 

I'm using STS with Password Without Account (PWA).

 

Has anyone else used these two contributions together?

 

My problem: When someone purchases without account they can resume shopping after checking out and their session is still active--so if there is a "My Account" link somewhere, they can click on it and access features they shouldn't.

 

There is a mod to PWA that supposedly fixes this, conditionally displaying the "My Account" and/or "Logoff" link. However, it isn't working for me, and I'm wondering if it is STS-related.

 

Anyone willing to please give me a hand here?

 

Thanks!

 

- James

Link to comment
Share on other sites

Brian - HELP,

 

Without sounding like a Kiss Ass - Great Contribution.

 

I'm fumbling through configuring my site, but I'm stuck on the Product_Info.php.html file.

 

I need to show a Product Qty box in the Product_Info.php.html template, so when the "Add to Cart" button is clicked quantities higher than 1 can be added.

 

 

http://brencham.biz/catalog/

 

Any Assistance Greatly Appriciated.

 

Was this asnwer ever given? It would be nice if someone can dig this up. Although when the quantity is set, to have it automatically refresh it self to allow the costumer better interface.

 

Anyone care to elaborate?

 

Dark

Link to comment
Share on other sites

Was this asnwer ever given?  It would be nice if someone can dig this up.  Although when the quantity is set, to have it automatically refresh it self to allow the costumer better interface.

 

Anyone care to elaborate?

 

Dark

 

Here is what I did. Its working fine for me.

 

in catalog/product_info.php on line 213:

 

replace:

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

with:

<td class="main" align="right"><?php echo TEXT_QUANTITY . tep_draw_input_field('quantity', '1', 'SIZE=2 maxlength=2') . tep_draw_separator('pixel_trans.gif', '5', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'); ?></td>

 

in catalog/includes/application_top.php on line 358:

 

replace:

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

 

with:

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+ (int)$HTTP_POST_VARS['quantity'], $HTTP_POST_VARS['id']);

 

in catalog/includes/languages/english/product_info.php on line 21 (and any other language you use):

 

after:

define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');

 

add:

define('TEXT_QUANTITY', 'Qty:');

 

Taken from the qty_field_in_prod_desc.txt from the contribution. Modified from Brandon Clark's version, which was built off of Sean Wang's and Doug Murray's versions.

http://www.oscommerce.com/community/contri...asy+way+add+Qty

Link to comment
Share on other sites

Hi, I am using STS Template systems in my shopping cart.

 

I defined

 

<body marginwidth="0" marginheight="0" topmargin="0">

in sts_template.html

 

also in stylesheet.css

 

however, I am seeing lots of gap's at the top and left side

 

how do I fix this problem

thanks

Link to comment
Share on other sites

Here is what I did. Its working fine for me.

 

in catalog/product_info.php on line 213:

 

replace:

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

with:

<td class="main" align="right"><?php echo TEXT_QUANTITY . tep_draw_input_field('quantity', '1', 'SIZE=2 maxlength=2') . tep_draw_separator('pixel_trans.gif', '5', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'); ?></td>

 

in catalog/includes/application_top.php on line 358:

 

replace:

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

 

with:

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+ (int)$HTTP_POST_VARS['quantity'], $HTTP_POST_VARS['id']);

 

in catalog/includes/languages/english/product_info.php on line 21 (and any other language you use):

 

after:

define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');

 

add:

define('TEXT_QUANTITY', 'Qty:');

 

Taken from the qty_field_in_prod_desc.txt from the contribution. Modified from Brandon Clark's version, which was built off of Sean Wang's and Doug Murray's versions.

http://www.oscommerce.com/community/contri...asy+way+add+Qty

 

 

How is it possible inserting that into a product info template? I already did the required modifications, but the in the product STS template is not done correctly.. Any idea how to do that? Thanks.

Link to comment
Share on other sites

How is it possible inserting that into a product info template?  I already did the required modifications, but the in the product STS template is not done correctly.. Any idea how to do that?  Thanks.

 

I use the product_info.php template if thats what your referring too. What I did was copy the query code from product_info.php and then pasted that into a quantity.php file along with the code to draw the form up for the product. I then made a new variable out of this $quantity. The quanitity.php I put in the boxes directory. I haven't gone through the query and took out what was not needed as I have not had time. Such as the option information for the product and so on. But below is what my quantity.php looks like

 

<?php
$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_pop, 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 . "'");
   $product_info = tep_db_fetch_array($product_info_query);

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

   if (tep_not_null($product_info['products_model'])) {
     $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'];
   }
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {

     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
       while ($products_options = tep_db_fetch_array($products_options_query)) {
         $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
         if ($products_options['options_values_price'] != '0') {
           $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
         }
       }

       if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
         $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
       } else {
         $selected_attribute = false;
       }
     }
}
?>
<td bgcolor="#97BB62" style="border: 1px solid #FF6600; padding: 0">
<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>
        	 <p align="center">
        	 <b>
        	 <font color="#000000" face="Arial" size="2">
        	 Purchase Pistachios Delivered Fresh!</font></b><br><br>
        	 <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>
        	 <b><font color="#000000" face="Arial" size="2"><br>
        	 Quantity: </font></b>
        	 <font face="Arial" color="#000000">
             <input type="text" name="quantity" maxlength="2" size="2" style="font-weight: 700; border: 1px solid #FF6600; padding: 0" value="1"><b><font size="2"> 
        	 bag(s)</font></b></font>

</form></td>

 

I'm not even sure you need the query information as I just started with all information and it worked from that point. I haven't gone through to see what is not needed. Obviously you would want to change the look of your quantity box as mine is done to match the theme of the site. Hope this helps you

 

-Dennis

Link to comment
Share on other sites

Is it possible to pull PRODUCT ATTRIBUTES directly from the STS product_info file?

 

I'm sure it's as simple as pulling the attribute, then attaching it to a variable, but I'm not well versed in php.... :(

 

Example: Each category will have it's own product_info file. All the hard drives will use the same file and will contain the same variables like this.

 

Product Model : $product_model

Capacity (GB) : $hd_capacity

Speed (RPM) : $hd_speed

Cache (MB) : $hd_cache

Warranty : $hd_warranty

 

Question is how do I attach the variable $hd_capacity using the STS system so it'll associate w/the product attribute in the product tables?

 

Many thanks, and hopefully I won't lose all my hair over this.

 

EDIT EDIT EDIT BELOW...

 

It just struck me. If there could be variables like $productdesc in the product_info file, I can just duplicate that method and attach all the other variables!?!

 

Am I on the right path????

Edited by rarrar
Link to comment
Share on other sites

I was wondering if it is possible to modify the infoboxes to a certain look. I have being redesigning the main content, but I haven't figure out how to skin the infoboxes or the infoboxes headers and footers. Plus the new products I am looking at skinning each box.. Is it possible?

 

Can anyone help with that?

Link to comment
Share on other sites

In sts_display_output, I'm trying this code. Does it make sense to anyone?

 

/////////////////////////////////////////////

////// if product_info.php load data

/////////////////////////////////////////////

if ($scriptbasename == 'product_info.php') {

require(STS_PRODUCT_INFO);

 

if ($cPath == "") {

$sts_cpath = 0;

} else {

$sts_cpath = $cPath;

}

 

$sts_check_file = STS_TEMPLATE_DIR . "product_info.php_$sts_cpath.html";

 

if (file_exists($sts_check_file)) {

// Use it

$scriptbasename = $sts_check_file;

$sts_template_file = $sts_check_file;

}

}

 

Basically, I want to have product_info pages based upon different categories in similar fashion to the custom categories.

 

Basically, product_info.php_1.html, product_info.php_30.html, etc, etc.

 

The parts in bold are my main problems. Heck, I'm not even sure if the rest of the code works.

 

PS: I'm trying my best, lol.

Link to comment
Share on other sites

Why is none of my content showing up? I just get one tag to show but nothing else shows.

 

http://oneribpublications.com/home/catalog/

 

I have all the tags in place. What Have i done wrong?

 

 

Looks like you installed header tags when you shouldn't have in application top. Not sure but thats what it seems like.

 

-Dennis

Link to comment
Share on other sites

How is it possible inserting that into a product info template?  I already did the required modifications, but the in the product STS template is not done correctly.. Any idea how to do that?  Thanks.

 

$addtocartbutton is all I have in my template. One of the mods I quoted above puts a text box next to the add to cart button.

 

I am currently working on this storefront - I hope to be finished with it by mid next week.

 

http://www.impeccablecollectibles.com

 

:)

 

Deborah

Link to comment
Share on other sites

Looks real good, what kind of menu is that?

 

-Dennis

 

Hi Dennis,

 

Its DHTML. I started with the program from Aaron Boodman (youngpup.net/code) and took bits and pieces to make the dropdowns work out. Everything else is straight OSC MS2.2.

 

The top cats are static to go with the design, but the subcats are pulled from the database. I still have to put in a dynamic height function to allow the height to be determined by the number of subcats, and I am still arguing with Firefox on the positioning. It looks OK in IE. I havent checked the other browsers and I am afraid it will look bad so dont tell me if it does ok?

 

;)

 

The client is just now starting to give me more images and descriptions, so I am hoping it will fill up soon.

 

I did not design the graphics, but I did do all of the backend code. Each time I do one of these I learn more about PHP and Osc in general. I am having a good time and that makes it easier to work through the bugs.

 

Thanks!

 

Deborah

Link to comment
Share on other sites

some one please help me with this problem.......

 

Hi, I am using STS Template systems in my shopping cart.

 

I defined

 

<body marginwidth="0" marginheight="0" topmargin="0">

in sts_template.html

 

also in stylesheet.css

 

however, I am seeing lots of gap's at the top and left side

 

how do I fix this problem

thanks

Link to comment
Share on other sites

Excellent contribition!!

 

I have everything working and am now setting up the layout of my store.

 

However I don't seem to be able to change the The layout of Category box.

I creat new image for The Category box and set "$categorybox" inside of this table. it will show both new image and orginal Oscommerce blue box.

 

How to make this change?? Please help!!! :o

 

 

 

You can't change the box layout with STS.  You'd have to change the stylesheet and/or the PHP script that creates the boxes depending on what you want to change.

 

  - Brian

Link to comment
Share on other sites

This contribution is working great, but I need to modify one page and can't figure out how to use the system to do it. When someone clicks on a main category in the left nav, it takes them to that top category page that displays the subcategories along with a small image. If they click on the subcategory link, it takes them to a page that shows all products within that subcategory. The products are displayed in rows (one product per row) along with a Buy button, etc. I want this page to display the product images two in a row with the name of the product underneath. Is it possible to do this with STS?

 

Also, I have used an STS template to change the layout of the product_info pages but was wondering how I would include a Click to Enlarge link to bring up the popup window with the larger image version.

 

Thanks.

Link to comment
Share on other sites

I have been using the Banner in a Box Contribution located here.

 

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

 

You will need to add the the normal STS code to your template just like you were adding another info box to any of your columns.

 

This banner in a box works great and it controlled by your normal banner manager in admin. All instructions are included with contribution zip files.

 

Good Luck

 

 

Is this the solution if i use STS and wants to simply be able to display 2 or more differerent larger sized banners at the same time on the index page and in the bottom of the product page (smaller sized banner) ?

 

I would prefer to not have the banner inside a box but, rather be able to diplay more then one banner and ofcourse the correct banner must be displayed in the correct langage.

 

Thank you for reading :)

 

Best regards Johan

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