Can a Shopify Public App extend the "Add/Edit Product" page? - shopify

I am building a new Shopify public app that displays a custom input in the product listing page (at the customer side).
So to enable this, the Shopify Admin should be able to choose specific products to enable this input. And I see two ways to implement this.
Extend Add/Edit product form to add a new section that houses my app-specific config options. See the image for an example.
If the 1st option is not possible, I will provide a separate form on my app page to select products and configure my app-specific options.
So is it possible to do #1? Also, which option is the better way of doing things here?
Any links to documentation would be helpful.

You can't modify the admin panel in any form using an App.
The only thing you can do on these pages is to add a link inside the "More actions" to your app page.
You can use extensions/bookmarklets/userscripts to create some custom logic to modify the admin page and communicate in some overly complicated way with your app but it will require more steps for the customer to work with your app which is not a very friendly way and you may not pass the review process for public apps.
TL;DR you must handle everything from your app screens and you can't modify the admin front-end in any form to add additional stuffs or modify existing ones.

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.

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.

Prestashop - how to create a custom page?

Title says it all. I want to create a custom prestashop page, but I don't know how.
What I actually want to do: create a button that opens a custom page. I can't find anything useful in the internet so I came here to ask for help. Could someone explain me how to do that?
There are many ways to add a new page, it depending in your needs.
By a CMS page, you can add the content you need in the HTML editor, like the product description: http://doc.prestashop.com/display/PS16/CMS+-+Managing+Static+Content
By a front controller from a module: https://devdocs.prestashop.com/1.7/modules/concepts/controllers/front-controllers/
By creating a new page, here my explanation: Prestashop custom page with own template
The point 1 is the most easy way for a common user, the rest of the points require advanced knowledge.

How do I connect my appixia app to my prestashop contact page?

I've added a contact button on the title bar but I can't get my contact form to display. Has anyone done this?
First of all, the contact button Module field should point to a new Activity module like VerticalContainerActivity which should contain an HtmlView module in its body. This HtmlView displays your contact page - put the address in its ContentUrl. Most of these steps are identical to what you'll find in this tutorial.
You can see an example of this in the diamonds sample app. Create a new app from the diamond store starting point and see how the contact button is implemented there.
The second important point to remember is that you shouldn't use regular store URLs in your Appixia app. When the user sees them, they would see your Prestashop theme with all the navigation and this will be very confusing inside a mobile app. Instead, make a mobile friendly version of your contact page which doesn't use your Prestashop theme and only shows the contact info content.
Using the Prestashop Contact Form in your Appixia app:
I'm not sure this is a 100% good idea in terms of usability. I don't recommend using a web form for contact in a mobile app.
A mobile phone is a communication device. It is has special integration for making phone calls and sending emails - I really recommend you use these methods instead. Look at the HTML source of this example to see how simple it is to integrate (it's just a link in your HTML).
In order to encourage your users to contact, you need to ask them for as little info as possible. Your website contact form makes your users type in their email address. If they email you directly through their device (with a mailto: link), their correct email will be filled automatically. Same with making a call, when they tap on the link, the number will be dialed automatically for them.
If you really insist on implementing the Prestashop contact form, this will require some Prestashop php games. You should find the contact form controller in the Prestashop source and create the same form (in php or hardcoded HTML) without your website theme. It will be a little annoying because after we submit the form, we also need to make sure the confirmation message is also displayed without your website 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.