1.7. Sample Implimentation: Shopify
Download The Sample Script
The sample Shopify Live Lookup integration can be downloaded here: https://github.com/helpspot/shopify-live-lookup
To set up the Shopify Live Lookup in HelpSpot you first need to obtain an API key and password for you Shopify Store. To do this:
- Login to your store's admin area
- Click on Apps
- Select "Manage Private Apps"
- Choose "Create Private App"
- Enter the needed settings giving the app read access to your store
- You will then be given the API key and password to use to authenticate the live lookup integration
- Download the live lookup script and open shopify.php in an editor
- Specify a random string for the `$ll_key`. This adds basic security to the script to prevent unauthorized access to your customer information
- Enter you store URL, api key and password in the variables at the top of the file:
//your store url without a trailing "/" $store_url = "https://mystoreurl.myshopify.com"; //The api key and password are created when setting up the private app in the shopify settings $api_key = "yourapikeyhere"; $api_pwd = "yourapipasswordhere";
- Save your changes to the custom_code folder in your HelpSpot installation.
- In the HelpSpot web admin area go to Admin > Settings > Live Lookup
Add a new Live Lookup specifying a name, via GET and then the URL for your livelookup script. To build the URL we'll use the `$ll_key` set earlier. Example:
Your Shopify Live Lookup will now allow you to lookup customer information. By default the search logic cascades through using the Customer ID, Email and finally the First and Last Name to find the customer. This search logic can be customized for your needs.
The Shopify Live Lookup will display a number of customer information fields including links back to your shopify admin area. This can be all customized to your needs.