Jump to content

Custom Feature Values Not Showing


prestatent

Recommended Posts

Prestashop 1.5.4.1

 

Hi

 

My import file has various Features loaded in. For instance, I have various products with the same categories, all with different weights. I have the Feature setup within BO, but have not added any values.

 

When I import them into Prestashop, they import ok, and when viewed in BO appear in the "Custom" value field. However, when I try to setup a filter for this feature in layered navigation block, it does not appear in the list of avalable filters. What I have found is that to get this to work I have to have matching values for the Feature already added. This is not very logical as I could in theory have hundreds of different weights, and I don't want to have to add them all in manually before importing my products.

 

I've noticed that the Color attribute adds in values automatically if they don't exist.

 

Any help greatly appreciated.

Link to comment
Share on other sites

"The best place in the world to ask questions about PrestaShop and get advice from our passionate community!"

 

In my experience on this forum so far, I have asked lots of questions, but had very little help or advice. So very very disappointing as the product is good.

 

One last time:

 

Why do custom feature values not import into Prestashop, for example I have lots of temperature ratings for products and I don't want to input them all into a feature as values. Custom feature values should be able to be filtered but they are not. Major flaw as far as I can see.

 

Thanks.

Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...

update to my post above;

 

I got it fixed through database, this how i figured the whole thing works;

 

I needed to change some feature values in a catalogue of 2,000+ products with 90 standard features, it was not possible to setup as a CSV upload, hence I did the modification through back end by updating the features to correct values; in most of the cases the new correct value was something which has not been used for that feature, so I needed to enter it as a custom value.

 

After doing the update, I noticed that the layered navigation is not filtering / showing the updated features' values, then I learnt that Layered Navigation does not handle the custom values and it simply ignores them.

 

I did not want to override any codes of the website due to time limit and site being used we need a super quick fix, hence I decided to open the database tables and figure out what is happening there;

 

Once any values are being added as custom value, the table ps_feature_value will have the the column custom set to "1", and apparently layered navigation ignores these. So this value must be set to "0", but only going to the table and setting it to "0" will not fix the issue, because if you have a new value which is repeating same feature on several products those feature_value's will not be grouped, which means though features_values are identical the feature_value_id is not the same. Which means you will have duplicates in ps_feature_value_lang table.

 

To fix this for our case where we have limited updates, I worked on two tables; ps_feature_product, ps_feature_value_lang.

 

Do a vlookup in excel between both tables and bring feature_values next to their ID's this will make it human readable. 

Filter and only show the newly edited (problematic feature_values, these are the ones not showing in Layered NAvigation);

sort them by their LANG (value) then you will have all the duplicated grouped, 

run a macro or manually assign only one FEATURE_VALUE_ID to each group of duplicate feature_values

for example you might have a feature color, with value RED but ID for RED might be 3400, 3456, 3470, you can decide to assign only one of these ID's to RED and get rid of the other ID's.

 

after this you will have your new PS_product_feature table, I did a full import to DB, but you can only update the modifications and if you have been careful to remove all the duplicates, you should be all SET.

 

Last step is to modify the ps_feature_value table and set the custom column to "0" for affected features.

 

now refresh your website and Layered Navigation should do its job as expected.

 

There are places with PHP codes to do this procedure as a modification of the module itself, I decided not to touch the module because of the urgency of this case, and so I have not tested any of those CODES, but if you enjoy playing with DATABASE tables as I do, this should be a very simple fix, I did correct 4 features over 245 products with 17 new values in 7 - 8 minutes.

 

Hope it works out for you too.

Link to comment
Share on other sites

  • 11 months later...

I'm working on adding features right now and the way I take it is as follows:

 

The predefined value is listed and categorized in the layered navigation without any issues, just like everyone expects it would be. If you're importing a CSV excel file, you need to set the field as 0 in order to get the feature to be included in the navigation.

 

The customized value (set equal to 1 if you're uploading a csv file) is used to add the information to the product page (i.e. when a customer clicks on a product from your listing of products and visits the dedicated page for that product) there is a field called "DATA SHEET" above the long description that lists out all the features (example: battery type: AAA battery, material: plastic, etc.) 

 

From my testing, the customized value will show on the product page but will not be categorized into the layered navigation module.  So lets say you just wanted to add a customized unique feature, for example like a UPC bar code of 12345678 (where this feature is typically always unique for each product and will never be repeated on a different product, or repeated very rarely).  You wouldn't want the user to have the option to filter by UPC code and see every single UPC code of every product you have in the layered navigation, it would be too much.  

 

In summary, the customized field allows a unique or rarely used entry to be attached to a product page to give the visitor more info about the product without being indexed.  My guess is that it was purposefully coded this way for this particular scenario.   

 

Hopefully this helps someone else as it took me a few hours to figure all this out.

Link to comment
Share on other sites

  • 3 months later...

Any solution for this? Customized feature values do not show in product page filter!!

 

How can we fix this?

If you are familiar with DB and SQL it is a very simple fix, refer to my post from August 2015 above, and that will work.

 

I do not recommend messing with the import CSV of the BO, instead after your import examine the relevant tables, listed in my previous post, and fix the issues to your liking. Anything marked as CUSTOM = 0; will show on the left column in BO and will be part of the filter.

 

Since these all somehow affect the search, I would recommend recreating your index from BO after you are done with all the changes above.

 

Good Luck, and post here if that solution works for you as well so others will know and utilize it.

Link to comment
Share on other sites

I removed  "AND (fv.custom IS NULL OR fv.custom = 0)" from blocklayered.php which is located in ROOT\modules\blocklayered and now it shows the custom values but if two products have the same feature value they don't sum up and they are showed as different features.

 

I need to find out how to merge the same feature values.

Link to comment
Share on other sites

If you are familiar with DB and SQL it is a very simple fix, refer to my post from August 2015 above, and that will work.

 

I do not recommend messing with the import CSV of the BO, instead after your import examine the relevant tables, listed in my previous post, and fix the issues to your liking. Anything marked as CUSTOM = 0; will show on the left column in BO and will be part of the filter.

 

Since these all somehow affect the search, I would recommend recreating your index from BO after you are done with all the changes above.

 

Good Luck, and post here if that solution works for you as well so others will know and utilize it.

 

Thanks for your help! The problem is that I have multiple csv updates and imports during the day so editing the data in the database is not the best solution.

If we could have an automated procedure of your solution it would be great.

 

Or a module that can compare the existing feature values and group or add the custom feature value.

 

Any one who can help or suggest something it will be really appreciated!

 

Thank you :)

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