Shop Now: On-Store Setup (Embedded)
Loop's Shop Now: On-Store feature uses a store’s product collections in Shopify to encourage shoppers to make exchanges instead of returns. The resulting exchanges help merchants retain and increase revenue.
- Only merchants using Shopify 2.0 (a Shopify update adding more feature and tooling options, as well as architecture upgrades) have access to embedded On-Store. Merchants that do not use Shopify 2.0 can still set up and use Loop's original On-Store feature.
- These setup instructions are for merchants using Shopify's theme builder. If a merchant does not use Shopify themes or creates their own, they probably have a "headless" Shopify store. Headless means that the store is built with the front end separate from the back end so that shopper-facing updates don’t affect back-end performance. For headless setup, go to Loop's On-Store headless setup article instead.
In this article:
- How it works
- Shop Now: the On-Store shopper experience
- Set up Shop Now: On-Store
- Test your work
- Optional setup details
- Publish the Shop Now: On-Store theme
How it works
The Shop Now: On-Store experience has two parts:
- The Shop Now feature lets the shopper exchange an item they bought with any other item from the store's catalog while they're still in the Loop portal.
- The On-Store version of Shop Now brings the shopper directly to the store's website to make this new purchase before returning to Loop.
Shop Now: the On-Store shopper experience
Check out the video below to understand what this shopper experience looks like!
Set up Shop Now: On-Store
Follow the instructions below to set up the On-Store feature. After doing these steps, more details can be added based on the store’s specific needs.
- Loop recommends saving a backup of the previous theme before publishing the new one. Please contact a developer on your team, your Merchant Onboarding Manager, or email@example.com if you need help saving a backup.
- These instructions are for the Chrome browser, but the steps will look generally similar in any browser.
Get On-Store into Shopify's theme editor
Because the current theme is likely not set up for On-Store, merchants must create a new theme to connect to the On-Store feature. Play the video below or review the written instructions beneath it to learn how to set up a new theme. The video covers instructions before the "Fill in the blanks" header.
Set up a development theme in Shopify
- Open the Shopify admin page in a separate tab or window in the browser.
On the left sidebar, click Sales channels.
Click Online Store when the pop-up window appears.
After the page loads, the store's current live theme should appear in the middle of the screen. Click the ellipsis button (a set of three periods) on the right side of the current live theme.
From the ellipsis menu, click Duplicate. A copy of the current theme will appear in the "Theme library" section of the page with a “Just Added” tag next to the “Copy of [theme]” title.
Important: Do NOT click Publish on the new theme yet, as doing this will activate the new theme before setup is done.
- Rename the new theme as needed.
On the new theme, click the ellipsis button > Rename. A pop-up window will appear.
- Enter the new name in the text field. Loop recommends naming the theme in a memorable way, such as "Theme + Loop On-Store Integration."
Click Save in the pop-up window.
Tip: As edits continue, merchants may not always need to duplicate the theme before making changes. Loop recommends duplicating at first so that, if making changes to the theme code, merchants can test them before publishing.
Toggle on On-Store
To toggle on On-Store for the theme, follow the steps below:
On the theme page, click Customize next to the new theme.
On the left, click the App Embeds button.
Click on the On-Store SDK Integration switch. The toggle will move to the right, and the bar will highlight dark blue, as shown below.
Click Save in the upper right corner of the screen.
Note: If clicking between browser windows, and the checkbox has trouble showing (even after saving), please refer to the "toggle or checkbox" section of the On-Store Troubleshooting article.
After toggling the On-Store button on, a few pop-ups may appear. Below are explanations of each.
"On-Store Feature Not Available"
This pop-up appears for every merchant setting up On-Store for the first time because the feature must have an API key from the shop to activate. It should disappear after following the steps below to enter an API key. If the pop-up stays, refer to Loop's On-Store troubleshooting article to figure out why.
"Loop Manual On-Store is Already Running"
This pop-up shows when the older, more manual version of On-Store is already active for this store.
Note: Merchants may (and should) continue embedded On-Store setup; however, the new setup will not work until the merchant disables the old setup.
Fill in the blanks
Next, enter the remaining values for the On-Store snippet. Each sub-section below has both video and written steps to follow.
Add the API key
Click the carrot next to the store to expand the information underneath.
Click on the checkbox that says "Show On-Store bar." Doing this will show how the On-Store bar looks on the theme for visibility during setup and testing.
- When editing the theme for purposes outside of On-Store, merchants can un-check this box to hide the bar without turning off On-Store.
- If clicking between browser windows, and the checkbox has trouble showing (even after saving), please refer to the On-Store Troubleshooting article.
- Click on the Developers Portal highlight to get an API key.
Or, open a separate tab and go to Loop admin > Settings > Developers.
Under the API Keys section of the Developers page, copy an API key that is scoped to Cart only.
Tip: If there is no API key with a scope of "Cart" only, click the "Generate API key" button to make one.
Paste the API key into the "Loop API Key (text input)" field in the Shopify theme customizer.
Click Save in the upper right corner of the theme editor window.
Important: If, after entering the API key, the "On-Store Feature Not Available" pop-up still shows, please refer to Loop's On-Store troubleshooting article to figure out why.
Add the checkout button selector(s)
Important: Follow the steps below for each checkout button that shoppers could come across through the store. For example, shoppers could add items and check out through a side cart that shows on the same page as the inventory, or they could open their cart and check out from the main cart page.
To find these values:
- Open the Shopify store in a new tab.
Right-click the checkout button and select Inspect to open the Inspector Tool.
In the highlighted part of the Inspector Tool, find the ID or Class, which are unique identifiers for the checkout button. This will look like “id=‘[id]’” or “class=‘[class]’”.
- The checkout button may have both a Class and an ID, or more than one of each.
- If a unique ID does not exist for the checkout button, one may be present in the theme's Themes section by way of clicking Edit Code in the ellipsis menu, then opening “cart-template.liquid”. However, the placement of the identifier(s) depends on the particular theme. For help finding or creating a unique ID, please reach out to firstname.lastname@example.org.
To add the Class or ID values:
- Copy the part in quotes for the ID or Class within the Inspector Tool.
Add the value to the Shopify theme customizer's "Checkout Button Selector (text input)" field.
Important: When adding identifiers, a hash (#) should always proceed and ID, and a period (.) should always proceed a Class.
- If the shop provides checkout buttons in both a side cart and a cart page, add the Class or ID for each button so that the backend code connects both buttons to the On-Store flow.
- To add multiple Classes or IDs, separate each value in the Checkout Button Selector field with a comma.
- If wanting to create one Class or ID that represents more than one checkout button, go to the theme page > the ellipsis button for the theme > Edit Code. Then add a common value manually within the "theme.liquid" file, as well as in the "Checkout Button Selector (text input)" field. For help with this, please contact email@example.com.
Click Save in the upper right corner to make sure all the changes keep!
Great job! Later, when publishing the new theme, this code will activate the Shop Now: On-Store experience automatically for shoppers coming from Loop. Adding the API key also lets the store's code talk to Loop’s API.
Test your work
Next comes testing all this work to make sure On-Store is functioning as expected. For any troubleshooting needed during testing, please refer to Loop's On-Store Troubleshooting article.
Tip: Loop highly suggests using a developer’s or engineer’s help here.
Test the setup
Click Save in the theme customizer to make sure all of the changes stick.
Click the back arrow on the theme editor page to return to the Shopify themes.
On the recently edited new theme, click the ellipsis button > Preview.
- Right-click anywhere on the new Preview tab and select Inspect.
Click the Console tab at the top of the Inspector Tool. If struggling to find the Console tab, try clicking the carrot symbol to show more options.
- Scroll to the bottom of the code in the Console tab.
- Type “LoopOnstore.testMode()” at the very end of the code. (Or, copy and paste it from here.)
Press Enter on the keyboard. A credit banner should appear at the bottom of the Preview page:
If a credit banner doesn't appear, reach out to firstname.lastname@example.org.
Test the checkout button(s)
Important: if the shop provides multiple checkout buttons (for example, in both a side cart and a cart page), Loop suggests testing all checkout buttons separately using the instructions below.
To test the checkout button(s):
- In the Preview (see Test the setup for help previewing the theme), add any product to the cart.
- Right-click anywhere to open the Inspector Tool again and click the Network tab.
Underneath the tab names, make sure the "Preserve log" checkbox is selected. If it isn’t, click the “Preserve log” square to select it.
Click the checkout button within Shopify. Again, click each separate checkout button on the shop's website. Doing so should display a pop-up on the screen saying “Test Mode Successful”:
- Developers can also check that no unexpected responses or errors appear under the Network tab.
Tip: If the "Test Mode Successful" pop-up does not appear when clicking the checkout button(s), please review Loop's On-Store troubleshooting article to double-check the setup. For more testing help, please contact email@example.com.
Optional setup details
Publish the Shop Now: On-Store theme
To publish the On-Store theme in Shopify:
- Go to Shopify admin > Sales channels > Online Store.
Click the Publish button next to the theme being published. This will display the new theme on the storefront immediately.
- Notify your Onboarding Specialist or email us at firstname.lastname@example.org!
A developer can also make a call directly in their browser to “LoopOnstore.isActive()” to confirm that a shopper will have the On-Store experience.
Why can't I see or use the embedded On-Store version? Embedded On-Store is only available to merchants on Shopify 2.0, a Shopify update adding more feature and tooling options, as well as architecture upgrades. You may be on 2.0 already if you see an "add section" theme within the Shopify theme customizer.
If not using this version of Shopify, you can either a) look into migrating your themes and apps to 2.0 or b) use Loop's original On-Store feature.
Now that I’ve integrated the Shop Now: On-Store experience, can I still safely edit my theme? Absolutely! Loop recommends you save a backup of your previous theme and test the On-Store experience thoroughly after making any changes. Refer to the “Test the setup” section of this article for testing instructions.
I made a theme change and now my checkout button isn’t working correctly through the Shop Now: On-Store experience. What should I do? Review the steps for “Set up a development theme in Shopify“ above. If the problem continues, please contact your Merchant Onboarding Manager or email@example.com.
Where can I find my Shop Now: On-Store API key? You can locate your API key under Loop admin > Settings > Developers.