Hi!
I am trying to figure out how filtering products in Quicksilver works.
I have added a property to a variant:
[CatalogContentType (
GUID = "D9181050-28AE-4B31-8498-B5D831F13610",
MetaClassName = "TestVariant",
DisplayName = "Test Variant",
Description = "Display Test variant" )]
public class TestVariant : FashionVariant
{
[Ignore]
[ScaffoldColumn ( false )]
public override string Size { get; set; }
[Searchable]
[CultureSpecific]
[Tokenize]
[IncludeInDefaultSearch]
[BackingType(typeof(PropertyBoolean))]
[Display(Name = "Prop1-test", Order = 10)]
public virtual bool Prop1 { get; set; }
}
And this property is visible in the variant edit page. But how can I add this to the filters on the catalog page (like Color, Size on existing fashion variants )?
I have added filter to the config file:
<filter field="Prop1"><Descriptions defaultLocale="en"><Description locale="en">Prop1</Description><Description locale="sv">Prop1</Description><Values><SimpleValue key="true" value="true"><Descriptions defaultLocale="en"><Description locale="en">true</Description><Description locale="sv">true</Description></Descriptions></SimpleValue><SimpleValue key="false" value="false"><Descriptions defaultLocale="en"><Description locale="en">false</Description><Description locale="sv">false</Description></Descriptions></SimpleValue></Values></Descriptions></filter>
I am also adding them to document fields in the SearchDocumentController:
private void AddTestProperties1(RestSearchDocument document, IEnumerable<TestVariant> variants)
{
var props = new List<bool>();
foreach (var testVariant in variants)
{
if (!props.Contains(testVariant.Prop1))
{
props.Add(testVariant.Prop1);
document.Fields.Add(new RestSearchField("Prop1", testVariant.Prop1.ToString().ToLower()));
}
}
}
Even after indexing the search index (in commerce and in admin) nothing happens.
And why does the filter option for sizes dissapear when I select shoes?