Jump to content

Product Attribute Colours Sometimes Missing on Product List Page


Recommended Posts

I have a problem with this page:
http://cycloc.com/ps/10-designer-cycle-storage-units?id_category=10&n=14

If you scroll down the product list page showing all items, you'll see that the colour option indicator is missing from some products. All products should have a similar display of colour options. If you click through to each product's individual page, you'll see that it displays ok in the right-hand panel above the "Add to cart" button.

I haven't yet figured-out why in the product listing page it appears on some products and not others. It's seemingly random, but I'm sure there must be some common factor that's eluded me so far.

In the underlying HTML code, the appropriate <div class="color-list-container"> is present for all products:

.....

For the ones that work, the div appears like this:

<div class="color-list-container">
<ul class="color_to_pick_list clearfix">
<li><a href="http://cycloc.com/ps/bike-storage-systems/1-cycloc-solo.html#/colour-black" id="color_4" class="color_pick" style="background:#231E21;"></a></li>
<li><a href="http://cycloc.com/ps/bike-storage-systems/1-cycloc-solo.html#/colour-blue" id="color_7" class="color_pick" style="background:#2976BA;"></a></li>
<li><a href="http://cycloc.com/ps/bike-storage-systems/1-cycloc-solo.html#/colour-green" id="color_1" class="color_pick" style="background:#149247;"></a></li>
<li><a href="http://cycloc.com/ps/bike-storage-systems/1-cycloc-solo.html#/colour-red_orange" id="color_3" class="color_pick" style="background:#EB3F3B;"></a></li>
<li><a href="http://cycloc.com/ps/bike-storage-systems/1-cycloc-solo.html#/colour-pink" id="color_6" class="color_pick" style="background:#ea66B1;"></a></li>
<li><a href="http://cycloc.com/ps/bike-storage-systems/1-cycloc-solo.html#/colour-yellow" id="color_5" class="color_pick" style="background:#FDF132;"></a></li>
<li><a href="http://cycloc.com/ps/bike-storage-systems/1-cycloc-solo.html#/colour-white" id="color_2" class="color_pick" style="background:#FFFFFF;"></a></li>
</ul>
</div>

.....

For the ones that don't work, the div appears like this:

<div class="color-list-container">
<ul class="color_to_pick_list clearfix"></ul>
</div>

(All the <li> content is missing.)

.....

I'm using PrestaShop v1.6.1.0

I'd welcome any suggestions or solutions.

Thanks for any help.

Link to comment
Share on other sites

  • 7 months later...

Hi Mias-Accessories

 

I did eventually find a solution based on a couple of posts elsewhere:

https://www.prestashop.com/forums/topic/458999-product-color-picker-does-not-show-at-category-list/page-3

and

http://forge.prestashop.com/browse/PSCSX-6778

 

The problem appears to be related to the file: FrontController.php

which can be found here by FTP:

classes/controller/FrontController.php

 

From memory and my notes...

 

The fix didn't seem to work the first time I tried it (but I hadn't cleared the cache). So at that point I just reinstated the original file. However, the following day the colour options appeared to be working properly again, and being happy with that I took no further action.

 

A few months later, the problem came to my attention again, so I investigated further. 

This time, after updating the file I did clear the cache - and that seemed to work.

 

Hopefully, this will work for you too.

 

Note, you may need to adapt the instructions if the code in your FrontController.php is for a different PrestaShop version.

 

Good luck!

 

GordonL

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hi Casper_O, the GuusMichielsen post is the second reply on Page 2. Here's the direct link to that page:
https://www.prestashop.com/forums/topic/458999-product-color-picker-does-not-show-at-category-list/?page=2

Note the correct spelling of the poster's name is: GuusMichielsen
Perhaps, if you were searching for "Guss…" that may be why you couldn't find it.

Hope you're successful!
 

Link to comment
Share on other sites

Thanks GordonL

I went with an other solution worte as a comment to this PR on github, it has been running over the weekend and colors are still visible on all product-list

https://github.com/PrestaShop/PrestaShop/pull/7876

Made a gist for the override in case some other needs to solve it until hopefully it is accepted as a fix on the official github

https://gist.github.com/Casper-O/e7e46f3b708aa03faa2c57fa429f357a

  • Like 1
Link to comment
Share on other sites

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
×
×
  • Create New...