• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NP
#1 Posted : Tuesday, April 18, 2017 9:40:13 AM(UTC)
NP

Rank: Member

Joined: 2/10/2017(UTC)
Posts: 62
India
Location: Nashik, Maharashtra

Thanks: 6 times
Hello,

Is there any way to filter product based on multiple property values ?

Suppose I want to search all products that are red, black and green.
Aaron
#2 Posted : Wednesday, April 19, 2017 11:02:27 AM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,381
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
You can use Type Properties to store the data. Then you could use the Catalog.Product.FindByCriteria function (which takes a ProductSearchCriteria object). Under the hood this calls the bvc_Product_ByCriteria_s stored procedure. Here's a bit of sample code to point you in the right direction:

Code:
Dim criteria As New Catalog.ProductSearchCriteria()
criteria.CustomProperties.Add(New Catalog.ProductSearchCustomPropertyValue("BVIN_OF_TYPE_PROPERTY1", "VALUE_OR_VALUE_BVIN"))
criteria.CustomProperties.Add(New Catalog.ProductSearchCustomPropertyValue("BVIN_OF_TYPE_PROPERTY2", "VALUE_OR_VALUE_BVIN"))

Dim result As Collection(Of Catalog.Product) = Catalog.Product.FindByCriteria(criteria)


Note that for Multiple Choice properties you need to use the bvin for the value of the property but for all other properties you use the actual text value.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
 1 user thanked Aaron for this useful post.
NP
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012