Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Expanding the Whats New Info Box


mark27uk3

Recommended Posts

Hi Guys,

 

If you look here you will see I have modified my whats new box a little.

 

What I would really like to have is maybe four or five new products displayed in the box, one on top of the other. There are two problems that I have which I can not resolve.

 

1. How to stop the same product displaying twice

 

and

 

2. How to finish the end of the statement off so I can copy this statement over (if thats the right way of doing it!)

 

'text' => '<b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</b></a><br><br>' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><font color="#ff0000"><b>' . TEXT_OUR_PRICE . '</b></font>  ' . $whats_new_price);

 

This is the full code from the whats_new.php box, if anyone can help with this then I would appreciate it.

 

if ($random_product = tep_random_select("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)) {
?>
<!-- whats_new //-->
         <tr>
           <td>
<?php
   $random_product['products_name'] = tep_get_products_name($random_product['products_id']);
   $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);

   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW);

   new infoBoxHeading($info_box_contents, true, true, tep_href_link(FILENAME_PRODUCTS_NEW));

   if (tep_not_null($random_product['specials_new_products_price'])) {
     $whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br>';
     $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
   } else {
     $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
   }

   $info_box_contents = array();
   $info_box_contents[] = array('align' => 'center',
                                'text' => '<b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</b></a><br><br>' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><font color="#ff0000"><b>' . TEXT_OUR_PRICE . '</b></font>  ' . $whats_new_price);

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

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Warning: mysql_connect(): Too many connections in /home2/mobiacc/public_html/includes/functions/database.php on line 19

Unable to connect to database server!

 

:-"

Petter - Arktisk Pudder

Link to comment
Share on other sites

This is a problem caused when there a lot of people trying to access the mysql server at once over a lot of sites.

 

Please keep trying.

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

I have now managed to get the box to display more than one product, I could now do with some help as to how to stop it showing duplicate products.

 

Does anyone know how to do this last little bit?

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

This is driving me crazy!

 

No matter what I do I can not seem to have three different products displayed in my whats new box!

 

I am quickly running out of hair!

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Still no joy with this, it has got to be so simple - so if one of you kind people can help me then please do!

 

Thanks

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Hi mark,

 

im not sure about your question, but when i was looking at your site( and it looks great) when i hover over your logo 24-7 it comes up with oscommerce, change it in header php where half way down after image you will see oscommerce, change it too what you like, something about your site.

 

good luck

Link to comment
Share on other sites

Hi David,

 

All this time I had not even noticed that I had not changed the alt text, thank you for pointing this out.

 

This problem I have with the whats new box showing all the same product is causing me great pains!

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

i can see, i havent a clue, but have you checked contributions ? and the only good advice i can give you, three people in here that i know are web masters but none of them are here at the moment, wait till later then ask again im sure one of them can help

 

cheers mate

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...