Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product attributes not displaying on product description page - why?


CLRH2O

Recommended Posts

So here's my conundrum:

 

http://www.collectiveindustries.com/format...p?products_id=1

 

That product has 2 attributes assigned to it. One is "Download" and " Yes" (which I use as a hidden value that's passed to the shopping_cart.php file upon adding the item to cart) and the other is just a test attribute that has a few choices. (it is Color and a few colors so it has a drop down - again, this is all just for testing).

 

Problem is, as you can see from the link provided, this product's attributes are NOT being shown on the product description page (product_info.php). And I cant figure out why?!

 

I'm using STS Plus v4.06 and some admin side bits such as improved cache control ect. but nothing that related directly to products and attributes. So, why would my attributes not be pushed to display on screen as user selectable dropdown choice jobbys like they are supposed to?

 

If anyone understands what I'm talking about - I will be MORE than willing to answer any questions you might have for me. Thank you in advance :D

Link to comment
Share on other sites

You know.... It's funny. I've made some of the most widely regarded "custom" osc sites in terms of interface replacement and page design on the whole of the web over the years.... as a result it seems that every time I encounter a problem and ask for assistance on the boards here I'm asking something above and beyond the scope of normal OSC users.....

 

So to have them not reply - I understand. But with that in mind, I would have guessed that the master's would be happy to have a question worth answering to chew on.

 

But here this is, 3 days later and 7 pages deep without so much as TEN VIEWS!... let alone an answer or even a speculation as to what the cause of this problem is.

 

Hello... IS THING ON!??!

Link to comment
Share on other sites

Is this thing on or what? I refuse to believe that there are NO people here who have a clue as to why the product attributes aren't displaying on that page (the one I link to as my example....)

 

What gives? Hello... is anyone alive in here (you must be as this thread gets pushed off the front page within hours every day.... and has been repeatedly since the 7th of Sept when I first asked for some help)

Link to comment
Share on other sites

Dude I don't have an answer but I understand your frustration as I'm in the same boat waiting for an answer to what is seemingly a simple question! Sorry I can't help but you're not alone! :)

 

Cheers to that man, cheers to that!

 

What's your situation? Heck... maybe I have something useful to give for you. At least that way one of us is getting something out of this forum now ;D

Link to comment
Share on other sites

Cheers to that man, cheers to that!

 

What's your situation? Heck... maybe I have something useful to give for you. At least that way one of us is getting something out of this forum now ;D

 

Wish I could help you but I'm pretty new to most of this!

http://www.oscommerce.com/forums/index.php?showtopic=277133 - just trying to add a text box!?

Link to comment
Share on other sites

Can you post your product_info.php please?

 

Sure thing:

 

 

<?php
/*
 $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 $product_check_query = tep_db_query("select count(*) as total 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_check = tep_db_fetch_array($product_check_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>><head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<meta name="robots" content="index,follow">
<meta name="Description" content="Put your description here - match it to what is on the page">
<meta name="Keywords" content="Put your keywords here - match to keywords on the page">
<meta name="Author" content="Put Copyright notice here">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"><div class="body">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
 if ($product_check['total'] < 1) {
?>
     <tr>
       <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
     </tr>
     <tr>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 } else {
   $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 . "'");
   $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'];
   }
?>
     <tr>
       <td><table border="0" valign=top width="100%" cellspacing="0" cellpadding="0">
         <tr>
          </tr>
       </table></td>
     </tr>
     <tr>
    </tr>
     <tr>
       <td class="main">
<?php
   if (tep_not_null($product_info['products_image'])) {
?>
         <table border="0" cellspacing="0" cellpadding="2" align="right">
           <tr>
             <td align="center" class="smallText">              </td>
           </tr>
         </table>
<?php
   }
?>
         <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php

if (OPTIONS_AS_IMAGES_ENABLED == 'false'){

   $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) {
?>
         <table border="0" cellspacing="0" cellpadding="2">
           <tr>
             <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
           </tr>
<?php
     $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 . "' order by pa.attribute_sort");


       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;
       }
?>
           <tr>
             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
           </tr>
<?php
     }
?>
         </table>
<?php
   }

//Options as Images. Add the curly bracket as shown on the next line
}
?>
<?php
//Options as Images. This whole php clause needs to be added
if (OPTIONS_AS_IMAGES_ENABLED == 'true') include ('options_images.php'); 
?></td>
     </tr>






     <tr>
    </tr>
<?php
   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   $reviews = tep_db_fetch_array($reviews_query);
   if ($reviews['count'] > 0) {
?>

     <tr>
     </tr>
<?php
   }

   if (tep_not_null($product_info['products_url'])) {
?>
     <tr>
       <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
     </tr>
     <tr>
     </tr>
<?php
   }

   if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
     </tr>
<?php
   } else {
?>

<?php
   }
?>
     <tr>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
         </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
     </tr>
     <tr>
       <td>
<?php /*?><?php
   if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_also_purchased(3600);
   } else {
    ;
   }
 }
?><?php */?>

