Informundo Posted October 28, 2004 Share Posted October 28, 2004 I use a contribution Product Listing in columns. I listen to have a demo of compare products that work with this contribution. This is my code in product_listing_col: <?php DEFINE('PRODUCT_LIST_COL_NUM',2); $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (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 } $info_box_contents = array(); if ($listing_split->number_of_rows > 0) { $row = 0; $col = 0; $listing = tep_db_query($listing_split->sql_query); while ($listing_values = tep_db_fetch_array($listing)) { $listing_values['products_name'] = tep_get_products_name($listing_values['products_id']); $lc_text= '<table border="0" widht="120" align="top"><tr><td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> </td><td valign="middle" class="CarritoCabecera"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_name'] . '</a></td>'; if ($col<1) { $lc_text .= '<td rowspan="2" background="./images/template/h1_vertical.jpg"> </td></tr>'; } else { $lc_text .= '</tr>'; } if ($listing_values['specials_new_products_price']) { $lc_text .= '<tr><td class="CarritoCabecera" align="center"> <s>' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing_values['specials_new_products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</span> </td>'; } else { $lc_text .= '<tr><td class="CarritoCabecera" align="center"> ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . ' </td>'; } if (PRODUCT_LIST_BUY_NOW) { $lc_text .= '<td align="right"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</a> </td></tr></table>'; } $lc_text .= '<img src="./images/template/h1_horiz.jpg" align="left"></img>'; $info_box_contents[$row][$col] = array('align' => 'right', 'params' => 'class="smallText" width="50%" valign="top"', 'text' => $lc_text); $col ++; if ($col > PRODUCT_LIST_COL_NUM-1) { $col = 0; $row ++; } } new contentBox($info_box_contents); } else { $info_box_contents = array(); $info_box_contents[0] = array('params' => 'class="productListing-odd"'); $info_box_contents[0][] = array('params' => 'class="productListing-data"', 'text' => TEXT_NO_PRODUCTS); new contentBox($info_box_contents); } if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <table width="100%"> <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 } ?> Can someone help me to adapt this contribution Thanks and sorry for my english. I?m spanish. My web is www.informundo.com Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.