Hello everyone
I have a mega-menu on this website , which contains the store pages and sub-pages, what I want to achieve is setting the product gallery collection with the location.query, for example:
let query = wixLocation.queryParams;
if (button.prefix === wixLocation.prefix) {
if (typeof query === 'object') {
wixLocation.queryParams.remove([collection]);
wixLocation.queryParams.add({collection: buttonTitle});
} else {
wixLocation.queryParams.add({collection: buttonTitle});
}
} else {
wixLocation.to(button.prefix);
wixLocation.queryParams.add({collection: buttonTitle});
}
I had issues where the ‘collection’ word is different for each language as well as the query itself, notice these two URLs for the same page, but with different words.
www.domain.com/clothes?lang=he&אוסף=בגד ים
One solution I came out with, is getting the “collection” word already translated, and use it as it is when adding or removing parameters, but the value remains, how can I get the same collection name (translated)? I did think of creating a separate database that holds the button’s IDs, and the query title for each language and get it when clicking on the button, but I want to know if there are any easier or simpler ways before start building this feature.
Thanks in advance.
Ahmad