Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Listing Enhancements, Thumbnails & Manufacturer Headings


spooks

Recommended Posts

There are two places you need to make a replacement:

 

I refer to the product_listing.php from the latest distrib (1.9)

 

line 196:

 

replace:

$lc_text = $link . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], PRODUCT_IMAGE_WIDTH, PRODUCT_IMAGE_HEIGHT) . '</a>';

with:

$lc_text = $link . tep_image(DIR_WS_IMAGES . (file_exists(DIR_WS_IMAGES . $listing['products_image']) ? $listing['products_image'] : 'no-image.jpg'), $listing['products_name'], PRODUCT_IMAGE_WIDTH, PRODUCT_IMAGE_HEIGHT) . '</a>';

 

then line 327:

 

replace:

$image = $products['products_image'];

with:

$image = (file_exists(DIR_WS_IMAGES . $products['products_image']) ? $products['products_image'] : 'no-image.jpg');

 

this assumes an image called 'no-image.jpg' exists in the images dir

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

using product_listing.php,v 2.1.5

 

The image file must be put in the catalog/images folder, not the folder with your images in it.

 

Now when and image does not exist, the server will not make a WAG and just show the next closest image, I also found where to go to stop EP to stop deleting images, when an upload is performed. Two big fixes and it is just Monday !!!

 

I had to change the following to get the "NO-IMAGE" to work, not running the latest and greatest. YET !

 

I am running SPPC, that is why the numbering might be off !

 

 

Line 213

 

Replace this

 

   $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'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

 

with this

 

   $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 . (file_exists(DIR_WS_IMAGES . $listing['products_image']) ? $listing['products_name'] : 'no-image.jpg'), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

 

Line 215

 

Replace this

 

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

 

with this

 

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

 

 

Line 232

 

Replace this

 

'text'  => (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id']) ? '<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>' : '<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>' ));   }

 

with this

 

'text'  => (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id']) ? '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . (file_exists(DIR_WS_IMAGES . $listing['products_image']) ? $listing['products_image'] : 'no-image.jpg'), $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>' : '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . (file_exists(DIR_WS_IMAGES . $listing['products_image']) ? $listing['products_image'] : 'no-image.jpg'), $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>' ));   }

 

 

Line 382

 

Replace this

 

$image = $products['$products_image'];

 

with this

 

$image = (file_exists(DIR_WS_IMAGES . $products['$products_image']) ? $products['products_image'] : 'no-image.jpg');

 

 

Line 390

 

Replace this

 

   $image = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $image, ($addimages ? (tep_not_null($selected_image['images_description']) ? $selected_image['images_description'] : (tep_not_null($selected_image['products_image_description']) ? $selected_image['products_image_description'] : $products['products_name'])) : $products['products_name']), PRODUCT_IMAGE_WIDTH, '') . '</a>' . '<br><br>';

 

with this

 

   $image = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . (file_exists(DIR_WS_IMAGES . $image) ? $image : 'no-image.jpg'), ($addimages ? (tep_not_null($selected_image['images_description']) ? $selected_image['images_description'] : (tep_not_null($selected_image['products_image_description']) ? $selected_image['products_image_description'] : $products['products_name'])) : $products['products_name']), PRODUCT_IMAGE_WIDTH, '') . '</a>' . '<br><br>';

 

 

 

Thanks for the directions SPOOKS !

Link to comment
Share on other sites

Hi Sam as requested i will comment in this topic instead of the topic on product listing sort

 

my original question was :

Hi Sam thank you for your efforts to change the sort orders

 

i was able to change the sort order from product name to date added

but i still have an question

not every category product list is suitable for the date added , some are better by name

i have seen several sites here there is an drop down list above the the product list

so any visitor looking through the product list can choose for themselve if they want the list sorted by date added , name a-z, or price , or even by bestsellers

 

i haven't found an module for this

and i am not an programmer

it would be the ultimate if it could work this way ,

 

so visitors can chose their preferd way of sorting

 

you as the master of product sorting do you know how this can be done ?

 

 

you responded

 

 

date_added is not part of the sql query so it would take a few mods to include that, bestsellers would require a whole new query, so more extensive mods to add that!

 

If you wish to comment further please do so in the support thread for Product Listing Enhancements, Thumbnails & Manufacturer Headings .

 

 

My comment

i was aware that this is not an easy mod to build , therefore i am searching for people who know what they are doing

several of my suppliers have this option build in their webshop one of them is murphy magic: see example http://www.murphysmagic.com/Search.aspx?a=16&c=108 (althought not oscommerce site)

