I am working for a client that uses a tag for the different manufacturers of their products. Each product will only have one manufacturer tag. On their collections page, they have a sidebar that shows all the Manufacturer names with a {{ tag | link_to_add_tag: tag }} URL. Now the problem is when users are selecting more than one manufacturer tag, it will return no results since its searching for products that have both manufacturer tags.So, what we need is either:

A) A way to filter the products with tags using OR logic rather than AND. So a user can select multiple manufacturer tags and have it still show results of products that have any of the tags passed.

B) I found some documentation on the 'current_tags' object. What I would want to do is:

User clicks a manufacturer tag

Check if any manufacturer tag is in current_tags

If any manufacturer tag is, remove it

Add the manufacturer tag that user clicked in Step 1

This would mean users would have their first manufacturer tag forcibly removed, thus not allowing them to stack the tags.

Does any of this make sense?
Is there an easier way to do this?

No code so this is a Design discussion. It's yours to make or the client's choice what the result should be but I can see how a SQL statement might be "ACME" and "APOGEE" which our Wile E Coyote may want to get both products as his experience has been awful with ACME.
So my thought is that the search would be for the rocket skates would be what both companies offer rather than a result of none.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.