Jump to content



Photo
* * * * * 5 votes

Product Listing Enhancements, Thumbnails & Manufacturer Headings


  • Please log in to reply
1891 replies to this topic

#1   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 29 June 2008 - 21:28

Product Listing Enhancements, Thumbnails & Manufacturer Headings

This contribution is a much changed version of Product Thumbnail Listing that I started only a short while ago, but as thumbnails is now only one part I felt it should be a new contribution.

I was requested to make a contribution to Group Product Listing By Manufacturer with a manufacturer short description. This does exactly that based around the original product listing, so the old admin controls apply along with some new ones.

The thumbnails part displays products with thumbnail images in a grid layout, you define how many boxes per line plus image & box sizes. It shows the product image in a box with product name, price, short description (if you have that) & buy now or details button. This also supports Additional Images (http://addons.oscommerce.com/info/1032) If you have this it will select the medium size image if it exists.

The customer can switch between thumbnails & manufacturer if you set default to either. If you change default you must select a new category to reset your display.

Extra setting are added to admin, additionally existing settings controling the display of Product Name & Price Are Honored.
The database query used is unchanged from the original, so order you set in admin etc will apply as before.

The style of the display is controlled by a new entry in your css, you can set there if you wish a background image, colours, borders etc.

Page views are included in the package so you can see the result.

Written on osC2.2 rc1 with PHP5 and has been tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals compatible.

Contribution can be found at: http://addons.oscommerce.com/info/6051

Edited by spooks, 29 June 2008 - 21:43.

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.

#2   navyhost

navyhost
  • Members
  • 122 posts
  • Real Name:Mike
  • Gender:Male
  • Location:Victoria BC

Posted 29 June 2008 - 22:45

Hi,

Is there a sample of this mod any where?

I was hoping to do this:

Product thumbnail
Product Title
SKU (model #)
Price
BUY NOW | MORE INFO

And do that 3 or 4 accross.


thanks
Sincerely
Mike

#3   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 30 June 2008 - 08:18

Hi,

Is there a sample of this mod any where?

I was hoping to do this:

Product thumbnail
Product Title
SKU (model #)
Price
BUY NOW | MORE INFO

And do that 3 or 4 accross.


thanks


It would be an easy mod to add the SKU & have BUY NOW | MORE INFO, you can have as many across as you like.

Page views are in the package.
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.

#4   lindsayanng

lindsayanng
  • Members
  • 4,258 posts
  • Real Name:Lindsay
  • Gender:Female
  • Location:Milford, Connecticut U.S.A.

Posted 30 June 2008 - 18:07

i have a quick question.. Since i have the product thumbnail listing in my site already, should i re-write all of the files and just do a clean install of this new one, or is there an easy way to update from the product listing thumbnails to this "newer" version (even though it is a different contribution.
A great place for newbies to start
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

Proud Memeber of the CODE BREAKERS CLUB!!

#5   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 30 June 2008 - 18:16

Hi,

The new product_listing_setup.php will check on your existing status and update accordingly, so just replace files as neccessary & run product_listing_setup.php.

I had though of getting the setup to tell you what it found first, but then descided it wasnt really worth the extra effort.

I hope you find the Manufacturers Description bit strait forward, I installed short description yonks ago, so don't remember it well, if its awkward perhaps it needs a rewrite.


/wink.gif' class='bbc_emoticon' alt=';)' />
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.

#6   navyhost

navyhost
  • Members
  • 122 posts
  • Real Name:Mike
  • Gender:Male
  • Location:Victoria BC

Posted 30 June 2008 - 18:42

Hi Sam,

This is a great mod you got here. I ran into a slight problem however,

I am using the thumbnail setting, and when I go to view a category the thumbnail size settings are using the product image height and width from the settings in admin/configuration/images thus making the images very big.

I tried changing the settings from admin/configuration/product listing but there is no affect. Any help or suggestions is greatly appreciated.
Sincerely
Mike

#7   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 30 June 2008 - 18:56

Have you run the setup file?, the setting in admin/configuration/product listing is Product Listing Image Width if that doesnt exist the image will be shown full size, whatever that is, it doesnt use any other settings.

The listing view use the SMALL_IMAGE_WIDTH / HEIGHT setiings if set to show a image.
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.

#8   lindsayanng

lindsayanng
  • Members
  • 4,258 posts
  • Real Name:Lindsay
  • Gender:Female
  • Location:Milford, Connecticut U.S.A.

Posted 30 June 2008 - 19:03

thanks sam. I will be doing this first thing when i get home!! i hate doing ANYTHING here on my work cpu because it really is SUPER slow.. it takes 15 minutes just to download the existing file so i have a back up copy..
A great place for newbies to start
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

Proud Memeber of the CODE BREAKERS CLUB!!

#9   navyhost

navyhost
  • Members
  • 122 posts
  • Real Name:Mike
  • Gender:Male
  • Location:Victoria BC

Posted 30 June 2008 - 19:10

Have you run the setup file?, the setting in admin/configuration/product listing is Product Listing Image Width if that doesnt exist the image will be shown full size, whatever that is, it doesnt use any other settings.

The listing view use the SMALL_IMAGE_WIDTH / HEIGHT setiings if set to show a image.


Yep ran the setup but to make sure I ran it again and got this message:
Enhanced Product Listing Setup

Enhanced Product Listing configuration appears to be set up already. Aborted Operation.


I tried changing the setting again from the product listing end with no luck than tried adjusting the small_image_width etc... from the /config/image
Sincerely
Mike

#10   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 30 June 2008 - 19:22

Not sure whats happening there, the variable used is PRODUCT_IMAGE_WIDTH if you have set this up as a constant somewhere that could cause the problem, you could try manually setting the value at the start of product_listing.php to see if that has an effect, you could also check its value is as you`ve set in admin by adding
$to = PRODUCT_IMAGE_WIDTH; print "<script>alert('$to');</script>";
at the start of product_listing.php & see what value gets displayed in the alert is the same as you set.
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.

#11   navyhost

navyhost
  • Members
  • 122 posts
  • Real Name:Mike
  • Gender:Male
  • Location:Victoria BC

Posted 30 June 2008 - 22:46

Not sure whats happening there, the variable used is PRODUCT_IMAGE_WIDTH if you have set this up as a constant somewhere that could cause the problem, you could try manually setting the value at the start of product_listing.php to see if that has an effect, you could also check its value is as you`ve set in admin by adding

$to = PRODUCT_IMAGE_WIDTH; print "<script>alert('$to');</script>";
at the start of product_listing.php & see what value gets displayed in the alert is the same as you set.


Hi Sam

Thanks for the hand, when I change the product image from the "image" section it changes this way but the unfortunate part is it changes the size of the thumbnail on the product_info page.

My best bet is probably to change it manually on the file. Could I bug you for the line this is on?


thanks a bunch
Sincerely
Mike

#12   navyhost

navyhost
  • Members
  • 122 posts
  • Real Name:Mike
  • Gender:Male
  • Location:Victoria BC

Posted 01 July 2008 - 01:39

Hi Sam

Thanks for the hand, when I change the product image from the "image" section it changes this way but the unfortunate part is it changes the size of the thumbnail on the product_info page.

My best bet is probably to change it manually on the file. Could I bug you for the line this is on?


thanks a bunch


I found a way to fix it,

On line 197 it was: PRODUCT_IMAGE_WIDTH so I changed it to SMALL_IMAGE_WIDTH
Sincerely
Mike

#13   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 01 July 2008 - 08:33

I found a way to fix it,

On line 197 it was: PRODUCT_IMAGE_WIDTH so I changed it to SMALL_IMAGE_WIDTH


Thats a way around your problem, something must be upsettiing the PRODUCT_IMAGE_WIDTH width variable though, does it show the correct value in admin/configuration/product listing in 'Product Listing Image Width' ?

Its possible there`s a minor corruption in the database, I came accross this during testing & wrote the setup file to avoid it, but I suppose it could creap in now & then. If the field is corrupted you can set it, but it always returns back to NULL value, the easy way to fix is with Total Configuration http://addons.oscommerce.com/info/5040, a very easy install.

You open Total Configuration select product listing from drop down, select 'Product Listing Image Width' / PRODUCT_IMAGE_WIDTH then select UNLOCK then edit field then save

That rewites the field to the database clearing any corruption.

Edited by spooks, 01 July 2008 - 08:35.

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.

#14   lmcgee98

lmcgee98
  • Members
  • 1 posts
  • Real Name:Liam McGee

Posted 01 July 2008 - 11:48

Cheers for going to the effort... should be a great contribution

installed and everything fine in "listing" mode

Ideally i want to display products in the thumbnail view, three across

Unfortunately when i do this my products "spill" out so they are now off the monitor and the images seem to be random sizes (basically depending on the size of the original file)

There is also a lot of space between colums

Any ideas?

like i said though, in "listings" mode everything is working fine and looking beautiful

#15   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 01 July 2008 - 12:10

Sounds like you have a similar problem to navyhost!! Frank reported the file was corrupt when he downloaded, although it seamed OK when I tested, anyway I`ll rezip & upload again in case thats the problem.
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.

#16   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 01 July 2008 - 14:23

Just uploaded a new version, took a long time so I hope this ones OK!!

Minor change, modified the code so if manufacture list is selected, but no manufacturers exist for that category, the display will revert to standard listing rather than show blank display.

As some poeple have had setup errors, so I`ve added a debug option, if you have any trouble, find at the start of product_listing.php
$debug = 'no'; change this to $debug = 'yes'; then report the alert message here.
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.

#17   Marker

Marker
  • Members
  • 241 posts
  • Real Name:David

Posted 01 July 2008 - 15:03

Great contribution spooks (as always). I'm having some issues getting to work as I would like because I have graphical borders contrib installed (http://addons.oscommerce.com/info/1702).

Is there anyway to separate product listing into multiple tables? So each manufacturer has its own table so I can put a border around each. At the moment I have a border around the whole thing (see screen shot below).

Also I have problems with the column widths, as you can see from the screen shot below. How do I make the product list coluwm wider and the others narrower?

[img]http://cfbsupplies.co.uk/images/screen.jpg[/img]

Thanks. /smile.gif' class='bbc_emoticon' alt=':)' />

#18   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 01 July 2008 - 15:47

I set all the columns the same width with: width="'.(100/sizeof($column_list)) as otherwise they wont match up between manufacturers, you could force one wider with an image ie:

line 167:

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


change to:

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . 
$listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b>' . ($listing['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<br><span class="short">' . $listing['short_desc'] . '</span>' : '') . '<br>'.tep_draw_separator('pixel_trans.gif', '200', '1');}

set the 200 to whats needed

For your table style:

line 82 after:

if (tep_db_num_rows($filterlist_sql)) {

add:

$border2 = '<table class="infoBoxManu" cellpadding="4" width="100%"><tr><td>';
	$border2end = '</td></tr></table>';

line 87:

echo tep_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '100%', '1');


replace with:

echo $border2;


line 223:

if ($rows) new productListingBox($list_box_contents); 
	
}   // man loop;
replace with:

if ($rows) new productListingBox($list_box_contents); 
	echo $border2end;
}   // man loop;

Then set your css with infoBoxManu class

Let me know how it works out.

/cool.gif' class='bbc_emoticon' alt='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.

#19   mrrht

mrrht
  • Members
  • 1 posts
  • Real Name:rohit

Posted 01 July 2008 - 17:21

when i am trying to download this addon from http://addons.oscommerce.com/info/6051 i am getting "404 File Not Found"

any pointers?

mrrht

#20   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 01 July 2008 - 17:24

when i am trying to download this addon from http://addons.oscommerce.com/info/6051 i am getting "404 File Not Found"

any pointers?

mrrht


Keep trying, the server gets overloaded sometimes, I just tried & it was fine.
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.