Display all of my products' data from one of their custom metafields on one page?

I have a custom metafield setup for each of my products for a link to a PDF. Is there a way to pull each of these products’ PDF links from that metafield to all be listed on the same page?

Yes. You call them by using the collection to make it easy. You can use the code as reference below.

  1. Call the collection handle, eg. “product-pdfs”

  2. Then place the metafield you use for the product

{% for product in collections['product-pdfs'].products %}
{{ product.metafields.custom.product-pdf }}
{% endfor %}

This is perfect! Thank you! Do you know if there’s a way to order the output in any way? Preferably A-Z by product SKU but I’m not sure if that’s possible.

1 Like

Hi @brendaanne3 ,

Liquid does not have SKU sorting unfortunately. This would require custom javascript code

Got it. Would you be able to point me in the right direction for setting that up? If not, no worries. I appreciate all of your help.