Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Subcategory textboxes


chris23

Recommended Posts

One more question while I am getting this right. Can the subcategory textbox that appears on the product listing page when that option is selected be moved to UNDER the product title instead of above it? Bruce

Link to comment
Share on other sites

  • Replies 269
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

One more question while I am getting this right. Can the subcategory textbox that appears on the product listing page when that option is selected be moved to UNDER the product title instead of above it? Bruce

 

 

I'd guess that's dependent on where in the file you insert the code - elements should appear in the sequence instructed by the code

 

Gaz

 

 

 

 

p.s. - CHRIS - guess what? - That mail server issue turned into a month long grind before I finally had it fixed on saturday, then it collapsed again yesterday - it's all to do with Microsoft's SecurID / SecureID and Sender Policy Files (SPF) - it's a very naughty way to block spam and it's wreaking havoc worldwide as adoption grows - do a search on "Microsoft defends Hotmail and blocks the world" - interesting string of articles, analyses, and recommendations - especially some of the sites linked to from it.

Hoping to get time to look at the original issue on last page sometime around Christmas

 

Gaz

Wearing a seatbelt prevents head injuries when the computer crashes - - - Yeah Right!!! - not in this office.

Link to comment
Share on other sites

I'd guess that's dependent on where in the file you insert the code - elements should appear in the sequence instructed by the code

 

Gaz

p.s. - CHRIS - guess what? - That mail server issue turned into a month long grind before I finally had it fixed on saturday, then it collapsed again yesterday - it's all to do with Microsoft's SecurID / SecureID and Sender Policy Files (SPF) - it's a very naughty way to block spam and it's wreaking havoc worldwide as adoption grows - do a search on "Microsoft defends Hotmail and blocks the world" - interesting string of articles, analyses, and recommendations - especially some of the sites linked to from it.

Hoping to get time to look at the original issue on last page sometime around Christmas

 

Gaz

I'll try moving the code and see what happens. Thanks!

 

Bruce

Link to comment
Share on other sites

I'll try moving the code and see what happens. Thanks!

 

Bruce

Well, I got an error so I need a bit more direction on just where to put the code. Any ideas?

 

Here's the code right now:

