How to add product url for product reference metafields

I want to develop other product recommendation areas in product page with Shopify native metafields. With below code, it displays each product image but when I click the image, it doesn’t lead to each product page url and stays with same product url.

Could you advise me how I can add product reference url to metafields? Thank you.

Other product recommendations

What is the value set for product.metafields.custom.other-product1.mylinks.url? It should be straight-forward in checking that the value is what you want the link to be.

Thank you very much, Josh! I revised the code on below and the issue is solved :slightly_smiling_face:

<div class="product-other-reco__inner">

{% assign product_rec_1 = all_products[product.metafields.custom.other-product1] %}

{% assign product_rec_1_url = product_rec_1.url %}

{% assign product_rec_1_image = product_rec_1.featured_image %}

{% assign product_rec_2 = all_products[product.metafields.custom.other-product2] %}

{% assign product_rec_2_url = product_rec_2.url %}

{% assign product_rec_2_image = product_rec_2.featured_image %}

<a href="{{ product_rec_1_url }}">

<img class="product-other-reco__image" src="{{ product_rec_1_image | img_url:"original"}}" alt="">

</a>

<a href="{{ product_rec_2_url }}">

<img class="product-other-reco__image" src="{{ product_rec_2_image | img_url:"original"}}" alt="">

</a>

</div>