spooks Posted February 23, 2009 Author Share Posted February 23, 2009 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!! Quote 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 More sharing options...
spooks Posted February 23, 2009 Author Share Posted February 23, 2009 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. Quote 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 More sharing options...
leirisset Posted February 24, 2009 Share Posted February 24, 2009 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. Quote Link to comment Share on other sites More sharing options...
spooks Posted February 24, 2009 Author Share Posted February 24, 2009 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. Quote 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 More sharing options...
leirisset Posted February 24, 2009 Share Posted February 24, 2009 (edited) 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 February 24, 2009 by leirisset Quote Link to comment Share on other sites More sharing options...
joewy Posted February 25, 2009 Share Posted February 25, 2009 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] Quote Link to comment Share on other sites More sharing options...
spooks Posted February 25, 2009 Author Share Posted February 25, 2009 you have 'order by order by ' no stuttering allowed!! :lol: Quote 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 More sharing options...
boraboras Posted February 25, 2009 Share Posted February 25, 2009 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 Quote Link to comment Share on other sites More sharing options...
joewy Posted February 25, 2009 Share Posted February 25, 2009 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 //--> Quote Link to comment Share on other sites More sharing options...
kurios Posted February 25, 2009 Share Posted February 25, 2009 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. Quote Link to comment Share on other sites More sharing options...
spooks Posted February 25, 2009 Author Share Posted February 25, 2009 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 Quote 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 More sharing options...
spooks Posted February 25, 2009 Author Share Posted February 25, 2009 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 ' Quote 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 More sharing options...
spooks Posted February 25, 2009 Author Share Posted February 25, 2009 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. ;) Quote 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 More sharing options...
kurios Posted February 25, 2009 Share Posted February 25, 2009 Ah! Thanks a bunch! Quote Link to comment Share on other sites More sharing options...
Temujin Posted February 27, 2009 Share Posted February 27, 2009 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. Quote Link to comment Share on other sites More sharing options...
spooks Posted February 27, 2009 Author Share Posted February 27, 2009 Have you installed the short description contrib detailed in the instructions (care there are other similar contribs) Quote 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 More sharing options...
Temujin Posted February 27, 2009 Share Posted February 27, 2009 My mistake, I didn't properly set up the description contribution. Quote Link to comment Share on other sites More sharing options...
JonathanR Posted February 28, 2009 Share Posted February 28, 2009 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, Quote Link to comment Share on other sites More sharing options...
spooks Posted February 28, 2009 Author Share Posted February 28, 2009 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) ;) Quote 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 More sharing options...
JonathanR Posted February 28, 2009 Share Posted February 28, 2009 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. Quote Link to comment Share on other sites More sharing options...
danielcompton Posted March 1, 2009 Share Posted March 1, 2009 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 Quote Link to comment Share on other sites More sharing options...
spooks Posted March 1, 2009 Author Share Posted March 1, 2009 I delt with that in this thread http://www.oscommerce.com/forums/index.php?sho...c=308798&hl= Quote 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 More sharing options...
danielcompton Posted March 1, 2009 Share Posted March 1, 2009 I delt with that in this thread http://www.oscommerce.com/forums/index.php?sho...c=308798&hl= Thanks Sam, worked a treat. Quote Link to comment Share on other sites More sharing options...
boraboras Posted March 2, 2009 Share Posted March 2, 2009 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 Quote Link to comment Share on other sites More sharing options...
spooks Posted March 2, 2009 Author Share Posted March 2, 2009 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) Quote 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 More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.