I would like to use the Search Widget to search Product/Variants for Attributes. Is there a way to add fields which can then be searched?
This is in version 5.0.4 (Debian 10.3)
I would like to use the Search Widget to search Product/Variants for Attributes. Is there a way to add fields which can then be searched?
This is in version 5.0.4 (Debian 10.3)
Hi,
Search widged shows all the fields that are included on the treeview. So in order to add your field to the search view you should extend the product variants tree view to include the attributes field.
If you do not want to show the field no the tree view but only include it on the search, you can make it invisible by setting the tree_invisible="1"
attribute on your field definition.
Is this to be done in Administration/User Interface/Views ?
I did not see any existing entries there like product.variants
Yes but I realized that the field is included by default on newer versions and probably it wonât be shown correctly on 5.0 series the widget for searching on Dict fields was added on 5.2 series.
So probably the best option is to upgrade your server to latest available series (5.4)
Note that 5.2 is also a valid option, but as itâs support will end the next month I will not recommend using it for now.
Ok, I will look into updating to 5.4
Thank you for your help.
I have updated to version 5.4 but I do not see any entries in Administration/User Interface/Views like product.variants.
Should I create this entry?
Could you provide a simple example of what the information might look like?
You should search product.product instead product.variants
Thanks for that information but unfortunately, that is not enough for me to move forward. Examining the various other views does not give me any clear understanding of how they work or the naming conventions used.
I have been unable to find other documentation as to how the views work.
If you updated to the 5.4 version you should be able to see the Attributes filter on the Product - > Products â Variants menu
Here is the documentation about views and here the documentation on how to extend a view.
Yes, I see âAttribute Setâ and âAttributesâ in the Search. I can get âAttribute Setâ to work but not Attributes.
I will examine the documentation.
Thank you.
Could you explaing what is not working on the Attributes?
Maybe there is some bug that needs to be reported and then fixed.
Could you explaing what is not working on the Attributes?
Maybe there is some bug that needs to be reported and then fixed.
For testing I
defined two âProduct/Attribute Sets/Attributesâ like
Name String Type
ohm ohm Numeric
footprint footprint Char
defined one âProduct/Attribute Setsâ named âresistorâ and added the two attributes above to it.
defined one product in âProduct/Productsâ named âPRODUCT_resistorâ and
added âresistorâ to the âAttribute Setâ
added one âProduct/Variantsâ using âPRODUCT_resistorâ and set the Attributes on footprint to 0603
Using the Search, if I enter âresistorâ in the âAttribute Setâ it lists the the variant
if I enter âfootprintâ or â0603â in âAttributesâ it returns nothing.
Maybe that is not the correct format.
Could someone please say if my search criteria is correct or not?
if I enter âfootprintâ or â0603â in âAttributesâ it returns nothing.
It should match for the attribute value.
Are you using postgresql or sqlite?
It should match for the attribute value.
Are you using postgresql or sqlite?
I am using postgresql.
â0603â is a value set on âfootprintâ.
I suppose this type of search works for others so I must have made a mistake somewhere.
I suppose this type of search works for others so I must have made a mistake somewhere.
Or maybe there is a bug that we should fix it.
â0603â is a value set on âfootprintâ.
For me it should match the footpring value, so there is something wrong.
For me it should match the footpring value, so there is something wrong.
Thank you for checking.
I will wait for Development to have a closer look.
For me it should match the footpring value, so there is something wrong.
I think that it is trying to do a comparison between the contents of the attributes column and the value â0603â, and so isnât finding it, e.g.:
â{âfootprintâ:â0603â}â == â0603â
Perhaps the Dict field needs to be added to the list of fields that use the like
operator by default?
Could someone please say if my search criteria is correct or not?
I think if you type âAttributes.footprint: 0603â in the product variants search bar it should find the product.
I think if you type âAttributes.footprint: 0603â in the product variants search bar it should find the product.
Yes, âAttributes.footprint: 0603â works.
Maybe worth noting, I also made a entry for ohm (numeric, 2 places). When I made the entry, it showed as 20.00 (as expected)
But, when I tried searching for it with âAttributes.ohm:20â it did not find it. If I entered as âAttributes.ohm:20.00â it found it. Curiously it also changed the search entry back to âAttributes.ohm:20â
Could I expect this will be addressed in a future version or do I need to open a bug report somewhere?