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

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.
Thank you in advance! :-)

Related

How to make a shopify app/theme extension which would get displayed in the brand's store UI?

We have an application which integrates with Shopify Clothing stores. We run our application in an iframe inside the shopify store where it interacts with the store's user.
Right now this application gets integrated with Shopify manually by inserting our script tag inside the store's product page. Can someone tell me how I can do this using a shopify app or theme extension?
Edit after David's answer
Is it also possible for me to get information about standard buttons in the theme like the Add to Cart button or Change Variants input. Ideally I would like to get the selector for these.
You would create a Shopify App that asks for permission to write ScriptTags. The Apps simply installs a script tag pointing to your App. So when the merchant installs your App, they get the script tag. Depending on what your App does in that iframe, you may need your Shopify App to provide other support, but that is not detailed in your OP, so I leave it at that.

Where the captcha code is located in shopify?

I want to display captcha on the same page under the contact form. But I can't able to find where it is located in Shopify liquid code.
If you are familiar with liquid code editing, you could try below solution.
https://community.shopify.com/c/Shopify-Design/Adding-Google-reCaptcha-v3-to-the-Shopify-contact-form/td-p/467787
If you are not familiar with editing code, you will have to use an app from shopify app store.

How to change in template through the Shopify application

I am trying to write a Shopify application and I want to add a section to the product page when the store owner installed my app. I tried this by adding a custom script tag in the shop template and this tag will load and inject my desired HTML into the page. It's work but it needs to force the store owner to change the product page template and its not user-friendly.
I see some apps in the Shopify app store that can change the product page after you install them without needs add any part to the product page template. How they do this work? I can't find the correct way in the Shopify documents.
You can change the Shopify theme of the shop using The API for Assets:
However as drip mentioned this is not a good idea:
If you change the theme auto-magically via code, you are looking for trouble. A lot of things can go wrong - simply you cannot cater for all themes and their changes over time! So you could possibly leave a broken page after the change. The e-shop owner won't be impressed! Actually a lot of the 1* reviews of apps are for that reason!
What would happen if the eshop owner removes your app? He won't know what code to remove.
So, most apps ask the user to add the app code. They provide detailed instructions of course.
Fyi, another problematic approach is the following:
Some apps may attempt to change the DOM "on the fly", by first locating an existing DOM element (a lot of theme-specific if statements to do that with any degree of success) and, then insert the app's DOM elements.
That's very messy and problematic as well, but at least you do not risk ruining the owner's theme files. In the worst case he can uninstall your app and he 'll be ok.

Disable Mailchimp double opt-in in shopify

I'm new with shopify and mailchimp so I'm finding it a bit hard to implement mailchimp APIs inside shopify. Can anyone walk me through the process on where to add the API code and help me put up the javascript code to be used to disable mailchimp's double opt-in inside my shopify theme?
Every help is very much appreciated.
Thanks!
To disable the mail chimp integration, you can choose the Customize theme option----> footer----> disable the newsletter option OR just remove the Form 'Action' URL. (I'm using GRID theme, the steps might change for a different theme.)

Shopify api: add a link

I am developing a shopify app.
Is it possible to add a new link to the main menu via the shopify API?
Thanks
If you log in to your partner account and then create an App you can edit the created App and you will see all the resources at your disposal where you can add a new link.
If you notice also, using the API you can pull and rewrite any asset in a shop to contain a new link. This is discouraged as bad practice. Instead, inject a script tag that does the dirty work.
Soon as I know the API itself cannot change something inside the theme files... some APPs ask you to apply some code manually in the theme, with proper instructions... maybe this code could add the new menu or dynamically interact to get it.