Red5 Posted May 29, 2005 Share Posted May 29, 2005 Hi, I?ve been using osCommerce for about 2 days now, its great! However, I?m having a slight problem with Attribute formatting. I?m using Dreamweaver to format my product?s technical information and specifications as follows, 5 column table, the 1st and last columns are used as spacers to make the page look pretty the middle 3 columns are used to display formatted text. I then paste the formatted HTML in to the 'Product Description' section. Some of my products give the customer the option to ?upgrade? a given component, say a larger hard disk or monitor. Os then adds a list of available options to the page when its loaded ?which it should?. This is where my problem starts, I want to be able to format the available options in-line with my Dreamweaver formatting. At the moment customer options are being loaded on the page depending on how many <p></pr>?s I put at the end of my HTML code. Anyone have any ideas? Thanks in advance Link to comment Share on other sites More sharing options...
FalseDawn Posted May 29, 2005 Share Posted May 29, 2005 You would need to find the section of php code that spits out the options listing (in product_info.php), and include this in Dreamweaver as a php block somehow. Link to comment Share on other sites More sharing options...
Red5 Posted May 29, 2005 Author Share Posted May 29, 2005 You would need to find the section of php code that spits out the options listing (in product_info.php), and include this in Dreamweaver as a php block somehow. <{POST_SNAPBACK}> Greek! :-) I've had a look at the product_info.php and to be honest it doesn't mean much to me.. Link to comment Share on other sites More sharing options...
FalseDawn Posted May 29, 2005 Share Posted May 29, 2005 This is the code. The options are created dynamically between the fisrt and last <table> </table> tags I don't use Dreamweaver for OSC so don't know exactly how you would go about achieving what you are after. Your best bet might be to try to modify product_info.php outside of Dreamweaver to get the options to appear where you want. <?php $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 . "'"); 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> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.