Hello everyone!
Awesome community you guys have going on here!
I am hoping someone can help me with the following problem: I have inserted a “back to collection” button on my product page. This button basically checks the collection and the href sends the user back to that collection. However, if a product is accessed through the “product suggestions” at the bottom of the page, the button disappears. The collection also doesnt appear in the URL path (obviously).
My question is: is there some way for me to make sure the button always appears and sends the user back to the right collection? Perhaps I can define the destination of the button based on a product’s tags (I imagine they are stored in some array that is accessible)? Or perhaps even parse the name of the collection from the product name, by following the folling naming scheme. Product P in Collection C name = “C P”. If I could parse the first character, I would be able to return to that particular collection.
I might be overcomplicating this, but I am at a loss, and I am new to liquid!
Thank you!
Regards,
Jan