marlbor0 Posted August 1, 2015 Share Posted August 1, 2015 Hello fellows, I am not sure how to explain this but I have a list of products: http://wips.in/zaqbolsas/15-colecao As I started adding products and generated combinations of color and size (I used the default color group that comes predefined) some products would display the color options on the product listing (link above) while some products wouldn't. I thought this was a setting I may have forgot to tick in the products that weren't showing so I compared two products, one that used to show the color picker (New York P) on the category listings and one that did not display the color picker on the category listing (New York M), they were identical. I tried then cloning a product that did display the color picker on the category listing (New York P) and modified it, saved as a different name and reference (New York M) and now not a single product display the color picker on the category listing, as seen on the above link. Is this a prestashop bug or is it a setting I am missing? Could this be caused by me using the default color and size groups? I would like to all products to show all their color options on the category listing, the link above. Prestashop version: 1.6.1.0 Thank you very much for your time, have a great day! Link to comment Share on other sites More sharing options...
marlbor0 Posted August 2, 2015 Author Share Posted August 2, 2015 Now I have just added a new product and it is the only one on the list with the color picker, it is the last product on this list: http://wips.in/zaqbolsas/12-produtos Have anyone encountered this issue before? Thank you! Link to comment Share on other sites More sharing options...
bcarron Posted December 11, 2015 Share Posted December 11, 2015 (edited) Hi, I have this problem too, sometimes the color picker appears but most of the times there are no color pickers at all... I have noticed that if I modify the product-list-colors.tpl file and upload it to the server then all color pickers are displayed but if I browse another category that have products without colors and go back to the product list with the colors, the pickers have disappeared. Clearing the cache works too. Looking for a solution too. Edited December 11, 2015 by bcarron (see edit history) Link to comment Share on other sites More sharing options...
dany2234 Posted December 30, 2015 Share Posted December 30, 2015 Hi, I have the same problem. When Cache is disabled color picker in the product container in product-list is shown. When Cache enabled, after 1 -2 times of page refresh the color picker disappear. Please help ... Link to comment Share on other sites More sharing options...
vekia Posted December 31, 2015 Share Posted December 31, 2015 please share url to page case needs verification Link to comment Share on other sites More sharing options...
marlbor0 Posted December 31, 2015 Author Share Posted December 31, 2015 This is the main page of the staging: http://wips.in/zaqbolsas/ This is a category: http://wips.in/zaqbolsas/15-colecao I am sorry I had trouble with the english translation, but I am sure the standard template is easy to navigate regardless of language. The category is showing the color picker at the moment but the main page is not, this may be intentional tho I don't recall colors on the main page, weirdly enough it is still displaying the colors even after I change to page 2 and back to page 1 on the category view, this is one of the actions that would cause the colors to stop showing. Changing the amount of products displayed or sort the products by price would also cause the colors to stop showing, but is seems it also is no longer affecting the colors, great! It does seems like resolved, perhaps on the latest update. Thank you! Link to comment Share on other sites More sharing options...
dany2234 Posted December 31, 2015 Share Posted December 31, 2015 Hi Vekia, This is the link to the staging website category - http://pv.saculcujucarii.ro/41-scaune-auto-0-13-kg (ex: first product in the list should have 5 colors under the product_name in the product-list) Step1. Smarty Cache - Enabled => all product.colors displayed in product-list Step2. All CCC Enabled (except -Smart cache for JavaScript is disabled) First problem: => after a few page refresh all product.colors picker is not visible anymore Second problem: => after a few page refresh email imput field for mailalerts module (for email me when available again) is not visible - http://pv.saculcujucarii.ro/leagan-balansoar-baby-fawn-7517.html Behavior: After Cache clear all problems above solved for a few page loads .. I think until a new cache file is created. Looking forward to hearing from you Vekia, Thank you, Dan Link to comment Share on other sites More sharing options...
dany2234 Posted December 31, 2015 Share Posted December 31, 2015 (edited) Hi Vekia, I found the solution for: "Second problem: => after a few page refresh email imput field for mailalerts module (for email me when available again) is not visible" I was signed in and the email input field is not visible for logged visitors. Sorry, it was my mistake. It remains the problem related with this topic: When: Smarty Cache - Enabled and All CCC Enabled (except -Smart cache for JavaScript is disabled) color-list-container is not visible in product-list (only when cache is enabled). This is the link to the staging website category - http://pv.saculcujuc...ne-auto-0-13-kg (ex: first product in the list should have 5 colors under the product_name) color-list-container is always displayed when browsing with Cache disabled. When Cache enabled, after 1 to 3 times reloading the page - color-list-container is not visible anymore. Deleting Cache or Disable/Enable Cache solve the problem until a new cache is created. First time page reload could display color-list-container for some products. At the same time, other products does not have color-list-container visible. Please see image attached. Reloading the page again will make to disappear color list container for all products. Please check this problem. If you need any further data / details please ask. Best regards, Dan Edited December 31, 2015 by dany2234 (see edit history) Link to comment Share on other sites More sharing options...
RamboRich Posted January 4, 2016 Share Posted January 4, 2016 Having the same exact problem. Color picker shows up some of the times on some products, but not all which have different color selections in the product combinations. Tried clearing cache, force recompile, etc. and nothing works. Wish there was a fix for this. Not sure what's going on but must be something to do with the cache? Link to comment Share on other sites More sharing options...
Tamara F Posted January 7, 2016 Share Posted January 7, 2016 same problem here Link to comment Share on other sites More sharing options...
jaanrs Posted January 23, 2016 Share Posted January 23, 2016 Having the same problem. Color list is loaded the first time, but after a few page refreshes they stop showing. This with cache enabled. With cache turned off, the colors show up correctly every time. Link to comment Share on other sites More sharing options...
svalebech Posted January 27, 2016 Share Posted January 27, 2016 I am having the same problem. Caching off solves it, but it is not a solution. Could somebody help out? Link to comment Share on other sites More sharing options...
Tamara F Posted January 27, 2016 Share Posted January 27, 2016 (edited) there is a temporary fix here: http://forge.prestashop.com/browse/PSCSX-6778 But as the user says it is just a hotfix touching something of the smarty caché (but i do not really understand what i have to do exactly) Having this problem since july and prestashop do not solve it....it is just amazing that a so important software can have a this bug so long Edited January 27, 2016 by Tamara F (see edit history) Link to comment Share on other sites More sharing options...
Tamara F Posted January 30, 2016 Share Posted January 30, 2016 there is a temporary fix here: http://forge.prestashop.com/browse/PSCSX-6778 But as the user says it is just a hotfix touching something of the smarty caché (but i do not really understand what i have to do exactly) Having this problem since july and prestashop do not solve it....it is just amazing that a so important software can have a this bug so long Can anyone telle what are the steps to use the hotfix that i mentioned before? Step by step? Does it helps to see my html code? Here my web https://www.tamaraflamenco.com Link to comment Share on other sites More sharing options...
GuusMichielsen Posted March 9, 2016 Share Posted March 9, 2016 Maybe it is to late for Tamara, but for people who end up here in the future:The hotfix Step by Step: - open the FrontController.php in a text-editor (this file is located at .../classes/controller)- find following code: foreach ($products as &$product) { if (!$this->isCached(PS_THEME_DIR.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; } } } - comment out the if-clause (add two slashes // in front of the 'if' and in front of the } that closes the if-clause) foreach ($products as &$product) { // if (!$this->isCached(PS_THEME_DIR.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; } // } } - upload the FrontController.php - clear cache I had the same issue and I think this fixed it indeed. I guess I'll know in a few hours. 2 Link to comment Share on other sites More sharing options...
FRASCOP Posted March 15, 2016 Share Posted March 15, 2016 It works! thanks...GuusMichielsen Link to comment Share on other sites More sharing options...
RamboRich Posted March 17, 2016 Share Posted March 17, 2016 Tried it and it works for a couple additional products where it didn't before. But there are still many products where the color picker isn't showing up when it should be. Link to comment Share on other sites More sharing options...
GuusMichielsen Posted March 18, 2016 Share Posted March 18, 2016 RamboRich, does the colorpicker never show up for those products, or does it show after you clear the cache and then disappears again after a while? Link to comment Share on other sites More sharing options...
Tamara F Posted March 18, 2016 Share Posted March 18, 2016 Maybe it is to late for Tamara, but for people who end up here in the future: The hotfix Step by Step: - open the FrontController.php in a text-editor (this file is located at .../classes/controller) - find following code: foreach ($products as &$product) { if (!$this->isCached(PS_THEME_DIR.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; } } } - comment out the if-clause (add two slashes // in front of the 'if' and in front of the } that closes the if-clause) foreach ($products as &$product) { // if (!$this->isCached(PS_THEME_DIR.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; } // } } - upload the FrontController.php - clear cache I had the same issue and I think this fixed it indeed. I guess I'll know in a few hours. Finally a user in the forge (in the link I posted) told how to do it, and after clean caché it worked I think it is exaclty as you say but i will post the exactly instruction that i followed: """ FTP: classes/controller/FrontController.php About line 1643 find: foreach ($products as &$product) { if (!$this->isCached(PS_THEME_DIR.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; } } and replace with this: foreach ($products as &$product) { //if (!$this->isCached(PS_THEME_DIR.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; //} } Link to comment Share on other sites More sharing options...
RamboRich Posted March 18, 2016 Share Posted March 18, 2016 (edited) RamboRich, does the colorpicker never show up for those products, or does it show after you clear the cache and then disappears again after a while? When I made the hotfix code changes, it worked for maybe 1 or 2 more products, but that's all. My other products that have multiple color variations aren't showing the color picker at all. Makes no difference after clearing cache, force recompile, etc. I can't get many products to show the color picker. The products that are showing the color picker now (I think I have 3 that are working and showing the picker) seem to stay on and are ok. Its just the many other products that I can't get the picker to show up for some reason. Have no idea why this is. Edited March 18, 2016 by RamboRich (see edit history) Link to comment Share on other sites More sharing options...
GuusMichielsen Posted March 19, 2016 Share Posted March 19, 2016 I'm not really a prestashop specialist, so I can't think of a reason why this is happening. I think you'll have to look for a similarity between the products with the missing color swatches. Is there for instance a certain color/texture in all those products that is not in the products that do show the swatches? Could you share a link to a page in your shop where this is happening? Link to comment Share on other sites More sharing options...
Tamara F Posted March 19, 2016 Share Posted March 19, 2016 I'm not really a prestashop specialist, so I can't think of a reason why this is happening. I think you'll have to look for a similarity between the products with the missing color swatches. Is there for instance a certain color/texture in all those products that is not in the products that do show the swatches? Could you share a link to a page in your shop where this is happening? There is a topic (in Spanish) where people tell it could be a problem in colors using textures. Look that inside of colors attributes there is no "null" color in the prestashop selector field. If there is, just delete the "null" and let it empty (without any caracter) Or just do this sql UPDATE `ps_attribute` SET `color`='' WHERE ISNULL(`color`) (if your table prefix is not "ps_" just change it) i hope it helps Link to comment Share on other sites More sharing options...
RamboRich Posted March 19, 2016 Share Posted March 19, 2016 I'm not really a prestashop specialist, so I can't think of a reason why this is happening. I think you'll have to look for a similarity between the products with the missing color swatches. Is there for instance a certain color/texture in all those products that is not in the products that do show the swatches? Could you share a link to a page in your shop where this is happening? The products are pretty much the same, same colors, etc.. Not using any textures, just basic black, red, green, etc. The shop isn't live yet so its in maintenance mode, but there doesn't seem to be any difference except for some are showing the color picker the others aren't. Link to comment Share on other sites More sharing options...
Tamara F Posted March 20, 2016 Share Posted March 20, 2016 The products are pretty much the same, same colors, etc.. Not using any textures, just basic black, red, green, etc. The shop isn't live yet so its in maintenance mode, but there doesn't seem to be any difference except for some are showing the color picker the others aren't. It seems you did not apply correctly the code modification because it does not matters that some colors are showed and some not. In deed, It was the same what happened to me, some products showed and some others not. Try to modify again very carefully the code with the "//". If your code editor (i use sublime text 2) covert the first part of the code to color grey, you did it correctly. Link to comment Share on other sites More sharing options...
GuusMichielsen Posted March 20, 2016 Share Posted March 20, 2016 It seems you did not apply correctly the code modification because it does not matters that some colors are showed and some not. In deed, It was the same what happened to me, some products showed and some others not. Try to modify again very carefully the code with the "//". If your code editor (i use sublime text 2) covert the first part of the code to color grey, you did it correctly. I assume this is not the case, since RamboRich says that after he applied the code-change the colorswatches that do show don't disappear again. It seems like the disappearing-swatches problem is solved and this problem has a different cause. The products are pretty much the same, same colors, etc.. Not using any textures, just basic black, red, green, etc. The shop isn't live yet so its in maintenance mode, but there doesn't seem to be any difference except for some are showing the color picker the others aren't. If I understand correctly, you noticed the disappearing swatches, applied the code-change and then noticed the other swatches were 'permanently' gone? Are you sure they were there in the first place? If you go back to the old code/clear cache/etc... are all colorswatches showing then? Link to comment Share on other sites More sharing options...
RamboRich Posted March 20, 2016 Share Posted March 20, 2016 (edited) I assume this is not the case, since RamboRich says that after he applied the code-change the colorswatches that do show don't disappear again. It seems like the disappearing-swatches problem is solved and this problem has a different cause. If I understand correctly, you noticed the disappearing swatches, applied the code-change and then noticed the other swatches were 'permanently' gone? Are you sure they were there in the first place? If you go back to the old code/clear cache/etc... are all colorswatches showing then? Ok, yes and no. I have had only a couple of products actually show the color picker in the catalog view originally. I have many other products that should have the color picker showing, but they do not show for some reason. I tried the code-change (hotfix) above, and my code looks exactly like what is explained (code is correct) and it may have fixed maybe one additional product to show the color picker. None were gone after the code change, but there are many other products that should be showing the color picker that aren't. The products are almost identical, using same colors, etc. but they aren't showing the color picker for some reason. Totally strange. I've examined a couple of the products extensively that aren't showing the picker and can't see why the picker isn't being displayed. This is the code as I modified it according to the 'hotfix' (the // if (!$this->isCached(_PS_THEME_DIR_.'product-list-colors.tpl', etc. line is grayed out in my editor). $products_need_cache = array(); foreach ($products as &$product) { // if (!$this->isCached(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; // } } Edited March 20, 2016 by RamboRich (see edit history) Link to comment Share on other sites More sharing options...
GuusMichielsen Posted March 21, 2016 Share Posted March 21, 2016 I honestly don't have a clue why this could be happening, but as I said, I'm not a prestashop expert.Hopefully someone with some more knowledge will help you further. Link to comment Share on other sites More sharing options...
Tamara F Posted March 21, 2016 Share Posted March 21, 2016 Ok, yes and no. I have had only a couple of products actually show the color picker in the catalog view originally. I have many other products that should have the color picker showing, but they do not show for some reason. I tried the code-change (hotfix) above, and my code looks exactly like what is explained (code is correct) and it may have fixed maybe one additional product to show the color picker. None were gone after the code change, but there are many other products that should be showing the color picker that aren't. The products are almost identical, using same colors, etc. but they aren't showing the color picker for some reason. Totally strange. I've examined a couple of the products extensively that aren't showing the picker and can't see why the picker isn't being displayed. This is the code as I modified it according to the 'hotfix' (the // if (!$this->isCached(_PS_THEME_DIR_.'product-list-colors.tpl', etc. line is grayed out in my editor). $products_need_cache = array(); foreach ($products as &$product) { // if (!$this->isCached(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; // } } I do not know if it matters as I am not expert neither but i see a couple of spaces in the // Try with this (it is mine) //if (!$this->isCached(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; //} Clear cache in prestashop backoffice and open a private navigation tab in chrome to be sure is not chrome caché Link to comment Share on other sites More sharing options...
RamboRich Posted March 21, 2016 Share Posted March 21, 2016 Yup tried it and it still isn't working right. Link to comment Share on other sites More sharing options...
JoseR Posted April 28, 2016 Share Posted April 28, 2016 I have the same problem. I had tried the fix but only works with a few products!! No one have this problem?? PS 1.6.1.1 Link to comment Share on other sites More sharing options...
GuusMichielsen Posted April 28, 2016 Share Posted April 28, 2016 (edited) I have the same problem. I had tried the fix but only works with a few products!! No one have this problem?? PS 1.6.1.1 Can you be more specific about your problem? Am I assuming correctly that the following is your situation? Initially all colorswatches are showing, and after a while (a few refreshes of the page), some swatches are disappearing. When you clear the cache, all swatches are back for a few minutes and start disappearing again. If so, this fix could indeed help you. If this is not the case, the problem could be something else and this fix won't help you. In case this is indeed your problem: - did you clear the cache after applying the fix? If not, try doing this. - are you using a caching-system like Memcache/APC/...? If so, try clearing those. - can you identify some similarities between the products where the swatches aren't showing? For instance: they all have the same color associated with them, and the products without any problems don't have this color. Edited April 28, 2016 by GuusMichielsen (see edit history) Link to comment Share on other sites More sharing options...
JoseR Posted April 29, 2016 Share Posted April 29, 2016 Can you be more specific about your problem? Am I assuming correctly that the following is your situation? Initially all colorswatches are showing, and after a while (a few refreshes of the page), some swatches are disappearing. When you clear the cache, all swatches are back for a few minutes and start disappearing again. If so, this fix could indeed help you. If this is not the case, the problem could be something else and this fix won't help you. In case this is indeed your problem: - did you clear the cache after applying the fix? If not, try doing this. - are you using a caching-system like Memcache/APC/...? If so, try clearing those. - can you identify some similarities between the products where the swatches aren't showing? For instance: they all have the same color associated with them, and the products without any problems don't have this color. Thanks GuusMichielsen ! I applied the fix because the colors were dissapeared... With this, now I have products that is showing colors (on the product-list, but you can see it on its file) and other not. If I clear the caché it doesn't change. Then products that not show the colors have not a pattern... any have 2 colors, others 4-5 colors... I'm not using "caching-system like Memcache/APC/". PS 1.6.1.1 Thank you in advance! Jose. Link to comment Share on other sites More sharing options...
GuusMichielsen Posted April 29, 2016 Share Posted April 29, 2016 Jose,Can you post a link to your shop (ideally to a location where this problem is occurring) and the name of a product which should have colors? I'm happy to take a look at it.Guus Link to comment Share on other sites More sharing options...
RamboRich Posted April 29, 2016 Share Posted April 29, 2016 (edited) I can show you an example page where this is happening. When you go to this page https://www.fingereze.com/14-pepper-sprays you will see that there are only two products that show color picker. However, there are other products on the same page that should be showing it, such as this one https://www.fingereze.com/pepper-sprays/20-wildfire-18-pepper-spray-with-rhinestone-leatherette-holster-12-oz.html and also this one, right underneath the other one https://www.fingereze.com/pepper-sprays/72-pepper-shot-pepper-spray-with-colored-leatherette-holster-12-oz.html There are many other products that aren't showing the color picker so i'm not sure what to do. There's nothing complex or different about the ones that are showing versus the ones that aren't. Just some sort of a bug I guess. Edited April 29, 2016 by RamboRich (see edit history) Link to comment Share on other sites More sharing options...
GuusMichielsen Posted May 2, 2016 Share Posted May 2, 2016 (edited) After browsing around a bit, I also couldn't figure out what the problem is. Have you tried temporarily turning on error reporting? When this isn't on, Prestashop doesn't show errors it encounters.This could point you in the right direction. If no errors show up, you'll have to drill down the code to pin-point the location where the problem is.The colors are added to the category-page in the products-list.tpl, somewhere inside this code (depending on your theme) there should be a few lines of code similar to this: {if isset($product.color_list)} <div class="color-list-container">{$product.color_list}</div> {/if} This part is working fine on your website, since the color-list-container - div is appearing. Therefore the {$product.color_list} - part is the problem. In the FrontController.php (here: your-ps-directory/classes/controller) the colorlist is generated. This is most probable the point where something is going wrong. In the FrontController.php, find the addColorsToProductList - function. You'll see this function works with cached values, this part is (as far as I can tell) a little buggy. When you browse the prestashop-forum, you'll see multiple fixes for this function. I think the problem will be solved when you find the right one. The first thing I would try is replacing this line: $tpl = $this->context->smarty->createTemplate(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($products[ $key ]['id_product'])); with this line: $tpl = $this->context->smarty->createTemplate(_PS_THEME_DIR_.'product-list-colors.tpl'); I believe this could solve your problem, if not: try googling for 'addcolorstoproductlist prestashop', you'll find multiple edited versions of this function. I'm confident one of the versions will fix it for you.An important sidenote:The best way to edit these controllers is by creating an override for the function instead of simply replacing the code inside the original file. This way, if you update your prestashop-version, the code-changes aren't lost.To override this function, create a file called 'FrontController.php' in 'your-ps-folder/override/classes/controller' and add this code to the file: <?php /** * Extend FrontController */ class FrontController extends FrontControllerCore { // YOUR CODE HERE!! } After creating this file, copy-paste the addColorToProductList-function from the original FrontController to this override (instead of // YOUR CODE HERE!!) and do the codechanges there. As stated above, I'm not an expert on this matters. If someone notices I've explained something wrong, please correct me.Guus Edited May 2, 2016 by GuusMichielsen (see edit history) Link to comment Share on other sites More sharing options...
JoseR Posted May 3, 2016 Share Posted May 3, 2016 Thank yoy very much again, GuusMichielsen! The problem is just the same than RamboRich's sample. If you want to see it, here is the URL: https://productoselgallo.com/85-hebillas-pulseracalzadobolso The 4 first products have colors, you can see it inside one, and the 5th show the colors... and is just the same than 6th...!!! It's very strange! The FrontController.php is just like as you said but I don't detect changes... About debug errors, no errors was found. Still looking... Link to comment Share on other sites More sharing options...
GuusMichielsen Posted May 3, 2016 Share Posted May 3, 2016 JoseR,Have to tried changing the FrontController like I suggested? Link to comment Share on other sites More sharing options...
JoseR Posted May 3, 2016 Share Posted May 3, 2016 JoseR, Have to tried changing the FrontController like I suggested? Yes, now it is just you said. Link to comment Share on other sites More sharing options...
RamboRich Posted May 3, 2016 Share Posted May 3, 2016 (edited) Yes, JoseR is having the same exact problem as I am. I changed the frontcontroller file as described but it didn't make any difference. I will try googling for a different fix to see if I can come up with anything. Thank you Guus for your suggestions. Edited May 3, 2016 by RamboRich (see edit history) Link to comment Share on other sites More sharing options...
RamboRich Posted May 3, 2016 Share Posted May 3, 2016 Unfortunately, can't find much after doing a search. Just for kicks I duplicated one of the products that was working correctly, but the duplicated product didn't show the colors either. Very weird. Link to comment Share on other sites More sharing options...
GuusMichielsen Posted May 3, 2016 Share Posted May 3, 2016 (edited) JoseR and RamboRich,I'm fairly certain this problem has to do with caching and should be located in the function I suggested.Perhaps this could help you https://www.prestashop.com/forums/topic/471693-color-list-container-ne-saffiche-pas/?p=2227044. (It's in French, but if you don't speak French, Google Translate should be able to help you ) Edited May 3, 2016 by GuusMichielsen (see edit history) Link to comment Share on other sites More sharing options...
RamboRich Posted May 3, 2016 Share Posted May 3, 2016 I made the changes described in the page you linked to. Created a Frontcontroller.php override and still didn't work. However, I DID get it to work by playing around and in the back office, went to Preferences, then Product and selected 'Yes' for the 'Display unavailable product attributes on the product page'. Not sure what that does exactly, but it made it so all my products with color combinations showed the color combinations! Very happy right now, but need to find out what exactly selected 'Yes' for that does to the rest of the products. Link to comment Share on other sites More sharing options...
JoseR Posted May 4, 2016 Share Posted May 4, 2016 (edited) I tried too and nothing! I understand what you say about cache is reason of the problem, but can't understand why some products is working and others not. Thanks Guus!! (sorry my bad english) Edited May 4, 2016 by JoseR (see edit history) Link to comment Share on other sites More sharing options...
RamboRich Posted May 4, 2016 Share Posted May 4, 2016 JoseR, Did you try what worked for me? In Back office, go to Preferences, then Product and select the 'Yes' box for the 'Display unavailable product attributes on the product page'. As soon as I did that and checked the website, all of my products that were missing the color picker showed up with the color picker. Link to comment Share on other sites More sharing options...
JoseR Posted May 4, 2016 Share Posted May 4, 2016 Yes !!! It works! I'm going to see how it affects to the store. Thanks! thats more than nothing! Link to comment Share on other sites More sharing options...
RamboRich Posted May 4, 2016 Share Posted May 4, 2016 The only thing I can think of is that it doesn't show if you have '0' as your products available, if you have that set to 'no'. I don't use stock management (it is set to no) so i'm thinking that has something to do with it. After looking around at products and my store, it doesn't seem to have any bad effects. I'm just happy we found a solution to this, even though it was sort of by mistake. Cheers! Link to comment Share on other sites More sharing options...
GuusMichielsen Posted May 4, 2016 Share Posted May 4, 2016 I'm glad to read the problem is solved!Good luck with your shops! Link to comment Share on other sites More sharing options...
JoseR Posted May 5, 2016 Share Posted May 5, 2016 I'm sorry to tell you bad news, the problem continue! again don't show the colors: https://productoselgallo.com/85-hebillas-pulseracalzadobolso Clearly the problem is related to the cache If I clear the caché, again show the colors... but with the time it didn't again. Link to comment Share on other sites More sharing options...
RamboRich Posted May 5, 2016 Share Posted May 5, 2016 Could it be the cache settings in the back office? In back office, in the menu under 'Advanced Parameters' -> 'Performance' what are your specific settings? Link to comment Share on other sites More sharing options...
JoseR Posted May 5, 2016 Share Posted May 5, 2016 (edited) Ups, I have all in Spanish, so it's very difficult to me translate all just you have it. I send you an image and may be the position of the options can help... Thanks!! PD. Yoy don't have this problem, only me? Jose. Edited May 5, 2016 by JoseR (see edit history) Link to comment Share on other sites More sharing options...
CrossY Posted May 12, 2016 Share Posted May 12, 2016 9 months in and this bug is still not fixed? Okay.. Either way, the solution of FrontController.php does seem to work (for now). Thanks for that. Link to comment Share on other sites More sharing options...
Advocatus Posted May 16, 2016 Share Posted May 16, 2016 (edited) I seem to be having the same problem with some colours not appearing on the category page. The colour will appear on the individual product page. The original code posted GuusMichielsen on March 10th before the fix is applied looks like this: foreach ($products as &$product) { if (!$this->isCached(PS_THEME_DIR.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))){ $products_need_cache[] = (int)$product['id_product']; }}} If I look at my code in the FrontController.php it appears like this: foreach ($products as &$product)if (!$this->isCached(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product'])))$products_need_cache[] = (int)$product['id_product']; unset($product);$colors = false;if (count($products_need_cache))$colors = Product::getAttributesColorList($products_need_cache);I have added couple of extra lines from my FrontController.php to give you an idea what my code looks like. Comparing both codes by code is slightly different. Can someone please tell me how to apply this fix to my code? Your help woud be much appreciated. Edited May 17, 2016 by Advocatus (see edit history) Link to comment Share on other sites More sharing options...
GuusMichielsen Posted May 17, 2016 Share Posted May 17, 2016 (edited) I seem to be having the same problem with some colours not appearing on the category page. The colour will appear on the individual product page. If I look at my code in the FrontController.php it appears like this: foreach ($products as &$product) if (!$this->isCached(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) $products_need_cache[] = (int)$product['id_product']; In essence this is actually the same as the code I posted, only your version has no {}-brackets for opening and closing the if-statement. You'll have to apply the fix as follows: // if (!$this->isCached(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) $products_need_cache[] = (int)$product['id_product']; Add the two frontslashes (//) in front of the if-statement. Hope this helps. Edited May 17, 2016 by GuusMichielsen (see edit history) Link to comment Share on other sites More sharing options...
Neil Trinh Posted May 27, 2016 Share Posted May 27, 2016 Maybe it is to late for Tamara, but for people who end up here in the future: The hotfix Step by Step: - open the FrontController.php in a text-editor (this file is located at .../classes/controller) - find following code: foreach ($products as &$product) { if (!$this->isCached(PS_THEME_DIR.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; } } } - comment out the if-clause (add two slashes // in front of the 'if' and in front of the } that closes the if-clause) foreach ($products as &$product) { // if (!$this->isCached(PS_THEME_DIR.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; } // } } - upload the FrontController.php - clear cache I had the same issue and I think this fixed it indeed. I guess I'll know in a few hours. Thank you! It worked. Link to comment Share on other sites More sharing options...
Studium Posted April 29, 2017 Share Posted April 29, 2017 (edited) It does not work for me. Prestashop version 1.6.1.12I try this in additional to previous insruction:FrontController.php, 1642 line: foreach ($products as &$product) { //as if (!$this->isCached(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $products_need_cache[] = (int)$product['id_product']; // } } and //Tools::enableCache(); //Tools::restoreCacheSettings(); But is not worked((Prefences->Product -> Display unavailable product attributes on the product page = Yes in my settings. Does anyone else have any ideas?Thanks. Edited April 29, 2017 by Studium (see edit history) Link to comment Share on other sites More sharing options...
sosepi Posted June 7, 2017 Share Posted June 7, 2017 Hi guys, the problem in my case was the field "meta title" in the color combination form, you cant use spaces or special characters. Once I change that it fix the issue. Link to comment Share on other sites More sharing options...
[email protected] Posted November 29, 2017 Share Posted November 29, 2017 Had the same issue, using Prestashop 1.6.1.17, hotfix posted by GuusMichielsen helped. Link to comment Share on other sites More sharing options...
Casper_O Posted March 19, 2018 Share Posted March 19, 2018 I found an other solution in my search. It has been running now over the weekend without giving any issues with colors on the category or manufacturer list. Before we we applied the override it would not show after 1-2 hours with smarty cache active. https://gist.github.com/Casper-O/e7e46f3b708aa03faa2c57fa429f357a 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now