Zuncan Posted July 13, 2005 Share Posted July 13, 2005 Hi! How can I adjust the number of rows that are displayed in the also purchased box. By deafault its 3 but I want it to be 4. Pls help. Be well / Zuncan Here is the code for also_purchased_products.php: if (isset($HTTP_GET_VARS['products_id'])) { $orders_query = tep_db_query("select p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); $num_products_ordered = tep_db_num_rows($orders_query); if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) { ?> <!-- also_purchased_products //--> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => TEXT_ALSO_PURCHASED_PRODUCTS); new contentBoxHeading($info_box_contents); $row = 0; $col = 0; $info_box_contents = array(); while ($orders = tep_db_fetch_array($orders_query)) { $orders['products_name'] = tep_get_products_name($orders['products_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $orders['products_image'], $orders['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'class="pinkborder"') . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . $orders['products_name'] . '</a>'); $col ++; if ($col > 2) { $col = 0; $row ++; } } So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
Zuncan Posted July 14, 2005 Author Share Posted July 14, 2005 Common.. So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
akosh Posted July 14, 2005 Share Posted July 14, 2005 Change if ($col > 2) { to if ($col > 3) { Link to comment Share on other sites More sharing options...
Zuncan Posted July 14, 2005 Author Share Posted July 14, 2005 Thx man. That did it So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.