Jump to content
Sign in to follow this  
amandat

Featured Products - Not random?

Recommended Posts

I am the Featured Products Contribution and notice that the products randomly come up and the order changes with each refresh.

 

I do not want that to be random and actually want a few products always at the very top. Is there a way to do this with this contribution? Make it so it is not random?

 

Thanks,

Amanda

Share this post


Link to post
Share on other sites

yes change the order by in the query from rand() to product_id or to sort_order


No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites

in which file? and how can i set the sort order then in the admin-area?

 

furthermore: how may i change it to 4 columns and 3 rows of displayed products?

Share this post


Link to post
Share on other sites

i guess the 4 columns-thing has to be changed here somehow:

file: /catalog/featured_products.php

place:

	while ($featured_products = tep_db_fetch_array($featured_products_query)) {
  if ($new_price = tep_get_products_special_price($featured_products['products_id'])) {
	$products_price = '<s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>';
  } else {
	$products_price = $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id']));
  }
?>
	  <tr>
		<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
		<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '"><b><u>' . $featured_products['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($featured_products['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $featured_products['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
		<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
	  </tr>
	  <tr>
		<td colsp?an="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
}

can u help please?

Share this post


Link to post
Share on other sites

Just look for "if ($col > 2) {" in includes/modules/featured.php and change the 2 for 3 ...

 

But now the columns are "out of place" (sorry for my english) as you can see in www.toysoldiermaquetas.com. Any solution?

Share this post


Link to post
Share on other sites

ok everithing is ok now :lol:

 

After changing the $col> to 3 you must find in includes/modules/featured.php this .... 'class="smallText" width="33%" valign="top"', and change the 33% for 25%

 

.... it was so easy ... :rolleyes:

 

Regards from Spain :thumbsup:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×