therefore i was wondering if this could be done, i my self think it would be a great addition especially for large productlisting with lots of changes every week

so returning visitors have an easy update and see the latest additions first but than easily can change their sort view to bestesellrs or A-Z or price range

 

Arthur

Link to comment
Share on other sites

I would like to resize a few things.

(this is a re-work in progress)

 

First:

 

Please view this page:

http://cal-custom-cruisercom.wearewebs.com...x.php?cPath=132

 

- I have 6 child categories: I would like it to display only 3 per row. So that it fits inside the parameters that are there. Could someone tell me where to fix this.

 

 

Second

Please view this page:

http://cal-custom-cruisercom.wearewebs.com...Path=132_133_88

 

- The Price column is too wide, as well as the Product Name column. Where can I edit these parameters?

 

Your help would be appreciated.

Thanks,

Kristy

Link to comment
Share on other sites

1st due to the hacks template writers use contribs rarely fit well with them.

 

For the most part you need to be good at coding to fix/modify templates, but then if u were you would'nt have bothered with one in the first place!!

 

2nd Your site is rediculasly small, 98% of net users use a resolution or 1024x768 or greater, so why are u catering for the 2% that have a set up from the 60s!!

 

Make your site bigger, it'll make it alot easier for you.

 

Examine the docs esp settings to alter things.

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

1st due to the hacks template writers use contribs rarely fit well with them.

 

For the most part you need to be good at coding to fix/modify templates, but then if u were you would'nt have bothered with one in the first place!!

 

2nd Your site is rediculasly small, 98% of net users use a resolution or 1024x768 or greater, so why are u catering for the 2% that have a set up from the 60s!!

 

Make your site bigger, it'll make it alot easier for you.

 

Examine the docs esp settings to alter things.

 

 

Actually, I was just using what was already there. I inherited this from someone that hasn't done their job. I am trying to learn everything quickly (when it comes to os commerce). There are so many php files, I could spend days trying to located this information. So, could you tell me where I might find this code to modify the size?

 

Or do you think that a fresh install of OS commerce may be better? I will be relocating the database over to a different server regardless, if I keep this one or just start a new one.

 

I am a beginner when it comes to php. I can't write it, but can typically read and edit ( a small amount, at least enough to be dangerous)

 

Thanks!

Kristy

 

 

 

 

Thanks!

Link to comment
Share on other sites

There are many ways to size, template writers often do lousy ways as they have little clue really, this is the easiest way (and best) to size/center http://addons.oscommerce.com/info/1485

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

Do the install again, but properly this time!!

 

How do I install a contribution http://www.oscommerce.com/forums/index.php?sho...=0#entry1432157

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

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

 

I don't have time to look too closly at this right now, but there maybe something existing if you search, remember the the site search function uses the same product listing for display, you just need give the right parameters. I note on the site you linked they have a button that uses that idea with preset params when u click

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

I delt with that in this thread http://www.oscommerce.com/forums/index.php?sho...c=308798&hl= AGAIN!!

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

How to remove extra code?

 

When i use Product Listing Style = thumbnails and Product Listing per row = 3 (or = 2) at the top of the products thumbnails displayed empty table cell. It creates additional unnecessary space between the header of category and the products thumbnails.

Marked with bold red rectangle - see attached screenshot.

 

How to remove this empty cell?

 

products3row.png

 

 

This is extra code:

<tr>
<td align="center" class="smallText" width="33.3333333333%" valign="top"> </td>
</tr>

 

This is rest of the code:

 

  <tr>
<td align="center" class="smallText" width="33.3333333333%" valign="top"><table class="infoBoxProducts" cellpadding="2" width="200" height="180" ><tr><td valign="top"><table summary="" width="100%" ><tr><td style="text-align:center;" valign="top" height="100" ><br /><a href="http://kmebel.dp.ua/shop2/product_info.php?products_id=12"><img src="images/dvd/die_hard_3.gif" border="0" alt="Die Hard With A Vengeance" title=" Die Hard With A Vengeance " width="140" height="112"></a><br /></td></tr></table><table summary="" width="100%" ><tr><td class="thumbcontent" height="25" ><a href="http://kmebel.dp.ua/shop2/product_info.php?products_id=12"><b>Die Hard With A Vengeance</b></a><br /></td></tr></table><br /><font size="3">$39.99<br /></font></td></tr></table><form name="cart_quantity" action="http://kmebel.dp.ua/shop2/index.php?cPath=3_10&sort=2a&action=add_product" method="post"><br /><br /><input type="hidden" name="products_id" value="12">Quantity: <input type="text" name="cart_quantity" value="1" maxlength="5" size="5"><br /><input type="image" src="includes/languages/english/images/buttons/button_in_cart.gif" border="0" alt="Buy Now" title=" Buy Now "><br /><br /></form></td>

