Jump to content
Gamer

Product Description 1.3

Recommended Posts

joma, I seem to have a problem with the changes your contrib makes to admin/categories.php.

 

If I try to take a product and choose COPY TO, then the next option is to say whether you want to duplicate or link the new copied product, if I choose the DUPLICATE, I get the following error:

 

CODE1136 - Column count doesn't match value count at row 1

 

If I choose to link to a different category there is no error, but if I duplicate to the same category, the error occurs.

 

Any idea's?????

 

Gamer, i have not tried to do what you are doing, with copying products so sorry for this, i will have a look and see what i can find. I dont think it is that big of an issue anyhow, but i'll look into it. I would probally agree with PopTheTop, i dont think i had anything about copy in the mod, so gimme a bit and i'll sort it out for ya. Thanks man. The sql statement you posted is probally a godd idea for me to include in the contribution aswell, it would stop people from overdoing it, which alot of people tend to do but not realize they are doing it. not the equals, just making it VARCHAR(200) See what i can do. Thanks again guys

Share this post


Link to post
Share on other sites

OK i have had a look, i dont get any errors when i copy duplicate so you have missed out some of the db queries

 

search for

 

} elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {

              $product_query = tep_db_query("select products_quantity, products_model, products_image,

 

Make sure you have added

 

short_desc

 

to this query, there are 4 places through categories.php that u need to add the querie, i can't give you lines on yours becaus eim unsure of the mods you have applied, but just search for short_desc, and see if it appears 4 times, if it does and you have not put it in this area you have out them in the wrong place, so i suggest you rempve them and redo that step, if you search for simular queries that will appear the same like, product_image, you should find that there are only 4 of these aswell. If it still does not work then get back to me again. Thanks

Share this post


Link to post
Share on other sites

thanks guys. Got it sorted. My store is heavily modified over the last 2 or 3 years, so it looks like I missed one or two of those additions.

Share this post


Link to post
Share on other sites
hi Guys, I've got a problem here.

 

It seems the short description will take the "bold" attributes when listing itself under the bold product name which looks ugly. Please seehttp://laptopcraze.com/index.php?cPath=23_31 (catch the last product!) whereas you guys' website don't seem to have this problem

 

Have any idea why it is? thanks a lot!

 

 

I think it looks great, I would not worry about it.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Site looks great but...

I noticed that your info box right side borders are missing and the bottom of your New Products box is gone. You may want to fix that.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

You can download a mod for displaying the produts model in product listing page.

below is the mod i used, it does not display under the name but in a new column, im sure you can work out how to change it.

 

***********************************

*      DESCRIPTION              *

***********************************

 

This simple hack will add a model column to your admin catalog area and order them by model.  This is my first hack, I know its small but I couldn't find anything like it from the current contributions and so I took the chance to give back a little bit.  If you have any questions or comments, throw me an email @ discomonkey@mail.utexas.edu.  Written and tested around 12/7/2004 with OsCommerce 2.2 MS2.

 

***********************************

*            INSTALL              *

***********************************

 

Step 1)  !!! Backup your site !!! 

 

 

Step 2)  Open up admin/categories.php (Keep in mind mine has 300ish more lines then a stock OSC installation, so the line numbers will be extremely relative)

 

Around Line 935 Find:

<tr>

        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

          <tr>

            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

              <tr class="dataTableHeadingRow">

                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>

                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>

                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

              </tr>

 

And Change it so it looks like:

<tr>

        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

          <tr>

            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

              <tr class="dataTableHeadingRow">

                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>

    <td class="dataTableHeadingContent"><?php echo "PRODUCT MODEL" ?> 

    <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>

                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

              </tr>

 

 

Around Line 980ish Find:

 

 

    if (isset($HTTP_GET_VARS['search'])) {

      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");

    } else {

      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");

    }

 

 

And Replace it with:  ****

 

    if (isset($HTTP_GET_VARS['search'])) {

      $products_query = tep_db_query("select p.products_model, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by p.products_model");

    } else {

      $products_query = tep_db_query("select p.products_model, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by p.products_model");

    }

 

**** NOTE ON ABOVE CHANGE ****

