TracyS, on Apr 6 2009, 04:31 PM, said:
I'm a bit confused. I am trying to figure out why I don't see my product options next to my slave products on the product_info.php page. I believe the issue is in the includes/modules/master_listing.php file, but I can't seem to figure out what the issue is. I do have a print command that is showing me everything for each slave except for the options
Here's a link showing the results of what I am using. Ignore spacing, as this is NOT normally a slave or an item with options, but the code was broken on my test site, so had to use one of our new production sites.
http://www.pawprintsink.com/bumper-stickers-p-413.html
If the seo link drops, just use pawprintsink dot com.
I am using a slightly modified includes/modules/master_listing.php. Nowhere near as modified as so much of yours is, but below is my file, you can see it working at the above link, at least until Wed. night, at which time I must restore this product back to the original status.
HTH
George
<?php
/*
$Id: master_listing.php GWS
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Maseter products, modified Copyright 2007 George Snell www.ameriwebs.net
Additional Copyrights (c) osCommerce & Suomedia - Dynamic Content Management
Released under the GNU General Public License
*/
$listing_split = new splitPageResults($master_sql, MAX_DISPLAY_SEARCH_RESULTS, 'products_master');
if ( ($listing_split->number_of_rows > 0) && ( (MASTER_PREV_NEXT_BAR_LOCATION == '1') || (MASTER_PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table>
<?php
}
$list_box_contents = array();
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
switch ($column_list[$col]) {
case 'MASTER_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
$lc_align = '';
break;
case 'MASTER_LIST_NAME':
$lc_text = TABLE_HEADING_PRODUCTS;
$lc_align = '';
break;
case 'MASTER_LIST_DESCRIPTION':
$lc_text = TABLE_HEADING_DESCRIPTION;
$lc_align = 'center';
break;
case 'MASTER_LIST_ATTRIBUTES':
$lc_text = TABLE_HEADING_ATTRIBUTES;
$lc_align = 'center';
break;
case 'MASTER_LIST_MANUFACTURER':
$lc_text = TABLE_HEADING_MANUFACTURER;
$lc_align = '';
break;
case 'MASTER_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;
$lc_align = 'right';
break;
case 'MASTER_LIST_QUANTITY':
$lc_text = TABLE_HEADING_QUANTITY;
$lc_align = 'right';
break;
case 'MASTER_LIST_WEIGHT':
$lc_text = TABLE_HEADING_WEIGHT;
$lc_align = 'right';
break;
case 'MASTER_LIST_IMAGE':
$lc_text = TABLE_HEADING_IMAGE;
$lc_align = 'center';
break;
case 'MASTER_LIST_BUY_NOW':
$lc_text = TABLE_HEADING_BUY_NOW;
$lc_align = 'center';
break;
case 'MASTER_LIST_OPTIONS':
$lc_text = TABLE_HEADING_OPTIONS;
$lc_align = 'align="center"';
break;
}
if ( ($column_list[$col] != 'MASTER_LIST_BUY_NOW') && ($column_list[$col] != 'MASTER_LIST_IMAGE') && ($column_list[$col] != 'MASTER_LIST_MULTIPLE') && ($column_list[$col] != 'MASTER_LIST_DESCRIPTION') && ($column_list[$col] != 'MASTER_LIST_OPTIONS') ) {
$lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
}
$list_box_contents[0][] = array('align' => $lc_align,
'params' => 'class="productListing-heading"',
'text' => ' ' . $lc_text . ' ');
}
if ($listing_split->number_of_rows > 0) {
$rows = 0;
$master_query = tep_db_query($listing_split->sql_query);
while ($listing = tep_db_fetch_array($master_query)) {
if ($listing['products_id'] != $listing['products_master']) {
// Separate Price Per Customer
if ($new_price = tep_get_products_special_price($listing['products_id'], $customer_group_id)) {
$products_group_price = tep_get_products_price($listing['products_id'], $customer_group_id);
if (tep_not_null($products_group_price)) {
$listing['products_price'] = $products_group_price;
}
$products_price = '<s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
} else {
$products_group_price = tep_get_products_price($listing['products_id'], $customer_group_id);
if (tep_not_null($products_group_price)) {
$listing['products_price'] = $products_group_price;
}
$products_price = $currencies->display_price($listing['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}
// Separate Price per Customer_eof
// Special out-of-stock routine
if ($listing['seasons_id'] > 0 ) { // If $product_info['seasons_id'] == 0 this entire routine is not run.
$ship = tep_get_seasons($listing['seasons_id']);
switch ($ship) {
case 0:
$products_price = 'sold out';
break;
case 1:
break;
}
}
// Special out-of-stock routine_eof
$rows++;
if (($rows/2) == floor($rows/2)) {
$list_box_contents[] = array('params' => 'class="productListing-even"');
} else {
$list_box_contents[] = array('params' => 'class="productListing-odd"');
}
$cur_row = sizeof($list_box_contents) - 1;
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
$lc_align = '';
$lc_params = '';
switch ($column_list[$col]) {
case 'MASTER_LIST_MODEL':
$lc_align = '';
$lc_text = '<a href="java script:popupWindowProduct(\'' . tep_href_link(FILENAME_POPUP_PRODUCT, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '\')">' . $listing['products_model'] . '</a>';
break;
case 'MASTER_LIST_NAME':
$lc_align = '';
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$lc_text = '<a href="java script:popupWindowProduct(\'' . tep_href_link(FILENAME_POPUP_PRODUCT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '\')">' . $listing['products_name'] . '</a>';
} else {
$lc_text = '<a href="java script:popupWindowProduct(\'' . tep_href_link(FILENAME_POPUP_PRODUCT, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '\')">' . $listing['products_name'] . '</a>';
}
break;
case 'MASTER_LIST_DESCRIPTION':
$lc_align = '';
$lc_text = ' ' . osc_trunc_string(strip_tags($listing['products_description'], '<a><b><em><font><i><s><span><strong><sub><sup><u>'), MASTER_LIST_DESCRIPTION_LENGTH) . ' ';
break;
case 'MASTER_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';
break;
case 'MASTER_LIST_PRICE':
$lc_align = 'right';
/* if (tep_not_null($listing['specials_new_products_price'])) {
$lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
} else {
$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
} */
$lc_text = ' ' . $products_price . ' ';
break;
case 'MASTER_LIST_QUANTITY':
$lc_align = 'center';
$lc_text = ' ' . $listing['products_quantity'] . ' ';
break;
case 'MASTER_LIST_WEIGHT':
$lc_align = 'right';
$lc_text = ' ' . $listing['products_weight'] . ' ';
break;
case 'MASTER_LIST_IMAGE':
$lc_align = 'center';
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$lc_text = '<a href="java script:popupWindowProduct(\'' . tep_href_link(FILENAME_POPUP_PRODUCT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '\')">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
} else {
$lc_text = '<a href="java script:popupWindowProduct(\'' . tep_href_link(FILENAME_POPUP_PRODUCT, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '\')">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
}
break;
case 'MASTER_LIST_BUY_NOW':
$lc_align = 'center';
$lc_valign = 'top';
if ((STOCK_CHECK == 'true')&&(tep_get_products_stock($listing['products_id']) < 1)) {
$lc_text = TEXT_STOCK;
} elseif ((STOCK_CHECK == 'false')&&(tep_get_products_stock($listing['products_id']) < 1)) {
$qty_array = array();
for ($i=0; $ns = 20, $i <= $ns; $i++) {
$qty_array[] = array('id' => $i, 'text' => $i);
$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');
}
} else {
$quantity = tep_get_products_stock($listing['products_id']);
$qty_array = array();
for ($i=0; $ns = (($quantity < 20) ? $quantity : 20), $i <= $ns; $i++) {
$qty_array[] = array('id' => $i, 'text' => $i);
$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');
}
}
if ($products_price == 'sold out') {
$lc_text = '0';
}
break;
case 'MASTER_LIST_OPTIONS':
$lc_align = 'align="center"';
$lc_text = '';
///////////////////////////////////////////////////////////////////////////
// BOF: attribute options
$opt_count=0;
$products_options_name = 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='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "' ORDER by products_options_id");
while ($products_options_name_values = tep_db_fetch_array($products_options_name)) {
$opt_count++;
$products_options_array = array();
$lc_text .= '<b>' . $products_options_name_values['products_options_name'] . '</b><br />' . "\n";
$products_options = 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)$listing['products_id'] . "' and pa.options_id = '" . (int)$products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
while ($products_options_values = tep_db_fetch_array($products_options)) {
$products_options_array[] = array('id' => $products_options_values['products_options_values_id'], 'text' => $products_options_values['products_options_values_name'], 'style' => '');
if ($products_options_values['options_values_price'] != '0') {
$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options_values['price_prefix'] . $currencies->display_price($products_options_values['options_values_price'], tep_get_tax_rate($product_info_values['products_tax_class_id'])) .') ';
}
}
$lc_text .= tep_draw_pull_down_menu('id_'.$listing['products_id'].'[' . $products_options_name_values['products_options_id'] . ']', $products_options_array);
$lc_text .= '<br />';
}
if($opt_count==0) {
$lc_text = MASTER_TEXT_NONE;
}
// EOF: attribute options
///////////////////////////////////////////////////////////////////////////
break;
}
$list_box_contents[$cur_row][] = array('align' => $lc_align,
'valign' => $lc_valign,
'params' => 'class="productListing-data"',
'text' => $lc_text);
}
}
}
new productListingBox($list_box_contents);
} else {
$list_box_contents = array();
$list_box_contents[0] = array('params' => 'class="productListing-odd"');
$list_box_contents[0][] = array('params' => 'class="productListing-data"',
'text' => TEXT_NO_PRODUCTS);
new productListingBox($list_box_contents);
}
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
</table>
<?php
if ( ($listing_split->number_of_rows > 0) && ((MASTER_PREV_NEXT_BAR_LOCATION == '2') || (MASTER_PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS) . ', Group ID = ' . $customer_group_id; ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
?>
<!--<a href="popup_product.php" onclick="popupWindow()" target="_blank"><img src="images/imagex_3.jpg" /></a> //-->














