We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

cross-selling products

cross-selling products

anomyous
Shopify Partner
4 0 2

rutuuu_0-1722584982160.png


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?

Replies 2 (2)

Small_Task_Help
Shopify Partner
1144 55 112

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 %}

 

To Get Shopify Experts Help, Click Here or E-mail - hi@ecommercesmalltask.com
About Us - We are Shopify Developers India
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad
anomyous
Shopify Partner
4 0 2

anomyous_0-1722599341975.png

by trying above code 
still not getting displayed 

anomyous_1-1722599472243.png