The Above change will order your admin catalog area by Model.  If you want to order it by something else, change last value where it says " order by value_name",  where value_name could be pd.products_name (orignal value, order by product name) or it could be p.products_model (the new value, which is the one I've put on my cart to order them by model name)

 

 

 

Around Line 1010ish Find

 

  <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $products['products_name']; ?></td>

  <td class="dataTableContent" align="center">

 

And Change it so it looks like:

 

      <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $products['products_name']; ?></td>

      <td class="dataTableContent" align="center"><?php echo '[' . $products['products_model'] . ']'; ?></td>

  <td class="dataTableContent" align="center">

 

 

 

Step 3) Close and Save, You are Done.

 

Any other problems ??? I have not been here to answer your earlier messages, sorry.

Share this post


Link to post
Share on other sites

I have installed this mod. Thank you! It worked perfect.

But then I tried to duplicate a product, and got some errors.

 

To solve this, you have to go to admin/categories.php.

 

Search for

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id)

(293)

 

Replace with:

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_image, short_desc, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id)

Share this post


Link to post
Share on other sites

Hi everyone

 

I made some minor changes in the product_new.php, and it works perfectly.

The changes are:

 

open products_new.php and find

 

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

 

In cases, you have allready installed conrtibutions which changed the code of the products_new.php, you might have problems to find the complete code above. In those cases do a partial search.

 

in line find:

pd.products_name

 

in line after add:

, pd.products_description

 

find around row 89

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>

 

and insert

