Jump to content
Sign in to follow this  
Insane

Help please ;) with whats new box...

Recommended Posts

Hi all,

I tried to find a scrolling Whats new box in contributions but couldn't so I tried to convert the scrolling specials box... Now I got 99% of it work but cant for the life of me work out why the product name & its link wont display.. The pic (it has the link working) and the price show up but yer the name has stumped me...

 

Could anyone please find it in their heart to have a look at the following code and tell me where I went wrong?

 

Thanks In Advance

Adam

 

 

/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 $rp2_query = tep_db_query("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);
 if (tep_db_num_rows($rp2_query)) {
?>
<!-- specials //-->
         <tr>
           <td>
<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW);

   new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_WHATS_NEW));

   while ($random_product = tep_db_fetch_array($rp2_query)) {
$rp2 .= '

<center>

<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']) . '">' . $random_product['products_name'] . '</a>

<br>

<span class="productSpecialPrice">' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
$rp2 .= "</SPAN><BR /><BR />\n***********\n<BR /><BR />";
   }

   $info_box_contents = array();
   $info_box_contents[] = array('align' => 'center',
                                'text' => '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "20" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$rp2.'</span></MARQUEE>');

   new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- specials_eof //-->
<?php
 }
?>

Share this post


Link to post
Share on other sites

Change the database query to:

 

$rp2_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' ?and pd.products_id = p.products_id order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);

 

Matti

Edited by Johnson

Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites
Change the database query to:

 

$rp2_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' ?and pd.products_id = p.products_id order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);

 

Matti

 

 

CHAMPION !!! Thanks so much, it was doing my head in...

 

Adam

Share this post


Link to post
Share on other sites

could someone show me how to change this to a whats new infobox that scrolls sideways rather than up and down? I tried changing the direction from "up" to "left" and that works except for there re 10 rows of products shown in the box instead of one continual row.

 

Thank you very much. and Adam, maybe you should make this a contribution? I'm sure others would appreciate your work !

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  

×