Attaching an anchor to liquid variables (f.e. product.url)

Solved
LexMeo
Tourist
6 1 0

Dear community,

I replaced the "add to cart" button with a simple product.url redirection, so the button actually leads to the product page first.
But is it possible to attach an anchor link (#anchorname) from the product pages to this dynamic url, so it leads to the (/product-link#anchorname) ?

 

Thanks in advance!

0 Likes
LexMeo
Tourist
6 1 0

This is an accepted solution.

Found out by myself. For those who might face the same problem:

      <a href="{{ product.url | within: collection }}/#anchorname"

 

Thanks anyway

0 Likes