You are here:  » Filtering Different Sizes per Product


Filtering Different Sizes per Product

Submitted by erv on Tue, 2013-03-05 12:28 in

Hello,

I'm trying to figure out how to work with products that are available in multiple sizes efficiently.

E.g. a Product feed for clothing contains a field "available Sizes: 38,42,47"

Its simple to import the data into a custom field, but how can i filter based on size efficiently, or how can i create a select field that shows all the sizes for the current search results, to enable further filtering - without expensive requests that search the whole database each time.

I'm sure this has come up before but i cant find a solution.

Submitted by support on Tue, 2013-03-05 14:00

Hi,

A number of users have had similar requirements - as you said adding "size" as a custom field is straight forward, but what can then be done is the filter can be created with options being the set of unique options having exploded each field value by comma; and then when applying the filter ($priceWhere in search.php) for that particular filter a LIKE rather than EQUALS clause can be used.

If you'd like to give this method a go, first add "size" as a custom field to your site; and then email me your search.php and html/searchresults.php and I'll add a size filter using the method described above for you. Don't worry if you haven't already implemented sidebar filters I'll merge that code for you at the same time...

Cheers,
David.
--
PriceTapestry.com