I Want to create my own customized modules in Shopify when customers is logged in.
Example: I would to show near by doctors through the map.
Is it possible to do in Shopify.
Yes it is. You would install a custom App that would contain a list of doctors and locations. You would create a Proxy in the App so you could make a secure callback to the endpoint. As data, you'd send the customer ID. Using the customer ID, the App would get the customer's location. The data you return would be the matching doctors.
Very common to do this with Shopify.
Related
I'm working with a client that wants to build some custom rudimentary affiliate functionality. The requirement includes two types of users: "owners" who are technically the affiliates and "customers". We are planning to use metafields to assign owners to customers (simply an integer metafield in the customer object that holds the owners userid, managed by a site admin). We would like to create a liquid template, accessible by the owners, that show a list of their customers and some customer and order metafield data. This requires one user (the owners) to be able to each into another user's (customers) metafield data. Is this possible in liquid without creating an externally hosted app?
If not, I assume this is possible via the API. In that case, is it possible to use the API right in liquid without creating an externally hosted app?
Thanks!
No, Shopify does not allow you to access customer objects (and by extension, metafields on other customer objects) other than the customer that is currently logged in.
To access arbitrary customer information, you will need to set up an app with admin permissions to access customers. While technically you could make admin API calls through the front-end, doing so would require exposing admin-level API credentials and would be a Very Bad Idea.
You will definitely want an externally-hosted app to run this code on, as the app you are describing will have access to PII and other sensitive data.
Background:
I am making an app which will be a public app and will put it on Shopify App Store.
I have completed with the OAuth process and I get access_token and scope in return which is good. I can now use this token and send API requests with X-Shopify-Access-Token in the header.
But, for my database design, I need the user details as well, like user ID or email ID for example. However, I read the docs(scroll up a bit) and it suggested in the caution section that email address is not reliable to identify the user(merchant). I also gave a read on access modes which is online and offline, and in my case, I would need an offline access token.
Question:
How would I get a User ID from Shopify during app install so that I could uniquely identify each merchant?
One of the reasons I would want to have this is because a single merchant could have(or see) multiple stores linked with my app and I wish to show them details for each store under a single user account.
When a merchant installs your App, during the oAuth flow, you are presented with the shop name. That is unique, and will always be present for incoming calls to your App from Shopify.
You do not mess around with email, or user ID's. You simply persist the access token you got in your data store, with the shop name.
If you wanted to group by a merchant name, you know each Shop object provides the shop owner details. So you can always dig those out and store them along with the shop name, allowing you to show one merchant, many stores.
i want to develop a chrome extension to see stats for any store which develop in shopify, can i access any store products without API-Key and Password in shopify?
No, you cant access products json without using api-key or permanent token of the store.
But still you want to access the product details you atleast needs the handler of the product.
Lets say your store is "abc.myshopify.com" and handler of your product is "xyz", then you can product json of xyz by HTTP GET call in following url
https://www.abc.myshopify.com/products/xyz.json
in general
https://www.[storename]/products/[product-handle].json
You could try using the Shopify StoreFront API.
It allows to get information of your shop from from your own website or custom app. Although it doesn't need a API Password, it needs a Api Key that doesn't need to be a secret.
The documentation says this (the first point is the important):
Using the Storefront API, you can:
Fetch data about a single product or a collection of products to
display on any website or device.
Create unique checkout experiences
with full control over the shopping cart.
Create new customers or
modify existing ones, including address information.
Allow customers
to select unique product options.
There is no way shopify will provide store details (product list) without api authentication.
For your requirement, I would suggest to create a shopify app which will sync all product details to your storage and you can access data from there.
I'm trying to evaluate Sylius as a replacement for an existing shop system. However, I was unable to find an option on the demo system where Sylius calculates VAT based on the user's delivery address. Additionally, the VAT is not displayed in the frontend. How can this be configured?
If you want to show product based on address in frontend that would be little tricky, I think best way is to create custom channel. Then detect user location and show proper channel (maybe subdomain) - in any case for this you need to know user location. We resolved this in one project with asking him at the begining then store to cookie or account if he is logged in.
Regarding tax based on address in checkout that is possible, tax is very flexible and it is related to type of products (category) or location, so you can create different tax for different countries and this will be updated in checkout process after user decide where to deliver it.
I have a Shopify app that creates a webhook for orders/fulfilled when a shop signs up, I also save some details about the shop as well as it's products.
When Shopify sends me fulfilled orders via the webhook, i want to associate this order with the appropriate shop to which it belongs.
I have looked in the data sent, but there's no shop name or shop url.
Is there a way for me to determine which shop the orders belong to?
Thanks.
If you have setup a Webhook then you know two things for sure.
The domain of the shop calling you is in the header
There is authentication information in the header you have to use
If you are not authenticating your webhook you're doing it wrong. So the short answer to determining which shop is calling you is to look inside the header for the domain.