sokpet Posted December 18, 2011 Share Posted December 18, 2011 Anybody succeded to make thumbs with zoom on product list page? The idea is that product page is always hidden and the client buys directly from product list page. So everything is done, only thing which is missing is how to move the exactly the same image preview system that is used on product page for product-list page. I mean one photo with thumbs and enlarger.... Any ideas? Link to comment Share on other sites More sharing options...
sokpet Posted December 19, 2011 Author Share Posted December 19, 2011 I saw many people asking this feature, I can not believe that Presta Teams can not help... Why it is so complecated to place product "image-thumb-fancybox" box, in any place that needed. Nobody tried to place it on product-list.tpl for version 1.4 ? Thanks in advance for those who could give at least some hints... Link to comment Share on other sites More sharing options...
Mike Kranzler Posted December 19, 2011 Share Posted December 19, 2011 Hi sokpet, Have you tried razaro's suggestion posted here? Please let me know if that works for you. -Mike Link to comment Share on other sites More sharing options...
sokpet Posted December 20, 2011 Author Share Posted December 20, 2011 Thank you Mike this is already something. Thanks to razaro´s suggestion I changed product-list as follows: this part goes on top {if isset($products)} <script type="text/javascript" src="{$content_dir}js/jquery/jquery.fancybox-1.3.4.js"></script> <link media="screen" type="text/css" rel="stylesheet" href="{$content_dir}/css/jquery.fancybox-1.3.4.css"/> <script type="text/javascript"> {literal} $(document).ready(function() { $('.thickbox').fancybox({ 'hideOnContentClick': true, 'transitionIn' : 'elastic', 'transitionOut' : 'elastic' }); }); {/literal} </script> an in the part where image is: <div class="product_img_link"> <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" class="thickbox" alt="{$link->getImageLink($product.link_rewrite, $product.id_image, 'thickbox')}" /> </div> Like that I could initialize fancybox on product-list, but it says "The requested content can not be loaded" What else is missing? Another problem is how to plug in thumbs.... I tried different ways but it does not work. Any hint please? Link to comment Share on other sites More sharing options...
Mike Kranzler Posted December 20, 2011 Share Posted December 20, 2011 Hi sokpet, razaro would probably be the best to provide suggestions on anything to include in the code snippet he created, but as for plugging in thumbnails, have you already tried regenerating thumbnails in your Back Office under Preferences > Images? -Mike Link to comment Share on other sites More sharing options...
sokpet Posted December 20, 2011 Author Share Posted December 20, 2011 Hello Mike, surely I will ask razaro if he can help. Thumbnails are perfectly generated and working on poduct page (as it should be). The problem is how to move it on product-list page as well. Any suggestions would be kindly welcome. Thanks Link to comment Share on other sites More sharing options...
razaro Posted December 20, 2011 Share Posted December 20, 2011 Hi sokpet To show fancybox you need anchor tag so code where image is <a href="{$link->getImageLink($product.link_rewrite, $product.id_image, 'thickbox')}" class="product_img_link" title="{$product.name|escape:'htmlall':'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} /></a> and then js code is bit defferent $('.product_img_link').fancybox({ 'hideOnContentClick': true, 'transitionIn' : 'elastic', 'transitionOut' : 'elastic' }); this is for default theme so maybe you need to change it a little. Just note class of anchor tag is used in js code to call fancybox. Also if you using Prestashop version 1.4.x you should override appropriate controller and use addCSS and addJS functions. And for main question, adding thumbnails to product-list, I think that there are some solutions on forum, but it does need some work to do it. What is needed is to pass images, for each product, to category page for example. That can probably be done by overriding CategoryController and making multiarray $product_images where key will be productID and value will be array of images for product with same ID. This is just idea and if I find solution for this will post it . Link to comment Share on other sites More sharing options...
sokpet Posted December 20, 2011 Author Share Posted December 20, 2011 Thanks razaro yes, this is version 1.4.4.6 the only controllers to change that I can see it is ProductController.php and could be FrontController.php and also ParentOrderController.php, do you mean to change "order" of addCSS and addJSS in ProductController.php for setMedia function? Unfortunarely could not find appropriate solution for thumbnails. There were several discussions but without result. I will check again. What is needed is to pass images, for each product, to category page for example. That can probably be done by overriding CategoryController and making multiarray $product_images where key will be productID and value will be array of images for product with same ID. I will give it a try, if I have some news or results I will post it. Thanks you again Link to comment Share on other sites More sharing options...
sokpet Posted December 20, 2011 Author Share Posted December 20, 2011 Fancybox now works perfect on product-list page. Tested on 1.4.4.6. Still "fighting with thumbs".... Thanks Link to comment Share on other sites More sharing options...
sokpet Posted December 21, 2011 Author Share Posted December 21, 2011 Moved and tested on 1.4.6.2 fancybox for main image works fine... For thumbs I changed as follows: {foreach from=$products item=image name=images} <div class="pl-thumbs1"> <a href="{$link->getImageLink($product.link_rewrite, $product.id_image, 'thickbox')}" rel="other-views" class="pl-thumbs" title="{$image.legend|htmlspecialchars}"> <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small')}" alt="{$image.legend|htmlspecialchars}" height="{$smallSize.height}" width="{$smallSize.width}" /> </a> </div> {/foreach} but it does not run properly... shows duplicated thumbs, opens well with fancybox, in fancybox mode it scrolls over all images on the page..... any hint please.....??? Link to comment Share on other sites More sharing options...
sokpet Posted January 2, 2012 Author Share Posted January 2, 2012 The task is done. Unfortunately that was not just to change one controller, it much more complicated Finally I have it. If somebody needs the same I have ready solution. (pm me for details.) B.R. Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted January 3, 2012 Share Posted January 3, 2012 Hi B.R.! I would like to see your final result if possible. Can you post a URL? Marty Shue Link to comment Share on other sites More sharing options...
Mike Kranzler Posted January 3, 2012 Share Posted January 3, 2012 Thanks sokpet and razaro! I'll go ahead and mark this as solved for you, but can you please post the information here for other users? -Mike Link to comment Share on other sites More sharing options...
sokpet Posted January 3, 2012 Author Share Posted January 3, 2012 Hi Marty Shue, who is B.R? I have it on local for the moment. When I have time I upload it on a test server. Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted January 3, 2012 Share Posted January 3, 2012 Sorry for that! It appeared you signed your post "B.R." so I addressed my post to that. My mistake I would be interested in seeing the final result if you have time to put it on a test server. I would appreciate it. Marty Shue Link to comment Share on other sites More sharing options...
Mike Kranzler Posted January 3, 2012 Share Posted January 3, 2012 who is B.R? Shouldn't we ask you? -Mike Link to comment Share on other sites More sharing options...
sokpet Posted January 3, 2012 Author Share Posted January 3, 2012 Never mind Marty. -------------------------------------- Very funny Mike.... isn't it obvious? B.R = Best Regards. ok, as you wish...no more "politeness" here... Link to comment Share on other sites More sharing options...
Mike Kranzler Posted January 3, 2012 Share Posted January 3, 2012 Never mind Marty. -------------------------------------- Very funny Mike.... isn't it obvious? B.R = Best Regards. ok, as you wish...no more "politeness" here... Ahhh I see. For some reason that one didn't register with me (or Marty either, I guess). But (best) regardless, thanks for your updates on this thread, and we look forward to seeing what changes you have made! -Mike Link to comment Share on other sites More sharing options...
ricardoahf Posted May 24, 2012 Share Posted May 24, 2012 (edited) The task is done. Unfortunately that was not just to change one controller, it much more complicated Finally I have it. If somebody needs the same I have ready solution. (pm me for details.) B.R. hello...you could tell me how you did it .. i have the same problem Edited May 24, 2012 by ricardoahf (see edit history) Link to comment Share on other sites More sharing options...
janekbar5 Posted October 4, 2012 Share Posted October 4, 2012 me too I need thumbs on product lising Link to comment Share on other sites More sharing options...
janekbar5 Posted October 4, 2012 Share Posted October 4, 2012 for all who wants to display all images on product-list.tpl 1 follow this thread http://www.prestashop.com/forums/topic/96085-rollover-image-in-product-list/ 2 download rollover.zip provided by DGV Posted 06 August 2012 - 02:07 AM 3 unpack zip upload files 4 open uploaded file override/classes/Category.php change this: SELECT * from `'._DB_PREFIX_.'image` WHERE id_product="'.$product_id.'" ORDER BY `position` LIMIT 0,2 to that: SELECT * from `'._DB_PREFIX_.'image` WHERE id_product="'.$product_id.'" ORDER BY `position` all images should appear on product-list.tpl Link to comment Share on other sites More sharing options...
bill4932 Posted October 11, 2012 Share Posted October 11, 2012 What controller files do you have to edit to get this to work, Link to comment Share on other sites More sharing options...
Strangelove Posted November 5, 2012 Share Posted November 5, 2012 Hi, I already managed to get thumbnails on product-list and fancybox working. But I have a problem now: when hovering thumbnails it should load it's image on #bigpic but it's loading all thumbnails on first product #bigpic. I already managed to change #bigpic id. <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'large_default')}" class="jqzoom" alt="{$link->getImageLink($product.link_rewrite, $product.id_image, 'thickbox_default')}" title="{$product.name|escape:'htmlall':'UTF-8'}" id="bigpic_{$product.id_product}" width="{$largeSize.width}" height="{$largeSize.height}" /> Now works like this: Product 1 #bigpic_1; Product 2 #bigpic_2; Product 3 #bigpic_3; etc. The only thing left is editing the .js so thumbnails will be loaded at its corresponding product #bigpic_ It has to be here but I can't figure it out, I can't manage to get product-id variable on product.js: function displayImage(domAAroundImgThumb, no_animation) { if (typeof(no_animation) == 'undefined') no_animation = false; if (domAAroundImgThumb.attr('href')) { var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large'); if ($('#bigpic).attr('src') != newSrc) { $('#bigpic).fadeOut((no_animation ? 0 : 'fast'), function(){ $(this).attr('src', newSrc).show(); if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled) $(this).attr('alt', domAAroundImgThumb.attr('href')); }); } $('#views_block li a').removeClass('shown'); $(domAAroundImgThumb).addClass('shown'); } } Can anyone help me, please? Link to comment Share on other sites More sharing options...
Recommended Posts