Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Listing Enhancements, Thumbnails & Manufacturer Headings


spooks

Recommended Posts

It depends on which display mode your using & if you have graphical borders, most of the applies css is listed in the instructions.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

managed to get grid in firefox, but not IE, how would i know if i have graphical borders

 

 

You'll only have it if you installed, used css changes with that.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Thanks Sam!

I'm sorry, I had totally misunderstood as you said.

I had been wondering why manufacturers description wasn't shown though I chose 'thumbnails in grid'... sorry!

 

I'd like to show as 'thumbnails in grid' and manufacturers description also.

I'd like to try to change the source. product_listing.php should be modified?

 

I changed index.php and I could make it show as I'd like to.

Thanks.

 

aki

Link to comment
Share on other sites

I changed index.php and I could make it show as I'd like to.

Thanks.

 

aki

 

 

Well done, sorry I did'nt see your last post before, I think the forum often fails to show a post when it starts a new page.

 

index.php is probably your best bet anyway, extra queries needed otherwise.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

hi I tried to install the http://addons.oscommerce.com/info/6051 add on 1.6v and I got the folling error message below;

 

 

Parse error: syntax error, unexpected $end, expecting ')' in /data/members/paid/d/i/diamantnoir.co.uk/htdocs/booking/includes/modules/product_listing.php on line 145

 

CAN YOU HELP?

 

You are missing a }

 

Try adding one before the ?> at the end of the file. Sam may know where to put it right.

Sincerely

Mike

Link to comment
Share on other sites

You are missing a }

 

Try adding one before the ?> at the end of the file. Sam may know where to put it right.

 

I tried it, saved and doesn't work. When I re-open the php it has returned to its original scripting. Can you have a look and help me please. The error is at the end line 145

 

<?php

/*

$Id: product_listing.php,v 2.1.5 2008/07/24 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

*/

 

$graphic_bord = 'no'; // set to 'yes' if you have older 'graphic borders' and not 'easy graphic borders'.

 

if (tep_not_null($HTTP_GET_VARS['sort'])) $_GET['sort'] = $HTTP_GET_VARS['sort'];

$max_results = (tep_not_null($_GET['max']) ? $_GET['max'] : MAX_DISPLAY_SEARCH_RESULTS);

 

if (PRODUCTS_PER_ROW == 'PRODUCTS_PER_ROW' || PRODUCTS_PER_ROW == 0 || LISTING_SWITCH == 'LISTING_SWITCH') { $to = 'Setup Error!\nPlease ensure you have run the\nProduct Listing Setup File.' ; print "<script>alert('$to');</script>"; }

 

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

if ( ($listing_split->number_of_rows > (int)$max_results) && ( (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

}

 

function tep_get_category_name($category_id, $language_id) {

$category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");

$category = tep_db_fetch_array($category_query);

 

return $category['categories_name'];

}

function tep_get_manufacturer_name($manufacturer_id) {

$manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturer_id . "'");

$manufacturer = tep_db_fetch_array($manufacturers_query);

 

return $manufacturer['manufacturers_name'];

}

 

 

 

 

function list_box_head($column_list) {

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 = 'center';

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_IMAGE':

$lc_text = TABLE_HEADING_IMAGE;

$lc_align = 'center';

break;

case 'PRODUCT_LIST_BUY_NOW':

$lc_text = (strstr(LISTING_BUTTON, 'buy now')? TABLE_HEADING_BUY_NOW : TABLE_HEADING_DETAIL);

$lc_align = 'center';

break;

}

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

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

}

$list_box_contents[] = array('align' => $lc_align,'params' => 'class="productListing-heading"','text' => ' ' . $lc_text . ' ');

}

return ($list_box_contents);

}

// function list_head end

 

