Shopify themes, liquid, logos, and UX
I created a metafield "related_blog_post" which contains URL of related blog post to that product, I want to show that on product page.
Either by block, button or text, through which we can jump to related blog post...
Hi @CrazyGen_IN
1、
2、
3、
<div style="text-transform: uppercase;">
{%- if product.metafields.custom.related_blog_post != blank -%}
{% assign metaobject_data = product.metafields.custom.related_blog_post.value %}
{% if metaobject_data %}
<p><a href="{{ metaobject_data }}">Product Introduction</a></p>
{% endif %}
{% endif %}
</div>
Hi @CrazyGen_IN,
Please go to Customize > Product information > Add block > Custom Liquid and add code:
Code:
<a href="{{ product.metafields.custom.related_blog_post }}">Link blog</a>
@CrazyGen_IN Please follow below steps to show the metafield "related_blog_post" on product page.
<div class= "metafield_value">
<a href="{{ product.metafields.custom.related_blog_post.value }}" class="related_blog_post_btn">
See blog
</a>
</div>
<style>
.product__info-wrapper .metafield_value .related_blog_post_btn {
padding: 7px 12px;
background-color: #000;
color: #ffffff;
border: solid 1px #000000;
text-decoration: none;
border-radius: 2px;
font-size: 17px;
display: flex;
justify-content: center;
}
</style>
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By 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, 2024