Is it possible to access section data with the shopify API?
I want to pull things from section.settings.whatever to build custom storefront functionality. I would prefer not to pass them all as DOM variables in the template.
Yes you can get all the settings and you don't need to update all the liquid files. I will show you how to do in python you need to do it in your preferred language.
settings_schema = shopify.Asset.find('config/settings_schema.json')
#edit the file and the parameters and push it back to shopify
settings_data = shopify.Asset.find('config/settings_data.json')
#edit the file and the parameters and push it back to shopify
These 2 files contain all your theme settings and can be found in Config directory of your Shopify Theme.
Related
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.
I see multiple scopes on Shopify API likes write_themes or write_script_tags to add content in differents files of the theme.
I would like to create an app to add a marketing pixel in differents pages like checkout, index or add_to_cart.
I will need to add a script like :
<script>
...PixelCode...
init('API_KEY', VIEW)
</script>
I will need to set the API_KEY variable dynamique and editable from the panel of the app.
What is the best scope and way to do that ?
Thank you in advance.
Have your App installed in the merchant shop. They approve your App to add script tags. Next up, have your App install the needed script tags. Finally, profit from your hard work.
As for the scopes, writing a script tag only requires that scope. You are not modifying the merchant's theme, so you do not need that scope.
I want to have a Shopify app that allows me to automatically (so that the user doesn't have to edit the code) add code into one of a user's .liquid files. I can't seem to figure out how to do this.
A client of mine wants to create their ecommerce site with BigCommerce as back-end. BigCommerce has lots of theme's available in their theme store. This client however does not want to be just another website using a certain theme, but have a theme unique to their company. You can build your own theme which would use your own config.php, something they use to set global variables in their templating engine.
However as far as I can read on their developers site the only way that you could create your own theme is if you then start selling it in the theme store, which of course would allow other companies to adopt this same theme against a certain price. Something my client doesnt want. They want to be unique.
So my question is: Can you create a custom bigcommerce theme from scratch, without selling it in the theme store?
Absolutely, however you can set up a config.php file and all that. You can simply start with any theme available in the current theme store, download the HTML, CSS, JS, Image, etc files and customize them to your liking. These are completely open ended.
You won't really miss anything this way, the only thing the config file does is set the default store settings when that theme is applied such as menu depth, fly out menus, display of weight, etc. All that can be adjusted manually by you or your client in the store settings!
So to answer my own question directly: No, you cannot create a theme from scratch without being a parter of bigcommerce and making your theme available in the theme store.
You can get close as #TheEks describes by simply choosing a theme (preferably the blueprint, available when going in to dev mode), and then overwriting whatever contents the html files have. You will need to check for updates to the bigcommerce theme yourself and implement those in your code. You will not be able to remove theme files, if you no longer use them, from the webdav server, only revert them to their original state. You can just ignore them of course.
I'm building a Shopify application and I'm interested in automatically adding a liquid content into the shop's theme.
A file with a .liquid extension is considered to be an asset. Since you can add assets to a shop, the answer is yes, you can indeed inject Liquid template code into a shop's theme.
If you use an App Proxy you can also send Shopify Liquid strings and Shopify will render that right in the Shop for you. Pretty neat stuff.