Re: Ordering Products

iiinetworks <[email protected]>
Newsgroups gmane.comp.web.oscommerce.features
Message-ID <c38d24a0f84feb9b71c3b1b836ec93d7@osCommerce-Forums>
This message was sent from: Features
http://forums.oscommerce.com/viewtopic.php?p=194955#194955
----------------------------------------------------------------

[code]for ($row=0, $col=0, $info_box_contents = array(); $row < 3; ) {
    $info_box_contents[$row][$col] = array('align' => 'center',
                                 		 'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id'], 'NONSSL') . '">' . $random_product['products_name'] . '</a><br>' . $rprod_price);


    new infoBox($info_box_contents);
    $col ++;
    if ($col > 2) {
      $col = 0;
      $row ++;
    }
}[/code]
Hth,
Matt

P.S.  MAX_RANDOM_SELECT_NEW does not make the results any less random.  Btw, you still need to add code changing from product to product among those selected from the database.  This code should print the same product nine times--let me know if it does that.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.