function list_box_data($listing, $column_list) {

global $PHP_SELF;

$currencies = new currencies();

if (!strstr(PRODUCT_THUMBNAIL_VIEW, 'block')) {

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

$lc_align = '';

 

switch ($column_list[$col]) {

case 'PRODUCT_LIST_MODEL':

$lc_align = 'center';

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

break;

case 'PRODUCT_LIST_NAME':

$lc_align = '';

if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) {

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' .

$_GET['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</b></a>' . ($listing['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<br><span class="short">' . $listing['short_desc'] . '</span>' : '');

} else {

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' .

$listing['products_id']) . '"><b>' . $listing['products_name'] . '</b></a>' . ($listing['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<br><span class="short">' . $listing['short_desc'] . '</span>' : '');}

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';

$price = (function_exists(display_short_price)) ? $currencies->display_short_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']));

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 = ($listing['products_price'] > 0 ? ' ' . $price . ' ' : ' ' . TEXT_POA);

if (function_exists(tep_get_att_price)) $lc_text .= (tep_get_att_price($listing['products_id']) > 0 ? '+' : ' ') ;

}

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_IMAGE':

$lc_align = 'center';

if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) {

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $_GET['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;

case 'PRODUCT_LIST_BUY_NOW':

$button = (LISTING_BUTTON == 'buy now' ? '<br><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_in_cart.gif', IMAGE_BUTTON_BUY_NOW, 'class="buy_now"') . '</a> ' : (strstr(LISTING_BUTTON, 'buy now') ? '<br><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_

Link to comment
Share on other sites

Spooks, Thanks for the wonderful add-on and the help with fixing that initial problem I had with the parse error. I didn't seem to find another post that has the same problem I'm currently encountering.

 

When I go to "What's in my cart" page, I get this error message.

 

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

 

select short_desc from products_description pd where products_id = '328'

 

[TEP STOP]

 

 

I thought I had followed your instructions right through (and checked it twice even!) but obviously I'm missing something. Is it an obvious fix?

Proud member of the Code Breakers Club http://www.oscommerce.com/forums/index.php?s=&...t&p=1305968

Link to comment
Share on other sites

In the instruction you have:

 

Open index.php

 

Around 170 after:

 

case 'PRODUCT_LIST_WEIGHT':

$select_column_list .= 'p.products_weight, ';

break;

}

}

 

if you have the short desciption mod add:

 

$select_column_list .= 'pd.short_desc, ';

 

Around 252 find: .......

 

obviously you have added the line but don't have the short desciption mod

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

In the instruction you have:

 

 

 

obviously you have added the line but don't have the short desciption mod

 

I knew it'd be something simple that I overlooked. Thanks for your help

Proud member of the Code Breakers Club http://www.oscommerce.com/forums/index.php?s=&...t&p=1305968

Link to comment
Share on other sites

Uploaded new version 1.8

 

Made the contrib multilingual

Change to thumbnail display, if the bottom row size is less than number products per row, it will be spaced seperately so spacing is even across the display & different to full rows. This feature is not used for grid display.

Added some bug fixes related to SEO URL's (for application_top.php)

Changed files: product_listing.php, css entries, addition to includes/classes/boxes.php, includes/languages/english/index.php and includes/languages/english/advanced_search.php

 

UPGRADING

If your upgading from any previous version, run the new setup file it will make any required changes (NOT REQUIRED from 1.7 to 1.8), replace all the changed files and add the new/changed css entries and modifications to includes/classes/boxes.php, includes/languages/english/index.php and includes/languages/english/advanced_search.php.

Additional instructions appear at the end of the install instructions.

 

There are some bug fixes you must do if you use SEO URL's (Still in development)

 

B)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Sorry Spooks, I took out the line as you suggested and I've still got the same error (1054 - Unknown column 'short_desc' in 'field list'

 

select short_desc from products_description pd where products_id = '329'

 

[TEP STOP] ).

 

Any other suggestions? :blush:

 

Thanks.

Proud member of the Code Breakers Club http://www.oscommerce.com/forums/index.php?s=&...t&p=1305968

Link to comment
Share on other sites

You must have placed the line somewhere else in index.php, or elsewhere, the addition is only through the instructions, that column addition does not exist in any of the included files.

 

If you have a descent text editor searching for every instance is easy.

 

its strange you get error with cart, should not occur, check all your moded files.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

You must have placed the line somewhere else in index.php, or elsewhere, the addition is only through the instructions, that column addition does not exist in any of the included files.

 

If you have a descent text editor searching for every instance is easy.

 

its strange you get error with cart, should not occur, check all your moded files.

 

 

Thanks for the advice. I think I'll go mix myself a stiff drink and run through all your instructions again to see where I might've placed that line.

Proud member of the Code Breakers Club http://www.oscommerce.com/forums/index.php?s=&...t&p=1305968

Link to comment
Share on other sites

I installed 1.8 version of your contribution and really like it - thanks!

 

 

I now have an error when clicking through to new products;

 

Parse error: parse error, unexpected ';', expecting ',' or ')' in /hsphere/local/home/compuexp/shop.teknmotion.com/catalog/products_new.php on line 14

 

 

http://shop.teknmotion.com/catalog/products_new.php

 

 

I am really new to PHP

 

 

Here is the line the above is refering (line 3 below is line 14

 

 

require('includes/application_top.php');

$HTTP_GET_VARS['manufacturers_id'] = '';

unset($HTTP_GET_VARS['manufacturers_id'];

unset($_GET['manufacturers_id'];

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

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

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));

 

?>

Link to comment
Share on other sites

Nevermind

 

the products_new.php included in the 1.8 pack

was like this;

 

unset($HTTP_GET_VARS['manufacturers_id'];

unset($_GET['manufacturers_id'];

 

 

This seems to work

 

unset($HTTP_GET_VARS['manufacturers_id']);

unset($_GET['manufacturers_id']);

 

But I could have just broke it more ;)

 

 

Thanks for the obvious hard work you put into this mod!

Link to comment
Share on other sites

Hi,

 

Your quite right, I have no idea how those closing brackets got deleted, some gremlin must've crept it & buggered about.

 

Your corrections are also fine. I don't see any other errors.

 

Out of interest, which display mode do you prefer?

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hi

 

I've installed the version 1.8 and I can see the changes in my product listings (looks great already!!).

I've also got the "installation succeeded" message in my admin screen.

 

But If I login in the admin section, i can't find admin/configuration/product listing.

I've also installed total configuration, and here also is the product listing isn't listed.

 

--> So I can't change any of the settings of the product listig.

 

Tried to rerun the install file a couple of times, but no joy. (Every time I rerun, he aborts the installation because i'ts already installesd).

 

Could you help me out?

 

Tx

 

Tom

Link to comment
Share on other sites

The new settings are added to the existing product listing group, look in there, they must exists as the setup tests for thier existance, thats how in knows the install has been done.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hi,

 

Your quite right, I have no idea how those closing brackets got deleted, some gremlin must've crept it & buggered about.

 

Your corrections are also fine. I don't see any other errors.

 

Out of interest, which display mode do you prefer?

 

 

I am not sure what will be the best yet to suit the final design, I really like having as many choices as possible

which this really added to the possibilities. I like the grid with thumbnails

 

I know this is asking alot :) It would be great to be able to assign different display modes for different templates

 

Some categories are better displayed in a list (like search results maybe), some the grid would work better (what's new section)

Link to comment
Share on other sites

The new settings are added to the existing product listing group, look in there, they must exists as the setup tests for thier existance, thats how in knows the install has been done.

 

I've looked in the Product Listing but I can't find the new settings.

Not if i put admin in english or in dutch.

 

Under product listing I find only this:

sshot-2.jpg

 

Or am i looking completely wrong?

 

Cheers

 

Tom

Link to comment
Share on other sites

Hi, I suspect that dutch is the problem, easy solution, make the whole country speak english!!

 

 

But really, I presume you have changed the names of the groups so that 'Product Listing' is now something else. I had not considered that possibility, there is no language file for this, but as I gave the option with total configuration I suppose I should have thought of that.

 

The setup file looks for the group called 'Product Listing' if you don't have that it will have placed the setting in group 0 (its un-assigned) as that is for hidden settings total configuration does not show it, and as the 'hidden' flag will be set it wont show in admin iether.

 

The easiest option, should you have it, would be to restore your dBase tp preinstall then rename 'Product Listing' group 'Product Listing' then do the install again.

 

If you cant then you should be able to remove the fields with total configuration once modified, I have add more features to this since last upload, so this may not work.

 

I total configuration find:

 

if ($value['id'] == 0) continue; (appears twice)

 

comment out each line

 

also find:

 

// Show them all

} elseif($gID == 0) {

 

change to

 

// Show them all

} elseif($gID == '0xx') {

 

You should now be able to view and edit group 0 take care not to remove original settings, setting the install adds are detailed in the instructions.

If you have the feature on your version, you could also move the fields to the correct group.

Edited by spooks

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Not 100% sure this is due to the contrib, but shortly after installing I noticed I now get this error in admin when attempting to insert a new manufacterer

 

Fatal error: Call to undefined function: tep_get_manufacturer_description() in /hsphere/local/home/compuexp/shop.teknmotion.com/catalog/admin/manufacturers.php

 

Any insight would be greatly appreciated

 

Everything else is working perfectly

 

Thanks!

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...