'How to modify product page using Theme and Asset api for a shopify App

I am creating a Shopify app that will insert a trust seal or badge on the product page. However, there is difficulty in implementing it since there is no clear documentation or tutorials on how to do it. What I want to achieve is to place an image (trust badge) somewhere before or after the Add to cart button. This is a public app, so modifying the theme through Shopify API themes/assets is the only option to do it dynamically.

Shopify is really new to me. I just studied it for 3 weeks, maybe someone who has prior experience in implementing this would help me.

Please refer to the image for reference. enter image description here

Thank you in advance! :-)



Solution 1:[1]

There are 2 ways to handle this:

  • the old way of modifying with asset api: start from product.json template, find which section/block that contains the your button, add your new elements, then use api to update it.

  • the "new" way: use theme app extension, write your component in it, then your can manually attach it in theme editor, or write a script to attach it in place.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kudo