All things Shopify and commerce
As the title says how can I add related items to cart drawer? I am using spotlight theme
Hi,
Identify cart drawer section (something like cart-drawer.liquid or cart.liquid. ) and insert related products logic
Code example
{% for product in cart.items %}
{% assign recommendations = product.recommendations %}
{% if recommendations.size > 0 %}
<div class="related-products">
<h3>Related Products</h3>
<ul>
{% for recommendation in recommendations %}
<li>
<a href="{{ recommendation.url }}">
<img src="{{ recommendation.featured_image.src }}" alt="{{ recommendation.title }}">
<p>{{ recommendation.title }}</p>
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endfor %}
Use CSS for customization and enable product recommendations feature
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024