Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Listing Enhancements, Thumbnails & Manufacturer Headings


spooks

Recommended Posts

Distorted images with 'On the Fly' Auto Thumbnailer using GD Library http://addons.oscommerce.com/info/2226

 

I have looked at this issue & see bugs in that contrib. If tep_image is called with only one image dimension set it calculates incorrect dimensions creating distortion.

 

What follows correct one obvious bug and creates a work-around for the issue.

 

1. The obvious bug, % is checked, then ignored!!!

 

in html_output.php

 

find:

 

 

// Don't calculate if the image is set to a "%" width
if (strstr($width,'%') == false || strstr($height,'%') == false) {
	$dont_calculate = 0;
} else {
	$dont_calculate = 1;
}

// Dont calculate if a pixel image is being passed (hope you dont have pixels for sale)
if (!strstr($image, 'pixel')) {
	$dont_calculate = 0;
} else {
	$dont_calculate = 1;
}

replace with:

 

 

$dont_calculate = (strstr($width,'%') || strstr($height,'%') || strstr($image, 'pixel'));

 

the work around:

 

In html_output.php

 

find:

 

 

if (!is_file($src)) {
 $src = "images/no_image.jpg";
 }

add after:

 

 

$scale = ($width && $height);

find:

 

 

if ($image_size[0] != $width || $image_size[1] != $height) {

 

replace with:

 

 

if (($image_size[0] != $width || $image_size[1] != $height)  && $scale) {

Hope that helps someone!!

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

Having looked at these, if you wish to use this method ( I`m not conviced it actually achieves much, if any, saving ) I recommend you try

 

oscThumb http://addons.oscommerce.com/info/5491

 

Thats much better written, & barring a few minor issues actually works.

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

Bonjour Spooks

 

J'ai installée la version 1.8, et malgré tous mes efforts et la lectures des posts, je n'ai pas réussi à installer la configuration dans product listing.

Product Listing Style (default thumbnail )   			Use Thumbnail view, Manufacturer Listing or old List View. Also select 'Block' or 'Grid' mode.
Product Listing Short Description (default false )			Show the 'Short Description' (if you have that).
Product Listing Manufacturers Description (default false )   		Show the 'Manufacturers Description'
Product Listing Image Width (default 140 )				Product Image Width in listing.
Product Listing Box Width (default 200 )				Set The Individual Product Listing Box Width
Product Listing Box Height (default 180 )				Set The Individual Product Listing Box Height
Product Listing Price Size (default 3 )				Set Product Listing Price Font Size
Product Listing Image Vertical Space (default 100)		Image Vertical Space in thumbnail, set to the height of largest product image.
Product Listing Name Vertical Space (default 25)		Name Vertical Space in thumbnail, sets vertical space for name & short description (if used).
Product Listing Per Row (default 2 )			  Set Number Of Products To List Per Row
Product Listing Buy Now / Details Button 			Display ‘Buy Now’, ‘Details’ Button or both or nothing
Product Listing Headings  (default true)			Display Listing Column Headings (setting false means user sort with drop down only).
Product Listing Style Switch  (default true)			Provide the user the option to switch listing style.

J'ai lancé plusieurs fois product_listing_setup.php et les requêtes ont bien étés dans la table configuration, mais rien n'apparait dans le back office : admin=>configuration=>product listing.

Je ne sais plus quoi faire.

Link to comment
Share on other sites

Salut, je pense que le français est le problème,

 

Je suppose que vous avez changé les noms des groupes, afin que 'Product Listing', c'est maintenant quelque chose d'autre. Je n'avais pas envisagé cette possibilité, il n'existe pas de fichier de langue pour cela, mais comme j'ai fait avec l'option de 'total configuration' Je suppose que je devrais avoir pensé.

 

Le fichier d'installation semble pour le groupe appelé 'Product Listing' si vous n'avez pas qu'il aura la mise en place dans le groupe 0 (de sa non-affectés), car c'est pour masquer les paramètres de 'total configuration' ne montre pas, et que la «cachées» du pavillon, il ne sera pas diffusée dans l'administration ou l'autre.

 

L'option la plus facile, si vous l'avez, serait de restaurer votre dBase à pré-installer puis renommer "Liste des produits" groupe 'Product Listing', puis les installer à nouveau.

 

Si vous ne pouvez pas vous devriez être en mesure d'éliminer les champs avec un total de configuration, une fois modifié, j'ai ajouté plus de fonctionnalités à ce dernier depuis le télécharger, ce mai de ne pas fonctionner.

 

Au 'total configuration' trouverez:

 

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

(apparaît deux fois)

 

commentaire sur chaque ligne

 

également trouver:

 

// Show them all
} elseif($gID == 0) {

 

changement à la

 

// Show them all
} elseif($gID == '0xx') {

 

Vous devriez maintenant être en mesure d'afficher et de modifier le groupe 0 prendre garde à ne pas supprimer les paramètres d'origine.

 

Si vous avez la fonction de votre version, vous pouvez également déplacer les champs à la corriger groupe.

 

J'espère que mon français est assez bon pour vous de comprendre tout cela.

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

J'ai trouvé la solution la configuration_group_id était configuré à 0 pour tous ces paramètres dans la table configuration.

 

Merci encore de cette très belle contribution.

 

;)

 

Et votre français est bien meilleur que mon anglais. :blush:

Edited by leirisset
Link to comment
Share on other sites

I just installed and everything looks fine except for the sort by price. All other sorts work. This is the error I get.

 

Any help will be appreciated.

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by final_price , pd.products_name limit 0, 10' at line 1

 

select p.products_image, pd.products_name, p.products_quantity, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id, products_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '39' order by order by final_price , pd.products_name limit 0, 10

 

[TEP STOP]

Link to comment
Share on other sites

you have 'order by order by '

 

no stuttering allowed!! :lol:

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'm using the Product Listing Enhancements contribution in my site.

I have a basic question to modify it: I want to show all the goods in the product list including 0 quantity goods. How can I remove "Buy Now" button from 0 quantity products while keeping the button on the products more than 0 quantity?

 

I checked all the pages and and found some codes about "buy now" button but those couldn't helped me.

 

Thanks!

 

Bora

Link to comment
Share on other sites

you have 'order by order by '

 

no stuttering allowed!! :lol:

 

Hi Sam,

Thanks for your response. I can't find where this is coming from. I do have "Display Categories and Products 1_2" contribution installed and found the following code in catalog/index.php. Can this be causing the problem?

 

// BOE: Display Categories and Products

case 'PRODUCT_LIST_PRICE':

$listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

break;

}

}

if ($category_depth == 'products') echo '<td width="100%" valign="top">';

?>

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

<!-- EOE: Display Categories and Products //-->

Link to comment
Share on other sites

Hi!

 

Thanks for a great mod! I had some serious issues at first but they've been sorted out thanks to the support in this thread.

 

I have only one problem left, i use the "thumbnails in grid" mode as deafult and it's looks great but when i click "show list" the list turns up sorted according to manufacturer, with a heading and box for each. And no matter how i try to sort the list it's still according to manufacturer. I can only sort within each manufacturer box so to speak.

 

A simple way to fix this would be to simply turn off the option for customers to click "show list" but i kinda like to keep it there and i also like to know why it displays this way?

 

Thanks in advance.

Link to comment
Share on other sites

It would mean some code changes to product_listing.php to do that, if I get time I`ll take a look,

 

however if you set the price to 0 & a quantity of 1 price will be displayed as P O A and only a details button shown

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

This has nothing to do with my contrib as the edits to mindex.php are minimal & no additional 'order by ' are added anywhere

 

The dropdown utilises existing code, mearly alters display method.

 

 

you need to look ealier in index.php to find your superfluos 'order by '

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

When this contrib was initially commisioned the manufacturer mode was a prime requirement, the thumbnail option I had already created for Lindsay, so the to live together.

 

What you wish is to switch between thumbnail(grid) & default style.

 

in product_listing.php find: (appears twice)

 

if (!strstr(PRODUCT_THUMBNAIL_VIEW, 'list') && LISTING_SWITCH != 'false' && !$empty_list && (!$switch_pos || $switch_pos == 2)) echo '<br><span class="smalltext"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('list')). 'list='.(strstr($thumbnail_view, 'thumbnails') ? 'manufacturer' : 'thumbnails')) . '">' . (strstr($thumbnail_view, 'thumbnails') ? LIST_VIEW : THUMB_VIEW).'</a></span><br /><br />';

 

change each to:

 

if (!strstr(PRODUCT_THUMBNAIL_VIEW, 'list') && LISTING_SWITCH != 'false' && !$empty_list && (!$switch_pos || $switch_pos == 2)) echo '<br><span class="smalltext"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('list')). 'list='.(strstr($thumbnail_view, 'thumbnails') ? 'default' : 'thumbnails')) . '">' . (strstr($thumbnail_view, 'thumbnails') ? LIST_VIEW : THUMB_VIEW).'</a></span><br /><br />';

 

Hope sorts it for you.

;)

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,

Thanks for the mod! It works great but I can't get short descriptions to appear. I checked my files as per your instructions, they appear to be OK. I get this error when I include $select_column_list .= 'pd.short_desc, ';

 

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

 

select p.products_image, pd.products_name, pd.short_desc, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id, products_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '10' order by pd.products_name limit 0, 6

 

[TEP STOP]

 

I'm confused.

Link to comment
Share on other sites

Have you installed the short description contrib detailed in the instructions (care there are other similar contribs)

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 see your point. I would prefer the undistorted image.

 

What's bothering me is the line up of product name and product price across the boxes when the image size is different. Any way I could fix this ?

 

Thats what Product Listing Image Vertical Space is for, its detailed in the instructions.

 

Hi all,

 

For a site I am setting up, it is easy enough to get Product Listing images nicely lined up for a specific category by making sure all the items are in the same size pic boxes. However, when a visitor to the site carries out a search for all items from one specific designer, it means pulling in different products from different categories, and these items are often in different pic box sizes - ranging from a depth of 300px to 600px.

 

The solution quoted above by Sam works, and lines up all of the prices and descriptions, but when one item is in a box of 300px, and another item in a box of 600px - it still looks odd.

 

Has anybody worked out a way of getting around this?

 

Thanks in advance,

Link to comment
Share on other sites

Your saying you have different size images for products in different categories?

 

This would always be difficult to deal with as the the only solution I can think of for the moment would be to read all product into memory, measure all image sizes then space for the largest, or sort by size. That would have lots of extra issues & slow processing of all displays. I don't think its worth the hastle.

 

If you look at any template solutions they all use same size images.

 

So why not add a thumbnail solution to ensure all images are same width. like osC Thumb http://addons.oscommerce.com/info/5491

 

(note some thumbnail contribs are bugged, see ealier in this thread)

 

;)

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

Your saying you have different size images for products in different categories?

 

This would always be difficult to deal with as the the only solution I can think of for the moment would be to read all product into memory, measure all image sizes then space for the largest, or sort by size. That would have lots of extra issues & slow processing of all displays. I don't think its worth the hastle.

 

If you look at any template solutions they all use same size images.

 

So why not add a thumbnail solution to ensure all images are same width. like osC Thumb http://addons.oscommerce.com/info/5491

 

(note some thumbnail contribs are bugged, see ealier in this thread)

 

;)