...

Link to comment
Share on other sites

 

Is there for correct spacing in most layouts, line 319 change

 'text' =>  ' ');

to

'text' =>  '');

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

please help... newbbie in osc, after installing the product list enhancement.

 

please see the attached pictue..

what to do?

 

 

 

error.JPG

 

 

 

br,

parot

 

 

help

 

after i modified myos_caommerce/index.php im still seeing the same problem.... the sort order field in not displaying the right word... and also my weight its not.

 

 

and also if i insert maufacturer in my osc admin panel im getting this Fatal error: Call to undefined function tep_get_manufacturer_description() in /home/www/bestsellersmobiles.co.uk/os_commerce/admin/manufacturers.php on line 202

 

 

and also if my editing my manufacturer in my osc admin panel im getting this Fatal error: Call to undefined function tep_get_manufacturer_description() in /home/www/bestsellersmobiles.co.uk/os_commerce/admin/manufacturers.php on line 224

 

 

br,

roy

Edited by loneparot
Link to comment
Share on other sites

I repeat you have failed to intall properly, go over the install very carefully, step by step & do exactly as it says, if u are still unable perhaps u need outside support.

 

PS I consider this a 'fairly easy' install!!

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

Hello,

Thank you for this nice contribution and for the nice little add on ( the quantity box) I was looking foreward to having that one.

 

I really need to add the possibility to have a price break on my site. I tried to add "Quantity Price Breaks Per Product

 

v1.3.6"http://addons.oscommerce.com/info/1242, but the code in the \catalog\includes\modules\product_listing.php as you know is different in the "Product Listing Enhancements" as from the original. And I do not know at all how to do the change.

 

I am posting the parts to change.

If anyone could tell me how to do it or give me some hints. Or tell me if there is another contribution which would work, would be verry nice :rolleyes:

 

Thank you verry much

Have a nice day

 

 

Here are the instructions from the Quantity Price Breaks Per Product contribution: Replace in the original code in product_listing

 

switch ($column_list[$col]) {
         case 'PRODUCT_LIST_MODEL':
           $lc_align = '';
           $lc_text = ' ' . $listing['products_model'] . ' ';
           break;
         case 'PRODUCT_LIST_NAME':
.
.
.
.
.
.
         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;
       }

 

with

 

switch ($column_list[$col]) {
         case 'PRODUCT_LIST_MODEL':
           $lc_align = '';
           $lc_text = ' ' . $listing[$x]['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[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';
           } else {
             $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]

['products_id']) . '">' . $listing[$x]['products_name'] . '</a> ';
           }
           break;
         case 'PRODUCT_LIST_MANUFACTURER':
           $lc_align = '';
           $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]

['manufacturers_name'] . '</a> ';
           break;
         case 'PRODUCT_LIST_PRICE':
           $lc_align = 'right';
           $price_breaks_from_listing = array();
           if (isset($price_breaks_array[$listing[$x]['products_id']])) {
             $price_breaks_from_listing = $price_breaks_array[$listing[$x]['products_id']];
           }
           $pf->loadProduct($listing[$x]['products_id'], $languages_id, $listing[$x], $price_breaks_from_listing);
           $lc_text = $pf->getPriceStringShort();
           break;
         case 'PRODUCT_LIST_QUANTITY':
           $lc_align = 'right';
           $lc_text = ' ' . $listing[$x]['products_quantity'] . ' ';
           break;
         case 'PRODUCT_LIST_WEIGHT':
           $lc_align = 'right';
           $lc_text = ' ' . $listing[$x]['products_weight'] . ' ';
           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[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['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[$x]

['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . 

'</a> ';
           }
           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

[$x]['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
           break;
       }
// EOF qpbpp



It says : Note that apart from the obvious changes in case 'PRODUCT_LIST_PRICE': every instance of $listing['field_name'] has been changed to $listing[$x]

['field_name'] in the code above!

Link to comment
Share on other sites

your site has html coding errors, these r often not apparent with default loyout, but contribs like this, make them show up, u must fix to resolve, the validating service will help find them

 

http://validator.w3.org/check?uri=http%3A/...roducts_new.php

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've seen the validiator, and unfortunately i didn't know how fix it !!

so, is there anyway to enable the hack in product listing in the index, and have the new products page as the origional?

 

 

its not a hack!! its new code!! :angry:

 

just use the original new products file

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

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