Jump to content

Product color picker does not show at category list


Recommended Posts

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!

Share this post


Link to post
Share on other sites

  • 4 months later...

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 by bcarron (see edit history)

Share this post


Link to post
Share on other sites

  • 3 weeks later...

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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

 

 

 

Share this post


Link to post
Share on other sites

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.

 

product-colors.jpg

 

 

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 by dany2234 (see edit history)

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

  • 3 weeks later...

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.

Share this post


Link to post
Share on other sites

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 by Tamara F (see edit history)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

  • 1 month later...

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.

  • Like 2

Share this post


Link to post
Share on other sites

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

}

Share this post


Link to post
Share on other sites

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 by RamboRich (see edit history)

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

 

Share this post


Link to post
Share on other sites

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 by RamboRich (see edit history)

Share this post


Link to post
Share on other sites

 

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é

Share this post


Link to post
Share on other sites

  • 1 month later...

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 by GuusMichielsen (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 by RamboRich (see edit history)

Share this post


Link to post
Share on other sites

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 by GuusMichielsen (see edit history)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 by RamboRich (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 by GuusMichielsen (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

I tried too and nothing! :wacko:

 

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 by JoseR (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

post-219986-0-97038600-1462461671_thumb.png

Edited by JoseR (see edit history)

Share this post


Link to post
Share on other sites

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 by Advocatus (see edit history)

Share this post


Link to post
Share on other sites

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 by GuusMichielsen (see edit history)

Share this post


Link to post
Share on other sites

  • 2 weeks later...

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.

Share this post


Link to post
Share on other sites

  • 11 months later...
It does not work for me.
Prestashop version 1.6.1.12
I 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 by Studium (see edit history)

Share this post


Link to post
Share on other sites

  • 1 month later...
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.

Share this post


Link to post
Share on other sites

  • 5 months later...
  • 3 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More