AndrewC Posted February 8, 2004 Share Posted February 8, 2004 Does anytone know how i can break this info down into a table so i can chage the way its displayed? I want it to look like this page Link Hereand have the prices in the space to the right of the image. HELP! <?php if ($listing_numrows > 0) { $number_of_products = '0'; $listing_query = tep_db_query($listing_sql); while ($listing = tep_db_fetch_array($listing_query)) { $number_of_products++; if (($number_of_products/2) == floor($number_of_products/2)) { $list_box_contents[] = array('params' => 'class="productListing-even"'); } else { $list_box_contents[] = array('params' => 'class="productListing-even"'); } $cur_row = sizeof($list_box_contents) - 1; for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_align = 'center'; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = 'center'; $lc_text = ' ' . $listing['products_model'] . ' '; break; case 'PRODUCT_LIST_NAME': $lc_align = 'center'; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'; } else { $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> '; } break; case 'PRODUCT_LIST_RRP': $lc_align = 'center'; $lc_text = 'RRP: ' . $currencies->display_price($listing['products_price_rrp'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' '; break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = 'center'; $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> '; break; case 'PRODUCT_LIST_PRICE': $lc_align = 'center'; 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 = 'Price: ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' '; } break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'center'; $lc_text = ' ' . $listing['products_quantity'] . ' '; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'center'; $lc_text = ' ' . $listing['products_weight'] . ' '; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], PRODUCT_LISTING_IMAGE_WIDTH, PRODUCT_LISTING_IMAGE_HEIGHT) . '</a>'; } else { $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], PRODUCT_LISTING_IMAGE_WIDTH, PRODUCT_LISTING_IMAGE_HEIGHT) . '</a> '; } break; case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW) . '</a> '; break; } $list_box_contents[$cur_row][] = array('align' => $lc_align, 'params' => 'class="productListing-data"', 'text' => $lc_text); } } new tableBox2($list_box_contents, true); echo ' </td>' . "\n" . ' </tr>' . "\n"; } else { ?> Link to comment Share on other sites More sharing options...
Guest Posted February 20, 2004 Share Posted February 20, 2004 I'm working on that right now.. but i'm stuck with what part controls the image out put for tep_image_button. please read in my tread for more updates. http://www.oscommerce.com/forums/index.php?showtopic=79695 i'm going on overdrive here B) Link to comment Share on other sites More sharing options...
efficiondave Posted March 17, 2004 Share Posted March 17, 2004 Did anyone come up with a good solution to this? I'm trying to make my product listing look more like the new products list on the front page. Link to comment Share on other sites More sharing options...
Guest Posted March 18, 2004 Share Posted March 18, 2004 there is a contribution that'll help you do this. I've used it on the site I'm building at the moment, but I can't remeber what it's called! Sorry. I did a quick contrib search & couldn't find it, but it's there somewhere...You can see what I've done with it here. If you cna't find the contrib, I'll give you my files if you want (though there's other customisations in there too, I'm afraid...) Link to comment Share on other sites More sharing options...
efficiondave Posted March 19, 2004 Share Posted March 19, 2004 I think I found it. Is this the one you're using? http://www.oscommerce.com/community/contributions,112 Link to comment Share on other sites More sharing options...
Guest Posted March 19, 2004 Share Posted March 19, 2004 yup. that's the one!! After installing it, I dug around in the code and was able to build a nice little table for each item, which I'm quite chuffed with. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.