Jump to content
  • 0

[Developer Question] Is it possible to adjust the 'current_tags' object using javascript?


Question

Posted

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:

  1. User clicks a manufacturer tag

  2. Check if any manufacturer tag is in current_tags

  3. If any manufacturer tag is, remove it

  4. 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?

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...