Shopify themes, liquid, logos, and UX
Hi, I am looking to display the image from the following file metafield on the thankyou page. Is there a way of doing this please?
Thanks 🙂
order.metafields.my_fields.safe_place_photo
Try this
{% assign safePlacePhoto = order.attributes.metafields.my_fields.safe_place_photo %}
{% if safePlacePhoto != blank %}
<img src="{{ safePlacePhoto | img_url: 'master' }}" alt="Safe Place Photo">
{% endif %}
Hi @LittlePaddocks ,
This is Richard from PageFly - Shopify Page Builder App.
You can you html into metafield. So, you just call metafield nameBest regards,
Richard | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
➜ Optimize your Shopify store with PageFly Page Builder (Free plan available)
All features are available from Free plan. Live Chat Support is available 24/7.
Hi @PageFly-Richard & @Guleria .
I have added the below code using the additional scripts section in checkout settings. But it still doesn't seem to be showing. Any advice please?
Thanks 🙂
<script>
Shopify.Checkout.OrderStatus.addContentBox(
{% assign safePlacePhoto = order.attributes.metafields.my_fields.safe_place_photo %}
{% if safePlacePhoto != blank %}
<img src="{{ safePlacePhoto | img_url: 'master' }}" alt="Safe Place Photo">
{% endif %}
)
</script>
Try this one
<script>
{% if order.attributes %}
Shopify.Checkout.OrderStatus.addContentBox(
'<p>{{ attributes ['metafields.my_fields.safe_place_photo'] }}</p>',
)
{% endif %}
</script>
@Guleria Thanks for the suggestion, I have added it in, and the content box is displaying but unfortunately still no image... 🙂
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025