Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Trouble Pulling In Product Description


yt_boy

Recommended Posts

Hi all,

 

i hope someone can help...

 

i am trying to pull in the product description for Specials Products into the following code (so it shows the picture image, Product Name, brief description (say 150 characters) and then more info if necessary

as well as the special price )

 

i cannot for the life of me get the damn thing working, can anyone help?

 

code is as follows:

 

//new contentBoxHeading($info_box_contents);
if ( (!isset($special_products_category_id)) || ($special_products_category_id == '0') ) {
$sql = "select distinct p.products_id, p.products_quantity, p.products_image, p.products_model, p.products_tax_class_id, p.products_weight, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from " . TABLE_PRODUCTS . " p left join ".TABLE_SPECIALS." s on p.products_id = s.products_id left join ".TABLE_MANUFACTURERS." mnf on p.manufacturers_id = mnf.manufacturers_id left join ".TABLE_REVIEWS." rvw on p.products_id = rvw.products_id where p.products_image !='' and p.products_status = '1' order by RAND() limit ".MAX_DISPLAY_SPECIAL_PRODUCTS;
$special_products_query = tep_db_query($sql);

} else {
$sql = "select distinct p.products_id, p.products_quantity, p.products_image, p.products_model, p.products_tax_class_id, p.products_weight, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join ".TABLE_MANUFACTURERS." mnf on p.manufacturers_id = mnf.manufacturers_id left join ".TABLE_REVIEWS." rvw on p.products_id = rvw.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_image !='' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$special_products_category_id . "' and p.products_status = '1' order by RAND() limit " . MAX_DISPLAY_SPECIAL_PRODUCTS;
$special_products_query = tep_db_query($sql);
}

 $row = 0;
 $col = 0;
 $info_box_contents = array();
 while ($special_products = tep_db_fetch_array($special_products_query)) {
$showspecial = ($special_products['products_price'] != $special_products['products_prix']) ? '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $special_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $special_products['products_image'], $special_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $special_products['products_id']) . '">' . $special_products['products_name'] . '</a><br /><s>' . $currencies->display_price($special_products['products_price'], tep_get_tax_rate($special_products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($special_products['products_prix'], tep_get_tax_rate($special_products['products_tax_class_id'])) . '</span>' : '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $special_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $special_products['products_image'], $special_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $special_products['products_id']) . '">' . $special_products['products_name'] . '</a><br />' . $currencies->display_price($special_products['products_price'], tep_get_tax_rate($special_products['products_tax_class_id']));
  $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" cellspacing="0" width="50%" valign="top"',
                                          'text' => '<table width="99%" border="0" cellspacing="0" cellpadding="0">
 <tr>
   <td align="right" valign="bottom" bordercolor="0"><img src="images/infobox_module/upper_left.gif" width="14" height="33" /></td>	
   <td colspan="2" background="images/infobox_module/top.gif" class=mws_boxTop_module><a class=productTitle href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $special_products['products_id']) . '">' . substr($special_products['products_name'], 0, 30) . '</a></td>
   <td align="left" valign="bottom"><img src="images/infobox_module/upper_right.gif" width="14" height="33" /></td>
 </tr>
 <tr>
   <td background="images/infobox_module/left.gif" width="14"> </td>
   <td align="center" class=mws_boxCenter_module><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $special_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $special_products['products_image'], $special_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><br> <a href="' . tep_href_link(FILENAME_SPECIALS). '">' . tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/special.gif', IMAGE_SPECIAL_PRODUCT). '</a> </td>
<td class=mws_boxCenter_module2>'. strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $new_products["products_id"]). '"><b>' . DESCR_READ_MORE . '</b></a><br><br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id']) . '">' . tep_image_button('cart_buy.gif', IMAGE_BUTTON_IN_CART) . '</a> <strong>' . $currencies->display_price($special_products['products_price'], tep_get_tax_rate($special_products['products_tax_class_id'])).'</strong></td>
   <td background="images/infobox_module/right.gif" class="smallText" width="14"><img src="images/infobox_module/right.gif" width="14" height="149" /></td>
 </tr>
 <tr>
   <td align="right" valign="top"><img src="images/infobox_module/lower_left.gif" width="14" height="12" /></td>
   <td colspan="2" background="images/infobox_module/bot.gif"><img src="images/infobox_module/bot.gif" width="2" height="12" /></td>
   <td align="left" valign="top" class="smallText"><img src="images/infobox_module/lower_right.gif" width="14" height="12" /></td>
 </tr>
</table><br>');

   $col ++;
   if ($col > 1) {
     $col = 0;
     $row ++;
   }
 }

 

any help would be appreciated

 

you can see the problem live at www.dmcgaming.co.uk/index.php (must have the .php else you'll get my holding page)

ideally like the boxes below them showing new items but with specials

 

huge thanks in advance

 

YT aka Keith

there are 10 types of people who understand binary

 

those that do, and those that don't

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...