OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Show Multiple Product Attribute Options in Columns
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Tips and Tricks
ryecandy
Have you ever had a problem showing multiple (organized) attributes on your osC Product_Info page? I have, it bugged me but adding 2 small pieces of code solved everything!
My example shows how 14 different Attribute Options become presented:
This is how the 14 Attributes look with my Fix:
THE FIX

INSERT this code at approx. line 128 (Before <table border="0" cellspacing="0" cellpadding="2">):
CODE
<!-- Organize Attribute into Columns Fix Opens Here --><?php $attribute_count = 1; ?><!-- Organize Attribute into Colums Fix Closes Here -->

REPLACE THIS CODE at approx. Line 150:
CODE
    <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>

WITH THIS CODE:
CODE
<!-- Organize Attribute into Columns Fix Opens Here -->
              <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>      
<?php
if ($attribute_count == 1){  
echo "<td width=7%></td>";
$attribute_count = $attribute_count + 1;}
elseif ($attribute_count == 2){
  echo "</tr>";
  $attribute_count = $attribute_count - 1;}
?><!-- Organize Attribute into Columns Fix Closes Here -->


Thats it!
This code fixed the Attributes for all of my products... ...And I haven't seen anybody give it out yet. thumbsup.gif
{My first php fix. Please tell me what you think}
tanicos
really great thanks!!! Is there a way to put something above them? Like some titles?
tanicos
hmm...sorry it does not work for me...just tested it
ryecandy
QUOTE (tanicos @ Apr 16 2008, 12:15 PM) *
really great thanks!!! Is there a way to put something above them? Like some titles?
Sure, you could put what ever you want above the attributes. Just add it to your code somewhere {ie. after a <table><tr><td> tag} above the lines are that you edited eariler. You can add whatever HTML code you'd like into the product_info.php website to spruce it up.
ryecandy
QUOTE (tanicos @ Apr 16 2008, 02:19 PM) *
hmm...sorry it does not work for me...just tested it
What did it do? blink.gif
Can somebody please confirm 'it does not work' and leave details about what the error, problem or part that 'doesn't work' does? thumbsup.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.