Jump to content

Missing color samples in product overview


Recommended Posts

Hi,

as you can see after upgrading to PS 1.6 my product overview doesn't show color samples atribute correctly. There are just empty boxes, that represent color, but color samples are missing. 

 

Any ideas or similar issue?

 

Thanks, for any advices.

 

www.maclife.sk

 

3ZJbGEt.png

post-640700-0-60450500-1399220308_thumb.png

Edited by Rudolfo78 (see edit history)
Link to comment
Share on other sites

:(

 

can you also check product.tpl file, you've got there code like:

<ul id="color_to_pick_list" class="clearfix">
														{assign var="default_colorpicker" value=""}
														{foreach from=$group.attributes key=id_attribute item=group_attribute}
															<li{if $group.default == $id_attribute} class="selected"{/if}>
																<a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" style="background: {$colors.$id_attribute.value|escape:'html':'UTF-8'};" title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}">
																	{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
																		<img src="{$img_col_dir}{$id_attribute|intval}.jpg" alt="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" width="20" height="20" />
																	{/if}
																</a>
															</li>
															{if ($group.default == $id_attribute)}
																{$default_colorpicker = $id_attribute}
															{/if}
														{/foreach}
													</ul>

?

Link to comment
Share on other sites

Exactly same code in my product.tpl file:

 



<ul id="color_to_pick_list" class="clearfix">
{assign var="default_colorpicker" value=""}
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li{if $group.default == $id_attribute} class="selected"{/if}>
<a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" style="background: {$colors.$id_attribute.value|escape:'html':'UTF-8'};" title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}">
{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
<img src="{$img_col_dir}{$id_attribute|intval}.jpg" alt="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" width="20" height="20" />
{/if}
</a>
</li>
{if ($group.default == $id_attribute)}
{$default_colorpicker = $id_attribute}
{/if}
{/foreach}
</ul>

Edited by Rudolfo78 (see edit history)
Link to comment
Share on other sites

Hello,

 

I have maybe a bit different problem but the last picture of Rudolfo78 doesn´t show the product price. And that´s my problem. I´ve set the price and I see it in the all products overview but not when I click at the product :/

 

Could you help me with this please?

 

 

Link to comment
Share on other sites

Please explain, what do you mean by "overrides of prestashop core"?

 

I didn't change anything except for some design of default theme in previous version (1.5), but color samples and everything else worked correctly there... :/

Link to comment
Share on other sites

 

 

Overriding PrestaShop's classes and controllers

Overriding is a way to "override" class files and controller files. PrestaShop's ingenious class auto-loading function makes the "switch" to other files fairly simple. Thanks to PrestaShop's fully object-oriented code, you can rely on object inheritance to modify and add new behaviors, using the properties and methods of the various existing classes.

Classes and controllers are usually built following a certain norm. Here is the Product class and controller:

  • /classes/Product.php

    This class would be called ProductCore.

  • /controllers/front/ProductController.php

    This controller would be called ProductControllerCore.

You will need to create a PHP file and place it either of the override folders, depending on whether this file is part of a module, or distributed as-is. Indeed, since PrestaShop 1.5, there are two locations where you can place your overriding files: either at the root of the PrestaShop install, or within a module.

Overriding a class

In order to override the Product class, your file needs to be called Product.php and must feature a Product class that then extends ProductCore class.

The file can be placed in either of these locations:

  • /override/classes/Product.php
  • /modules/my_module/override/classes/Product.php
Overriding a controller

In order to override the ProductController class, your file needs to be called ProductController.php and must feature a ProductController class that then extends ProductControllerCore class.

The file can be placed in either of these locations:

  • /override/controllers/front/ProductController.php
  • /modules/my_module/override/controllers/front/ProductController.php
Link to comment
Share on other sites

Rudolfo,

Just to see if the conversion is the problem:

 

Can you try to make a new Attribute: Color_new and save.

select the Color_new attribute in the attribute list

and add a few new attribute values: new_grey, new_blue, etc.

 

then add a new product and use these attributes to make some new combinations.

 

If you then select this product, do the colours show?

 

pascal

Link to comment
Share on other sites

  • 2 weeks later...

For everyone who got the same problem I found a really fast solution.

In my case my attribute Color has id_attribute_group 3.

In my database, in the table ps_attribute_group, for some reason after the upgrade to 1.6.0.6 version of prestashop I had this line. (look at the attached image)

 

Basically, is_color_group should be set to 1. You can do it manually in the database or, I think, you can edit your attribute in backoffice and set again:

attribute type: color or texture.

 

Hope this can help someone! :)

 

 

post-665938-0-50705400-1400587453_thumb.jpg

Edited by andrea22k (see edit history)
  • Like 4
Link to comment
Share on other sites

  • 3 months later...
×
×
  • Create New...