Hello,
I’ve search for a cleaner way to do something “easy”, but haven’t found it yet.
Explanation :
I have a page with thousands of furnitures shown in a repeater. There are different types of furnitures like tables, chairs, etc… and users have a filter on top where they can decide to show only chairs for example.
In my menu, a “catalog” menu item is linking to this catalog page. But I also have sub-menu items like “chairs”, “tables”, etc…
What I’m trying to do is when a visitor click on a sub-menu item (“chair” for example) he’s redirected to the main catalog page with a filter of “chair” applied.
So I would like to be able to store the word “chair” when clicked on the item menu, go to the catalog page and filter based on the “chair” word stored in the session.
Now I do it by going to an “intermediate” “chair” page, where I can execute my code (store “chair” in session) and be redirected to the catalog page. It’s a dirty way…
Code on the “empty chair page” just to store a word in session and go to the main catalog page
$w.onReady(function () {
session.removeItem("searchWord");
session.removeItem("typeFilter");
session.setItem("typeFilter", "chair");
wixLocation.to("/catalog");
});
Is there a way to do it with hooks or apply code on specific menu items when clicked ?
Many thanks for your idea