Looking at rival sites, it does seem that they use the policy of everything being in the same pic box size on the initial Product Listing page, and then allow the individual product page to really show the detail. I don't believe visitors will use the search function too much, but it will be used enough to make it worthwhile making everything the same size.

 

I like the look of the link you gave, especially as it states it protects the images, which could be very important (I assume the link you gave isn't the buggy one?) ;)

 

btw - thanks for this contribution, Sam. Out of all the contributions, this one really enabled me to create a top quality looking online shop.

Link to comment
Share on other sites

Hi Sam,

 

Could you tell me how to change the default sorting on the product listing?

 

I want it so the default sorting is price low to high, so it sorts them by price

 

Is there a quick way to do this? I assume this is in includes\product_listing.php as had a look, but didnt know quite how to change this,

 

thanks

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

Hi Sam,

 

Below is a reminder for my help request that I sent last week. I tried to explain my problem in different way:

 

I want to show all the goods in the product list; including the 0 quantity goods. But I need to remove "Buy Now" button from 0 quantity products while keeping the button on the products more than 0 quantity? It's impossible to do that in admin panel and needs some code changes. I tried some codes but couldn't solv it. I'll be glad if you help me.[/indent]

 

Many thanks.

 

Bora

Link to comment
Share on other sites

Hi, I understood your issue, its time thats mine.

 

I`ve had a moment so do this.

 

In index.php add before

 

// show the products of a specified manufacturer

this:

$select_column_list .= 'p.products_quantity, ';

 

in product_listing.php add before

 

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

this:

if (!$listing['products_quantity']) $button = '<br><span class="buy_now"> </span>'. $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS) . '</a> <br><br>';

 

then before:

$show_price = '<br><font size="'.PRODUCT_PRICE_SIZE.'">' . ($products['products_price'] > 0 ? $price : TEXT_POA) . '<br></font>';

add:

if (!$products['products_quantity']) $button = '<br><span class="buy_now"> </span>'. $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS, 'class="thm_buy_now"') . '</a> <br>';

 

That should do it.

 

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

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