Personalized checkout and custom promotions with Shopify Scripts
We've created a custom product page, similar to the default, but we've added several custom product metafield definitions assigned to a specific category. The purpose of this collection is an online gallery that is up for a short time. We have some works of art from multiple artists, and we'd like to show users other works from the same artist on the product (very specific product recommendation).
Visual Reference: https://shop.visitcherokeenation.com/products/bejeweled
Near the bottom of the product page, we have an info section with tabs containing details about the product as well as a tab specifically showing other works that the particular product artist has in the show. For example:
Product Page – Art Show 2025, Artwork 1, John Doe
Product page contents
More from the Artist (Product Recommendation Module)
Art Show 2025, Artwork 2, John Doe
Art Show 2025, Artwork 3, John Doe
Conditionally, if an artist has more than one piece, we've assigned a specific tag which call up the 'Other Works' tab if it's been assigned (working great). The artist's name is a product metafield definition assigned to the correct category. For the recommended product section, below is the code I'm using to try and call only other products with the same metafield definition as the current selected product:
{%- unless template == 'index' or template == 'cart' or template == 'list-collections' or template == '404' -%}
{%- assign t = template | split: '.' | first -%}
{% assign related_products = product.metafields.custom.gallery_002_artist_name.value %}
{% assign limit = 3 %}
{% if product.vendor == product.vendor %}
{% if product.tags contains 'Multiple Entries' %}
<div id="More" class="tabcontent">
<div class="tab-content-section">
<div class="product-recommendations">
<div class="page-width" data-limit="{{ limit }}">
<div class="section-block">
<div class="grid grid--no-gutters grid--uniform">
<div class="grid__item small--one-half medium-up--one-third">
{%- include 'gallery-product-card', product: product, collection: collection -%}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{%- endif -%}
{%- endif -%}
{%- endunless -%}
Additional Info that may help:
Product Name: product.name
Product Vendor: product.vendor
Artist Name: product.metafields.custom.gallery_002_artist_name.value
I've attempted to copy and paste directly from product-recommendations.liquid to start the setup but event the results aren't populating.
Any help is appreciated!
Hey @KaitlynAbbott will definitely recommend you to watch this tutorial on metaobjects. The guy uses kind of the same example here to explain this as your requirement is.
There are definitely other alternatives but this is more a manual setups where you might probably not need code.
Hope this helps. In case you need help anyways, please reach out via personal links below for a convenient conversation and collaboration.
Best
Shadab
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025