I’m trying to display a custom metafield in the card display of products. The theme is using javascript to render the cards. I have used the following code to attempt to call this metafield using all_products:
{% endraw %}{% assign test = 'products.product.product_handle' | t %} {{all_products[test].title}} | testing{% raw %}
The en.default.json file defines the product_handle key as:
"product_handle": "{{ handle }}"
I used the .title just to see if I am getting any object and I am not. When I call {{‘products.product.product_handle’ | t }} I get the proper handle but for some reason I’m unable to use that handle within the all_products function.
Is there another way to accomplish my goal or is there a simple fix to my current code that I’m missing?