All things Shopify and commerce
i have created metafield for cross-selling product in my admin
i want to display cross-selling product in my product page below.
product id is perfectly getting displayed but not he product image. Not getting what exactly is the issue with these
can anyone help?
Hi,
Verify Metafield Setup
At Product Template - insert code to display cross-sell product
Code example
{% assign cross_sell_product_id = product.metafields.namespace.key %}
{% if cross_sell_product_id %}
{% assign cross_sell_product = all_products[cross_sell_product_id] %}
{% if cross_sell_product %}
<div class="cross-sell">
<h3>Recommended for you</h3>
<a href="{{ cross_sell_product.url }}">
<img src="{{ cross_sell_product.featured_image | img_url: 'medium' }}" alt="{{ cross_sell_product.title }}">
<p>{{ cross_sell_product.title }}</p>
</a>
</div>
{% endif %}
{% endif %}
by trying above code
still not getting displayed
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024