<?php
/*
 $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
 if ($product_check['total'] < 1) {
?>
     <tr>
       <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 } else {
   $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

   if (tep_not_null($product_info['products_model'])) {
     $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'];
   }
?>
<?php
//  category textbox mod
if (DISPLAY_EXTRA_CATEGORIES == 'true' && DISPLAY_CATS_ON_PROD_LISTING == 'true'){
   if ($product_check['total'] >= 1) {
// now get textbox description for this *product* and display
$query = tep_db_query("select categories_description from " . TABLE_EXTRA_CATEGORIES . " left join " . TABLE_PRODUCTS_TO_CATEGORIES . " using (categories_id) where " . TABLE_PRODUCTS_TO_CATEGORIES .".products_id=" . (int)$HTTP_GET_VARS['products_id'] . " and " . TABLE_EXTRA_CATEGORIES .".language_id = '" . (int)$languages_id . "'");
while($category_info_text = tep_db_fetch_array($query)){
   if(!empty($category_info_text['categories_description'])){ // prevent output where description not set for particular language
      echo ("<tr><td colspan=\"2\"><div class=\"cat_info_box\">".$category_info_text['categories_description']."</div></td></tr>");
     }
   }
 }
}
?>      
<tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
           <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main">
<?php
   if (tep_not_null($product_info['products_image'])) {
?>
         <table border="0" cellspacing="0" cellpadding="2" align="right">
           <tr>
             <td align="center" class="smallText">
<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>
             </td>
           </tr>
         </table>
<?php
   }
?>
         <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
?>
         <table border="0" cellspacing="0" cellpadding="2">
           <tr>
             <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
           </tr>
<?php
     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
       while ($products_options = tep_db_fetch_array($products_options_query)) {
         $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
         if ($products_options['options_values_price'] != '0') {
           $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
         }
       }

       if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
         $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
       } else {
         $selected_attribute = false;
       }
?>
           <tr>
             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
           </tr>
<?php
     }
?>
         </table>
<?php
   }
?>
       </td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   $reviews = tep_db_fetch_array($reviews_query);
   if ($reviews['count'] > 0) {
?>
     <tr>
       <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }

   if (tep_not_null($product_info['products_url'])) {
?>
     <tr>
       <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }

   if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
     </tr>
<?php
   } else {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
     </tr>
<?php
   }
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
               <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td>
<?php
   if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_also_purchased(3600);
   } else {
     include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }
 }
?>
       </td>
     </tr>
   </table></form></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Thanks! Bruce

Link to comment
Share on other sites

Hi Bruce,

 

Pleased you've managed to sort most of your issues.

 

A couple of things: try not to rely too much on oscommerces file manager - it's known to be buggy and temperamental. Your best option is to use a text editor and FTP to make changes.

 

I hadn't noticed that clicking the "i" doesn't change the item focus! I always just click on the row which works! Looks like you've found an undocumented feature (read: bug) in my code - I'll have a look.

 

Now to your position. Gaz is right, you can display the category textbox anywhere you like within products_info.php. In your case, you need to insert it:

 

FIND in products_info.php

 

</table></form></td>
<!-- body_text_eof //-->

 

immediately BEFORE place:

 

<?php
// category textbox mod
if (DISPLAY_EXTRA_CATEGORIES == 'true' && DISPLAY_CATS_ON_PROD_LISTING == 'true'){
if ($product_check['total'] >= 1) {
// now get textbox description for this *product* and display
$query = tep_db_query("select categories_description from " . TABLE_EXTRA_CATEGORIES . " left join " . TABLE_PRODUCTS_TO_CATEGORIES . " using (categories_id) where " . TABLE_PRODUCTS_TO_CATEGORIES .".products_id=" . (int)$HTTP_GET_VARS['products_id'] . " and " . TABLE_EXTRA_CATEGORIES .".language_id = '" . (int)$languages_id . "'");
while($category_info_text = tep_db_fetch_array($query)){
if(!empty($category_info_text['categories_description'])){ // prevent output where description not set for particular language
echo ("<tr><td><div class=\"cat_info_box\">".$category_info_text['categories_description']."</div></td></tr>");
}
}
}
}
?>

 

Note the above code has been slightly modified to remove colspan=\"2\" as this is not needed now the box is at the bottom of the page.

 

 

HTH

 

Chris

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

p.s. - CHRIS - guess what? - That mail server issue turned into a month long grind before I finally had it fixed on saturday, then it collapsed again yesterday - it's all to do with Microsoft's SecurID / SecureID and Sender Policy Files (SPF) - it's a very naughty way to block spam and it's wreaking havoc worldwide as adoption grows - do a search on "Microsoft defends Hotmail and blocks the world" - interesting string of articles, analyses, and recommendations - especially some of the sites linked to from it.

 

Never, ever get me started on Microsoft - where did I put that soapbox?

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Chris,

 

I'll give this code a try in a few days when I get some time. Interested to see how it looks!

 

I tried clicking on a row in the Subcat textbox admin menu, and that does work. So no worries there.

 

I'll let you know how the new textbox position turns out.

 

Bruce

Link to comment
Share on other sites

  • 4 weeks later...

I'm having a problem showing the text box on the main category with subcategories. If I have a category without any sub categories the box shows up fine, but if I want the textbox to show in the main category before someone clicks into a sub category I cannot get the box to show up. Any idea on what would cause this? The config for show in main and in subs is set to true.

Link to comment
Share on other sites

I'm having a problem showing the text box on the main category with subcategories. If I have a category without any sub categories the box shows up fine, but if I want the textbox to show in the main category before someone clicks into a sub category I cannot get the box to show up. Any idea on what would cause this? The config for show in main and in subs is set to true.

 

Hi Paul,

 

Can you check your copy of catalog/index.php?

 

There should be two separate entries for the subcategory contibution.

 

Search for:

 

include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);

 

to be sure you have two entries. If not, check the installation instructions again.

 

HTH

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Paul and Jarzom,

 

I think we may be talking at crossed purposes here. I think what you're after is having a subcategory box filter upwards to the containing parent(?).

 

I need to clarify how the contib works. Initially, it was written to allow boxes on subcategories only, then it was amended to allow boxes to be placed on main categories.

 

However, these are distinct entries.

 

If you create a textbox on a main category without a subcategory, it will show. If you create a box on a main category with a subcategory, it will show on the main and above the contained subcategory listing.

 

If however, you place a box on a subcategory, you don't get one on the containing (main) parent e.g.

 

Main ------------------------------------------------------------- Sub

 

Badminton (won't show subcategory text) - > Rackets [textbox] = shows

- > Shuttlecock

 

Badminton [textbox] = shows - > Rackets = shows main category text

- > Shuttlecock = shows main category text

 

 

Badminton [textbox] = shows no subcat

 

If this is the behaviour you're expecting and you're not getting it, I'm not sure what's happening. Jarzom's index.php looks fine.

 

HTH

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Chris,

 

I'm not sure if I'm following what you are saying so I'll just give you my examples. On this main category, http://www.paintballer 187.com/index.php?cPath=33 I have a textbox saved with "test" inside of it. This text box does not show up.

 

Now on this category, http://www.paintballer 187.com/index.php?cPath=60 that does not have any sub categories the box shows up fine. I've also added it to a few sub categories like this one, http://www.paintballer 187.com/index.php?cPath=68_69

 

 

For the lines that needed to be added to index.php I've tried to alter the first section that is suggested to go around line 71 by taking out the if statement and basically hard coding the include line in just to make sure there wasn't a problem with the if statement.

 

(a space was put into the URLs above since I'm not sure if direct links are allowed)

Link to comment
Share on other sites

Chris,

 

I have now been able to isolate the problem. It HAS something to do with using product_listing_col.php. If i incorporate you module into the

product_listing_col.php i can get it to show the textboxes. Otherwise the product_listing_col.php will overwrite the product_extra_categories.php, and the box wont show.

 

Anyone got it working with product_listing_col.php ??

 

Regards

Jarzom

Link to comment
Share on other sites

Solution for those who use product_listing_col, Showing the textboxes.

 

Hi,

 

to make this great contrib work with product_listing_col.php, you can make the following changes to the installation:

 

1. Disregard the additions to index.php (you dont need them)

 

2. Add the following code BEFORE anything (at the very top, at line 1) at product_listing_col.php

 

<?php
//  category textbox mod
// first query - get current category id
if (DISPLAY_EXTRA_CATEGORIES == 'true'){
$text_query = tep_db_query("select c.categories_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   $text = tep_db_fetch_array($text_query);
// now get textbox description for this category (if set) and display
if(isset($text['categories_id'])){
$query2 = tep_db_query("select categories_description from " . TABLE_EXTRA_CATEGORIES . " where ". TABLE_EXTRA_CATEGORIES.".categories_id=". $text['categories_id'] . " and ". TABLE_EXTRA_CATEGORIES . ".language_id = '" . (int)$languages_id . "'");
while($category_info_text = tep_db_fetch_array($query2)){
   if(!empty($category_info_text['categories_description'])){ // prevent output where description not set for particular language
      echo ("<div class=\"cat_info_box\">".$category_info_text['categories_description']."</div>");
     }
   }
 }
}
?>

 

Thats it !

 

Thanks for at great contrib

 

Regards

jarzom

Link to comment
Share on other sites

Hello Chris,

 

Long time no speak :thumbsup:

 

I'm in the process to make many adjustments to get my Google ranking better. One of the comments of my mentor is that your textboxes show all of their text in bold.

The best thing would be in plain text with some bold higlights.

Any idea's on how to do this "the easy way"?

 

Thanks!

 

Norman

 

Edit: Never mind, found it in the css and removed the: font-weight: bold.

As I use the TinyMCE I can now create that what's needed.

 

:lol:

 

Great contribution!! :thumbsup:

Norman in 't Veldt

 

Moderator

osCommerce The Netherlands

Link to comment
Share on other sites

Chris,

 

Another thing: I just upgraded from 2.0.1 to v2.0.2 to have the dropdown menu, but I cannot see it. It looks just the same.

 

Any suggestions?

Edited by i2Paq

Norman in 't Veldt

 

Moderator

osCommerce The Netherlands

Link to comment
Share on other sites

I am trying to install this contribution (v2.0.2) and I am getting this error when I try to run the SQL

 

Error

SQL query:

 

--

-- Table structure for table `extra_cat_info`

--

CREATE TABLE `extra_cat_info` (

 

`categories_id` int( 11 ) NOT NULL ,

`categories_description` text NOT NULL ,

`language_id` int( 11 ) NOT NULL default '1',

PRIMARY KEY ( `categories_id` , `language_id` )

) ENGINE = MYISAM ;

 

 

 

MySQL said:

 

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ENGINE=MyISAM' at line 6

 

Any ideas?

Link to comment
Share on other sites

Hi Bruce,

 

Pleased you've managed to sort most of your issues.

 

A couple of things: try not to rely too much on oscommerces file manager - it's known to be buggy and temperamental. Your best option is to use a text editor and FTP to make changes.

 

I hadn't noticed that clicking the "i" doesn't change the item focus! I always just click on the row which works! Looks like you've found an undocumented feature (read: bug) in my code - I'll have a look.

 

Now to your position. Gaz is right, you can display the category textbox anywhere you like within products_info.php. In your case, you need to insert it:

 

FIND in products_info.php

 

</table></form></td>
<!-- body_text_eof //-->

 

immediately BEFORE place:

 

<?php
// category textbox mod
if (DISPLAY_EXTRA_CATEGORIES == 'true' && DISPLAY_CATS_ON_PROD_LISTING == 'true'){
if ($product_check['total'] >= 1) {
// now get textbox description for this *product* and display
$query = tep_db_query("select categories_description from " . TABLE_EXTRA_CATEGORIES . " left join " . TABLE_PRODUCTS_TO_CATEGORIES . " using (categories_id) where " . TABLE_PRODUCTS_TO_CATEGORIES .".products_id=" . (int)$HTTP_GET_VARS['products_id'] . " and " . TABLE_EXTRA_CATEGORIES .".language_id = '" . (int)$languages_id . "'");
while($category_info_text = tep_db_fetch_array($query)){
if(!empty($category_info_text['categories_description'])){ // prevent output where description not set for particular language
echo ("<tr><td><div class=\"cat_info_box\">".$category_info_text['categories_description']."</div></td></tr>");
}
}
}
}
?>

 

Note the above code has been slightly modified to remove colspan=\"2\" as this is not needed now the box is at the bottom of the page.

HTH

 

Chris

Chris

 

Chris,

 

This worked, but still not exactly what I am trying to achieve. This puts the box UNDER the Reviews and Add to Cart buttons. What I would like to see is the box immediately under the product title. Is this possible?

 

Thanks,

 

Bruce

Link to comment
Share on other sites

Now if only I could ger rid of the "This product added..." line under my text box. I tried but am missing some basic thing, as I get TEXT_DATE_ADDED there instead. Any ideas? I'll start a search as well.

Link to comment
Share on other sites

Now if only I could ger rid of the "This product added..." line under my text box. I tried but am missing some basic thing, as I get TEXT_DATE_ADDED there instead. Any ideas? I'll start a search as well.

 

I do not know if you run a local install to easely change and test your files.

Install Agent Ransack and search the osC-files on your Pc.

 

If you want to run a local copy to modify your files try Apache2Triad.

Be sure to download the right php-version!

Norman in 't Veldt

 

Moderator

osCommerce The Netherlands

Link to comment
Share on other sites

I do not know if you run a local install to easely change and test your files.

Install Agent Ransack and search the osC-files on your Pc.

 

If you want to run a local copy to modify your files try Apache2Triad.

Be sure to download the right php-version!

 

I was able to edit the file and do what I needed after a search of other threads. Thanks!

Link to comment
Share on other sites

Hi Bruce,

 

Pleased you've managed to sort most of your issues.

 

A couple of things: try not to rely too much on oscommerces file manager - it's known to be buggy and temperamental. Your best option is to use a text editor and FTP to make changes.

 

I hadn't noticed that clicking the "i" doesn't change the item focus! I always just click on the row which works! Looks like you've found an undocumented feature (read: bug) in my code - I'll have a look.

 

Now to your position. Gaz is right, you can display the category textbox anywhere you like within products_info.php. In your case, you need to insert it:

 

FIND in products_info.php

 

</table></form></td>
<!-- body_text_eof //-->

 

immediately BEFORE place:

 

<?php
// category textbox mod
if (DISPLAY_EXTRA_CATEGORIES == 'true' && DISPLAY_CATS_ON_PROD_LISTING == 'true'){
if ($product_check['total'] >= 1) {
// now get textbox description for this *product* and display
$query = tep_db_query("select categories_description from " . TABLE_EXTRA_CATEGORIES . " left join " . TABLE_PRODUCTS_TO_CATEGORIES . " using (categories_id) where " . TABLE_PRODUCTS_TO_CATEGORIES .".products_id=" . (int)$HTTP_GET_VARS['products_id'] . " and " . TABLE_EXTRA_CATEGORIES .".language_id = '" . (int)$languages_id . "'");
while($category_info_text = tep_db_fetch_array($query)){
if(!empty($category_info_text['categories_description'])){ // prevent output where description not set for particular language
echo ("<tr><td><div class=\"cat_info_box\">".$category_info_text['categories_description']."</div></td></tr>");
}
}
}
}
?>

 

Note the above code has been slightly modified to remove colspan=\"2\" as this is not needed now the box is at the bottom of the page.

HTH

 

Chris

Chris

 

Chis,

 

I finally got around to making these changes, and it works great. Thanks so much for all the help.

 

Bruce

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...