'<br><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="productDesc">' . tep_flatten_product_description($listing['products_description'], ?' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . TEXT_MORE . '</a>'

 

in this line. You can do it by leaving out the leading semicolon of the code above and paste it directly in before one of the

<br>'

 

in the original line.

 

In my case, the look of the original products_new.php didn't really satisfy me, so I changed the code a little bit more

<tr>
? ? ? ? ? ?<td rowspan="2" width="<?php echo SMALL_IMAGE_WIDTH; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
? ? ? ? ? ?<td class="productheadDesc" align="left" valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><font color="#680000"><b>' . $products_new['products_name'] . '</b></font></a>'; ?></td>
?	<td class="productpriceDesc" align="right" valign="top"><?php echo '<b>' . $products_price . '</b> '; ?></td>
?</tr>
?<tr>
?	<td class="productsDesc" align="left" valign="top" class="main" colspan="2"><?php echo tep_flatten_product_description($products_new['products_description'], ?' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . TEXT_MORE . '</a>') . '<br><b>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '</b>'; ?></td>
? ? ? ? ?</tr>
? ? ? ? ?<tr>
? ? ? ? ? ?<td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
? ? ? ? ?</tr>

 

replaces the lines 87 to 94 of the original code. Along with two additional entries in the stylesheet.css

TD.productsDesc {
?font-family: Verdana, Arial, sans-serif;
?font-size: 10px;
?color: #808080;
?padding: 6px 4px 6px 10px;
}

TD.productheadDesc {
?font-family: Verdana, Arial, sans-serif;
?font-size: 11px;
?color: #680000;
?padding: 4px 0px 0px 10px;
}

TD.productpriceDesc {
?font-family: Verdana, Arial, sans-serif;
?font-size: 11px;
?color: #000000;
?padding: 4px 0px 0px 4px;
}

 

I got this result test.jpg

 

BoF

Edited by BoF

Share this post


Link to post
Share on other sites

sorry, I have to correct a mistake in my posting. You must change

$listing['products_id']

to

$products_new['products_id']

 

to make the link afer the description text work.

 

BoF

Share this post


Link to post
Share on other sites

Ok, I have a short description on the productlisting now.

 

However, I still need to know how to customize the look of the page?

 

My Short discription comes up in a column on the product listing, isntead of under the prodduct name. I want it to look the same as this:

 

http://shop.snyderhealth.com/index.php?cat...=water-ionizers

 

Did i miss something? Do something wrong?

 

Steve

Share this post


Link to post
Share on other sites
Re: Products Short Description

 

Ok, got a question that I just can not seem to answer myself. I just installed this and it works great, BUT...

 

Now it wraps the model number column in the product listings. The code is being called from catalog/includes/modules/product_listing.php and I see that if you try and change it so that you can add NOWRAP to the <TD>, it causes ALL of the column to NOWRAP and that makes the short description scroll off your page.

 

Any fix to this?

 

 

Anyone?


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

I just installed the contribution and i am getting this error message:

1054 - Unknown column 'p.short_desc' in 'field list'

 

I ran the sql statement. Does anybody know what might be the problem?

Share this post


Link to post
Share on other sites

How to Show Product description in row mode

 

Thanks for your contribution. It works fine!

The best instructions I ever seen! :thumbsup:

 

But I have the following problem:

 

I previously installed the osC-ProductListingSelect (contribution by Randy Newman "ugottasalsa") to list the products in columns.

 

Both contributions work fine seperately, but does someone know how to get them working together?

 

The product_listing.php has been altered for osC-ProductListingSelect:

 

<?php

/*

  $Id: product_listing.php,v 1.44 2003/06/09 22:49:59 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright © 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

  $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 

  if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

  <tr>

    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

  </tr>

</table>

<?php

  }

 

  if (PRODUCT_LISTING_DISPLAY_STYLE == 'list') {

 

    $list_box_contents = array();

 

    for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

      switch ($column_list[$col]) {

        case 'PRODUCT_LIST_MODEL':

          $lc_text = TABLE_HEADING_MODEL;

          $lc_align = '';

          break;

        case 'PRODUCT_LIST_NAME':

          $lc_text = TABLE_HEADING_PRODUCTS;

          $lc_align = '';

          break;

        case 'PRODUCT_LIST_MANUFACTURER':

          $lc_text = TABLE_HEADING_MANUFACTURER;

          $lc_align = '';

          break;

        case 'PRODUCT_LIST_PRICE':

          $lc_text = TABLE_HEADING_PRICE;

          $lc_align = 'right';

          break;

        case 'PRODUCT_LIST_QUANTITY':

          $lc_text = TABLE_HEADING_QUANTITY;

          $lc_align = 'right';

          break;

        case 'PRODUCT_LIST_WEIGHT':

          $lc_text = TABLE_HEADING_WEIGHT;

          $lc_align = 'right';

          break;

        case 'PRODUCT_LIST_BUY_NOW':

          $lc_text = TABLE_HEADING_BUY_NOW;

          $lc_align = 'center';

          break;

        case 'PRODUCT_LIST_IMAGE':

          $lc_text = TABLE_HEADING_IMAGE;

          $lc_align = 'center';

          break;

      }

 

      if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {

        $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);

      }

 

      $list_box_contents[0][] = array('align' => $lc_align,

                                    'params' => 'class="productListing-heading"',

                                      'text' => ' ' . $lc_text . ' ');

    }

 

    if ($listing_split->number_of_rows > 0) {

      $rows = 0;

      $listing_query = tep_db_query($listing_split->sql_query);

      while ($listing = tep_db_fetch_array($listing_query)) {

        $rows++;

 

        if (($rows/2) == floor($rows/2)) {

          $list_box_contents[] = array('params' => 'class="productListing-even"');

        } else {

          $list_box_contents[] = array('params' => 'class="productListing-odd"');

        }

 

        $cur_row = sizeof($list_box_contents) - 1;

 

        for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

          $lc_align = '';

 

          switch ($column_list[$col]) {

            case 'PRODUCT_LIST_MODEL':

              $lc_align = '';

              $lc_text = ' ' . $listing['products_model'] . ' ';

              break;

            case 'PRODUCT_LIST_NAME':

              $lc_align = '';

              if (isset($HTTP_GET_VARS['manufacturers_id'])) {

                $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';

              } else {

                $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';

              }

              break;

            case 'PRODUCT_LIST_MANUFACTURER':

              $lc_align = '';

              $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';

              break;

            case 'PRODUCT_LIST_PRICE':

              $lc_align = 'right';

              if (tep_not_null($listing['specials_new_products_price'])) {

                $lc_text = ' <s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';

              } else {

                $lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

              }

              break;

            case 'PRODUCT_LIST_QUANTITY':

              $lc_align = 'right';

              $lc_text = ' ' . $listing['products_quantity'] . ' ';

              break;

            case 'PRODUCT_LIST_WEIGHT':

              $lc_align = 'right';

              $lc_text = ' ' . $listing['products_weight'] . ' ';

              break;

            case 'PRODUCT_LIST_BUY_NOW':

              $lc_align = 'center';

              $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

              break;

            case 'PRODUCT_LIST_IMAGE':

              $lc_align = 'center';

              if (isset($HTTP_GET_VARS['manufacturers_id'])) {

                $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

              } else {

                $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';

              }

              break;

          }

 

          $list_box_contents[$cur_row][] = array('align' => $lc_align,

                                                'params' => 'class="productListing-data"',

                                                'text'  => $lc_text);

        }

      }

 

      new productListingBox($list_box_contents);

    } else {

      $list_box_contents = array();

 

      $list_box_contents[0] = array('params' => 'class="productListing-odd"');

      $list_box_contents[0][] = array('params' => 'class="productListing-data"',

                                        'text' => TEXT_NO_PRODUCTS);

 

      new productListingBox($list_box_contents);

    }

   

  } elseif (PRODUCT_LISTING_DISPLAY_STYLE == 'columns') {

 

    $info_box_contents = array();

    if ($listing_split->number_of_rows > 0) {

      $row = 0;

      $col = 0;

      $listing_query = tep_db_query($listing_split->sql_query);

      while ($listing = tep_db_fetch_array($listing_query)) {

        $listing['products_name'] = tep_get_products_name($listing['products_id']);

       

        if (PRODUCT_LIST_IMAGE > 0) {

      $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br>';

        }

         

        if (PRODUCT_LIST_NAME > 0) {

      $lc_text .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a><br>';

        }

 

        if (PRODUCT_LIST_MODEL > 0) {

      $lc_text .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . $listing['products_model'] . '</a><br>';

        }

 

        if (PRODUCT_LIST_MANUFACTURER > 0) {

      $lc_text .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a><br>';

        }

 

        if (PRODUCT_LIST_PRICE > 0) {

          if (tep_not_null($listing['specials_new_products_price'])) {

            $lc_text .= '<s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';

          } else {

            $lc_text .= ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

          }

        }

 

        if (PRODUCT_LIST_BUY_NOW) {

          $lc_text .= '<br><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW) . '</a>';     

        }

 

        $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"',

                                                'text' => $lc_text);

 

        $col ++;

        if ($col > PRODUCT_LIST_COL_NUM-1) {

          $col = 0;

          $row ++;

        }

      }

 

      new contentBox($info_box_contents);

 

    } else {

 

      $info_box_contents = array();

 

      $info_box_contents[0] = array('params' => 'class="productListing-odd"');

      $info_box_contents[0][] = array('params' => 'class="productListing-data"',

                                        'text' => TEXT_NO_PRODUCTS);

 

      new contentBox($info_box_contents);

 

    }

  }

   

  if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

  <tr>

    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

  </tr>

</table>

<?php

  }

?>

 

Then I put in the changes for the description:

 

<?php

/*

  $Id: product_listing.php,v 1.44 2003/06/09 22:49:59 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright © 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

  $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 

  if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

  <tr>

    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

  </tr>

</table>

<?php

  }

 

  if (PRODUCT_LISTING_DISPLAY_STYLE == 'list') {

 

    $list_box_contents = array();

 

    for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

      switch ($column_list[$col]) {

        case 'PRODUCT_LIST_MODEL':

          $lc_text = TABLE_HEADING_MODEL;

          $lc_align = '';

          break;

        case 'PRODUCT_LIST_NAME':

          $lc_text = TABLE_HEADING_PRODUCTS;

          $lc_align = '';

          break;

        case 'PRODUCT_LIST_MANUFACTURER':

          $lc_text = TABLE_HEADING_MANUFACTURER;

          $lc_align = '';

          break;

        case 'PRODUCT_LIST_PRICE':

          $lc_text = TABLE_HEADING_PRICE;

          $lc_align = 'right';

          break;

        case 'PRODUCT_LIST_QUANTITY':

          $lc_text = TABLE_HEADING_QUANTITY;

          $lc_align = 'right';

          break;

        case 'PRODUCT_LIST_WEIGHT':

          $lc_text = TABLE_HEADING_WEIGHT;

          $lc_align = 'right';

          break;

        case 'PRODUCT_LIST_BUY_NOW':

          $lc_text = TABLE_HEADING_BUY_NOW;

          $lc_align = 'center';

          break;

        case 'PRODUCT_LIST_IMAGE':

          $lc_text = TABLE_HEADING_IMAGE;

          $lc_align = 'center';

          break;

      }

 

      if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {

        $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);

      }

 

      $list_box_contents[0][] = array('align' => $lc_align,

                                    'params' => 'class="productListing-heading"',

                                      'text' => ' ' . $lc_text . ' ');

    }

 

    if ($listing_split->number_of_rows > 0) {

      $rows = 0;

      $listing_query = tep_db_query($listing_split->sql_query);

      while ($listing = tep_db_fetch_array($listing_query)) {

        $rows++;

 

        if (($rows/2) == floor($rows/2)) {

          $list_box_contents[] = array('params' => 'class="productListing-even"');

        } else {

          $list_box_contents[] = array('params' => 'class="productListing-odd"');

        }

 

        $cur_row = sizeof($list_box_contents) - 1;

        $has_description = false;

 

        for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

          $lc_align = '';

 

          switch ($column_list[$col]) {

            case 'PRODUCT_LIST_MODEL':

              $lc_align = '';

              $lc_text = ' ' . $listing['products_model'] . ' ';

              break;

            case 'PRODUCT_LIST_NAME':

              $lc_align = '';

              if (isset($HTTP_GET_VARS['manufacturers_id'])) {

                $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';

              } else {

                $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';

              }

 

if (PRODUCT_LIST_DESCRIPTION && $listing['products_description'] && PRODUCT_LIST_DESCRIPTION_MAX_LENGTH)

            $lc_text .= '<br><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="productDesc">' . tep_flatten_product_description($listing['products_description'],  ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . TEXT_MORE . '</a>') . '</td></tr></table>';

 

              break;

            case 'PRODUCT_LIST_MANUFACTURER':

              $lc_align = '';

              $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';

              break;

            case 'PRODUCT_LIST_PRICE':

              $lc_align = 'right';

              if (tep_not_null($listing['specials_new_products_price'])) {

                $lc_text = ' <s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';

              } else {

                $lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

              }

              break;

            case 'PRODUCT_LIST_QUANTITY':

              $lc_align = 'right';

              $lc_text = ' ' . $listing['products_quantity'] . ' ';

              break;

            case 'PRODUCT_LIST_WEIGHT':

              $lc_align = 'right';

              $lc_text = ' ' . $listing['products_weight'] . ' ';

              break;

            case 'PRODUCT_LIST_BUY_NOW':

              $lc_align = 'center';

              $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

              break;

            case 'PRODUCT_LIST_IMAGE':

              $lc_align = 'center';

              if (isset($HTTP_GET_VARS['manufacturers_id'])) {

                $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

              } else {

                $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';

              }

              break;

          }

 

          $list_box_contents[$cur_row][] = array('align' => $lc_align,

                                                'params' => 'class="productListing-data"',

                                                'text'  => $lc_text);

        }

      }

 

      new productListingBox($list_box_contents);

    } else {

      $list_box_contents = array();

 

      $list_box_contents[0] = array('params' => 'class="productListing-odd"');

      $list_box_contents[0][] = array('params' => 'class="productListing-data"',

                                        'text' => TEXT_NO_PRODUCTS);

 

      new productListingBox($list_box_contents);

    }

   

  } elseif (PRODUCT_LISTING_DISPLAY_STYLE == 'columns') {

 

    $info_box_contents = array();

    if ($listing_split->number_of_rows > 0) {

      $row = 0;

      $col = 0;

      $listing_query = tep_db_query($listing_split->sql_query);

      while ($listing = tep_db_fetch_array($listing_query)) {

        $listing['products_name'] = tep_get_products_name($listing['products_id']);

       

        if (PRODUCT_LIST_IMAGE > 0) {

      $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br>';

        }

         

        if (PRODUCT_LIST_NAME > 0) {

      $lc_text .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a><br>';

        }

 

        if (PRODUCT_LIST_MODEL > 0) {

      $lc_text .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . $listing['products_model'] . '</a><br>';

        }

 

        if (PRODUCT_LIST_MANUFACTURER > 0) {

      $lc_text .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a><br>';

        }

 

        if (PRODUCT_LIST_PRICE > 0) {

          if (tep_not_null($listing['specials_new_products_price'])) {

            $lc_text .= '<s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';

          } else {

            $lc_text .= ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

          }

        }

 

        if (PRODUCT_LIST_BUY_NOW) {

          $lc_text .= '<br><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW) . '</a>';     

        }

 

        $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"',

                                                'text' => $lc_text);

 

        $col ++;

        if ($col > PRODUCT_LIST_COL_NUM-1) {

          $col = 0;

          $row ++;

        }

      }

 

      new contentBox($info_box_contents);

 

    } else {

 

      $info_box_contents = array();

 

      $info_box_contents[0] = array('params' => 'class="productListing-odd"');

      $info_box_contents[0][] = array('params' => 'class="productListing-data"',

                                        'text' => TEXT_NO_PRODUCTS);

 

      new contentBox($info_box_contents);

 

    }

  }

   

  if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

  <tr>

    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

  </tr>

</table>

<?php

  }

?>

 

That dont seems to work. Just ignore the nice descriptions, seen in the row mode

Thanks for your helps and hints!

Share this post


Link to post
Share on other sites
Ok, I have a short description on the productlisting now.

 

However, I still need to know how to customize the look of the page?

 

My Short discription comes up in a column on the product listing, isntead of under the prodduct name.  I want it to look the same as this:

 

http://shop.snyderhealth.com/index.php?cat...=water-ionizers

 

Did i miss something? Do something wrong?

 

Steve

 

 

Please guys! I want my description under the product name. At the moment it is appearing as a column near the buy button. :S

 

PLEASE HELP!

Share this post


Link to post
Share on other sites

I Solved the problem:

 

I had to do the same changes in product_listing.php at

 

elseif (PRODUCT_LISTING_DISPLAY_STYLE == 'columns')

 

as I done in

 

if (PRODUCT_LISTING_DISPLAY_STYLE == 'list')

 

Just added:

 

if (PRODUCT_LIST_DESCRIPTION && $listing['products_description'] && PRODUCT_LIST_DESCRIPTION_MAX_LENGTH)

$lc_text .= '<br><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="productDesc">' . tep_flatten_product_description($listing['products_description'], ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . TEXT_MORE . '</a>') . '</td></tr></table>';

 

after PRODUCT_LIST_NAME

 

Sometimes its simpler as I thought.

 

Cheers!

Share this post


Link to post
Share on other sites

Hi,

thanks for your contribution

sorry, didn?t read all of the replies,

so if you still don?t know how to fix this smallproblem with the products_new.php

 

you just have to change one line in the products_new file.

 

find:

 

$products_new['products_description'] .

 

and replace it with

 

tep_flatten_product_description($products_new['products_description'], ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . TEXT_MORE . '</a>') .

 

that should do it, at least it worked with our shop!

 

Best Regards

netwulf

Edited by netwulf

Share this post


Link to post
Share on other sites

$products_new['products_description'] .

 

does not exist in the products_new.php file.

Share this post


Link to post
Share on other sites

Dosent it suppport full html? images? can it be added?

I dont have much description and 3 small images (15x22 pix)

 

Would like to get akk information in "prewiev"

 

 

Grate contrib anyway. thisone must become standart in official dist.

Share this post


Link to post
Share on other sites
Dosent it suppport full html? images? can it be added?

I dont have much description and 3 small images (15x22 pix)

 

Would like to get akk information in "prewiev"

Grate contrib anyway. thisone must become standart in official dist.

 

 

I took took a look in the database saw that the datatype for the description was varchar(255). IF it was ASCII insted would it store the HTML?

 

Sadly I dont remeber how to change the datatype, so i culdent test.

 

 

 

Gamer: gamer I saw that I well hupullle he will corect it soon.

Share this post


Link to post
Share on other sites

Hello ! :thumbsup:

 

Is it possible to adapt this contribution to add short description in Box News ? (in boxe/what_news.php on my Ms2 exactly)

Share this post


Link to post
Share on other sites

How do I put the short_desc into the product_info.php

 

I want the short description to be used to be called on the product listing but then once you enter a products page, i want it to show the short_description followed by the product_description thats already there.

 

Thanks.

Share this post


Link to post
Share on other sites

Nevermind the above post. It's:

 

<?php echo stripslashes($product_info['short_desc']); ?>

 

 

How do I put the short_desc into the product_info.php

 

I want the short description to be used to be called on the product listing but then once you enter a products page, i want it to show the short_description followed by the product_description thats already there.

 

Thanks.

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

×