<?php
 }
?>
       </td>
     </tr>
   </table></form></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</div>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

Isn't the "Options as Images" ability a third party add in contribution? Meaning something that is not included in the v2.2 ms OSC release? If so - then there is for sure no way it's turned on because I have never installed that contribution. This was also the reason I inquired to you about why you asked about that.

 

if it is built in to the ms 2.2 release..... where is it's setting located in the admin panel? I don't see it's configuration option anywhere in the admin area for this stores install.

 

And yet - looking more closely at my own product_info.php code.... sure enough there is a refference to an installation of that contribution that I have no idea how how it got there :/

 

And thank you for posing a possibility on this for me. I seriously appreciate it :)

Link to comment
Share on other sites

I removed that little bit of code relating to the options as images stuff (still uncertain as to how it got there but I do work with like 30 different OSC installs........ so who knows anymore). and I've taken a Screen Shot of what the attributes are that I have turned on for the product link above were looking and testing with:

 

formation_attributes.jpg

 

as you can no doubt tell by looking at the products page on the website - these attributes, even though assigned to this product are not being displayed to the page at all. OSC is ignoring them in regard to giving the drop downs for the customers to utilize. The one attribute that will always be added to the cart with the product is the "download / yes" attribute because I've hard coded an invisible value into the product description it's self to see if OSC was passing any attribute values along when the product was added to the cart. And it IS - so OSC obviously sees that attributes are there, and when told to add them does....

 

I just wont display the friggin drop downs like it's supposed to be doing :/

Link to comment
Share on other sites

How do I check the query results - Where is that data stored so that I'm able to read through it? My apologies if that seems like a dumb question, but I'll need to be told in order to see.

 

And yes, the part I removed from the page code was:

 

//Options as Images. Add the curly bracket as shown on the next line

 

and

 

<?php

//Options as Images. This whole php clause needs to be added

if (OPTIONS_AS_IMAGES_ENABLED == 'true') include ('options_images.php');

?>

 

but in order for the page to still work I had to leave the:

 

 

}

?>

 

which was under the first comment as it was part of the standard page code no doubt.

Link to comment
Share on other sites

In which document is the "tep_db_fetch_array()" found? I've scoured through product_info.php in both catalog and includes. index.php in both as well as in languages (and in my case English) and number of other files. I wish I still remembered how to do the grep thing in SSH :/

Link to comment
Share on other sites

Disregard what I typed just above. I wasn't thinking and was perching for an explicit () marks like you'd typed. Instead of thinking it through and seeing that (duh) obviously something goes in there. And that said I've found all the different instances of the tep_db_fetch in product_info.php (and many many other files too. I'm working now on getting something to display on screen though - as using thew print command isn't yielding anything at all to the browser to view :/

 

And that certainly is odd

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...