Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help


Dr. DK

Recommended Posts

Anyone have any idea on how to get the product_info page to show only the attributes that I want?

-----------------------------------------------------------------------

 

Sincerely,

Dr. DK

Link to comment
Share on other sites

Hey WendyJames,

 

Thank you for replying.

Well I have 3 product options which are Size, Color, Genre. I am trying to figure it out because I don't want the Genre to show up on every page at all, so I'm trying to remove it from the product_info.php page. At least that's where I think the code is at. On the product_info.php page it shows me the Additional Options: Size, Color, Genre, etc... Can I have it so that only Size and color will show? I have tried the following code inside the product_info.php but can't figure it out...

Thanks again!

 

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

-----------------------------------------------------------------------

 

Sincerely,

Dr. DK

Link to comment
Share on other sites

If you have set up the attributes using the attribute area in your admin, then you should only have the options showing for each particular item that has it. So if an item does not have a genre, it will not appear on the product information page.

 

You should not have to edit any php coding at all.

 

How did you add the attributes to your products?

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Through Admin. But the thing is that I need the Genre since I have scripped down the search option and enabled the search by genre, so that they can select MALE products and the list will appear. So all of my products will have that attribute set up through admin area you see? And in products_info.php page it fetches all of the attributes and lists them out, but I want to exclude the genre or products_options_id = 2 and products_options_id = 3 only to display!

Does that make any sence?

:-)

Let me know! BTW I got your IM but you are not using it I see...

Thanks!

-----------------------------------------------------------------------

 

Sincerely,

Dr. DK

Link to comment
Share on other sites

Sorry, wish I could help you but I am not all that great with database querries and how to call particular items only. Maybe someone else will know.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...