cs-icon.svg

Shopify App Installation Guide

Shopify is a leading ecommerce platform for businesses of all sizes. It allows you to set up an online store to sell your products.

With the Contentstack Marketplace Shopify app, you can use and refer to the products from your Shopify account within your Contentstack entries.

Prerequisites

Let's follow this step-by-step guide to install and configure Shopify within your stack.

Steps for Execution

  1. Get your Storefront API Access Token from Shopify
  2. Install and Configure Shopify in Contentstack Marketplace
  3. Use Shopify within your Stack
  1. Get your Storefront API access token from Shopify

    To get your configuration details for Shopify, follow the steps given below:

    1. Log in to your Shopify account.
    2. On the Admin portal, click Apps in the left navigation menu and then select App and sales channel settings from the dropdown.
      Shopify-Account-App-and-Sales-Channel-Settings
    3. Click the Develop apps button.Shopify-Account-Develop-Apps
    4. On the App development page, click Create an app. Mention the App name and select the App developer of your app, and then click the Create app button.Shopify-Account-Create-App
    5. On the next screen, navigate to the Configuration section and configure the Storefront API integration for your app.
    6. Select the access scopes for your Storefront API and Save your configuration.Shopify-Account-Save-Configuration
    7. Finally, under the API credentials section, click the Install app button, confirm your installation, and proceed to get the Storefront API access token.Shopify-Account-Storefront-API-Access-Token

      Note: The Storefront API access token is required to connect your store with Contentstack. Make a note of this access token to be used in the next step.

  2. Install and Configure Shopify in Contentstack Marketplace

    Follow the steps to install the app in Contentstack.

    1. Log in to your Contentstack account.
    2. In the left-hand side primary navigation, click the Marketplace icon to go to the Marketplace.
      Marketplace-Icon
    3. Click Apps in the left panel.
    4. Within the Marketplace, you can see all the available apps. Hover over the Shopify app and click Install.
      Shopify-App
    5. In the pop-up window, select the stack where you want to install the Shopify app, accept the terms of service, and click the Install button.
      Shopify-App-Install
    6. On the Configuration screen, you can add multiple configurations for Shopify stores. To do this, follow the steps given below:
      1. Click the + New Configuration button to add new configuration details.
        Shopify-Configuration-Add-New-Configuration
      2. In the Add Configuration modal, enter the configuration Name and click Add.
        Shopify-Configuration-Add-New-Configuration-Modal
      3. After adding the configuration, enter the following details:
        1. Domain: Enter the Store domain name retrieved from your Shopify Console in step 1.

          Note: Please enter the URL without the http:// and https:// prefixes.

        2. Storefront Access Token: Enter the Storefront API access token retrieved from your Shopify account in step 1.
        3. Set As Default: To set this configuration as the default, click this checkbox.
          Shopify-Configuration-Add-New-Configuration-Credentials

          Alternatively, you can set a configuration as the default by clicking three dots on the top-right side of the configuration section and then selecting Set As Default.

          Shopify-Configuration-Set-As-Default

          Note: At least one store configuration should be selected as the default.

      4. To delete the configuration, click the three dots and select Delete Configuration.Shopify-Configuration-Delete-Configuration

        In the Confirm Deletion modal, add the configuration name and click Delete.

        Shopify-Configuration-Delete-Configuration-Modal

        Similarly, you can add multiple configurations by following the steps discussed above.

      5. Save in Entry: Choose how you want to save your data in the entry.
        1. If you select All Fields, you can select only a limited number of products.
        2. For Custom Fields, you should search and add specific Shopify Keys you want to fetch. By default, the id and title keys are selected.
        Shopify-Configuration
      6. Legacy Settings: If you want to use the old version of the Shopify app, enter the configuration details in this section.
        1. Enter the Store Domain name retrieved from your Shopify Console in step 1.

          Note: Please enter the URL without the http:// and https:// prefixes.

        2. Enter the Storefront Access Token retrieved from your Shopify account in step 1.
        3. Select the Type and Selection.
        4. Enable the Save Full Response toggle button to save all fields data in the entry.
        Shopify-Configuration-Legacy-Settings
      Note:
      1. If you have installed the app previously, you will have the app pre-populated with the old configuration values.
      2. The legacy version of the Shopify app has the following limitations:
        1. The app does not support the Sidebar Widget feature.
        2. You can only select either product or collection in the same entry.
        3. You cannot select products based on the collection.
        4. The app does not support multiple configurations.
    7. Click the Save button.
    8. On the UI Locations tab, you can see the predefined app locations. You can use the toggle button corresponding to each UI location to enable or disable it based on your requirements.

      Additional Resource: For more information on UI locations, please refer to the Installed Apps guide.

      Shopify-UI-Locations
    9. Click Open Stack to start using the Shopify app.
  3. Use Shopify within your Stack

    To use the Shopify app within an entry of your stack, follow the steps given below:

    1. Go to your stack, click the Content Models icon in the left navigation panel, and click the + New Content Type button.
    2. Create a content type by adding relevant details as displayed below:
      Shopify-Content-Type
    3. In the Content Type Builder page, add a Custom field for product in your content type by clicking the Insert a field link represented by a + sign.
    4. Under Select Extension or App, select Shopify-Product Field and click the Proceed button.Shopify-Custom-Product-Field

      This adds Shopify-Product Field in the custom field.

      Shopify-Custom-Product-Field-Added
    5. Add another Custom field for collection in your content type by clicking the Insert a field link represented by a + sign.
    6. Under Select Extension or App, select Shopify-Collection Field and click the Proceed button.Shopify-Custom-Collection-Field

      This adds Shopify-Collection Field in the custom field.

      Shopify-Custom-Collection-Field-Added
    7. To add a deprecated version of the Shopify app to your entry, add yet another Custom field in your content type by clicking the Insert a field link represented by a + sign.
    8. Under Select Extension or App, select Shopify-Deprecated and click the Proceed button.Shopify-Custom-Deprecated

      This adds Shopify-Deprecated in the custom field.

      Shopify-Custom-Deprecated-Added
    9. After adding the app, click Save or Save and Close to save your changes.Shopify-Content-Type-Fields
    10. Under Advanced properties, you also have the option to set the Config Parameter for all entries of a particular content type. This will override the default app configuration which you set at the time of app installation on the Configuration screen.

      The key:value passed in the configuration object overrides the default app configuration settings.

      In case you want to use a different Shopify account(s) for any custom field within the same stack, you need to specify the Shopify store name in the Config Parameter.

      Configuration Object:

              {
                "config_label": ["Store 2"],
              }
      

      Adding locale based configuration::

      To add a locale based configuration, add a locale parameter to the additional configuration object which specifies the locale value (for example: en-us) as the object key and the configuration object as the value to the locale.

      localeConfiguration Object:

              {
                "config_label": ["Store 2"],
                "locale": {
                    "en-us": { 
                        "config_label": ["Store 1", "Store 3"]
                    },
                    "fr-fr": { 
                        "config_label": [] 
                    }
                 }
              }
      
      Shopify-Custom-Field-Add-Config-Parameter

      Note: If any configuration value is not added, or if all the values are empty in the Config Parameter properties settings, the Shopify app uses the default configuration which was set up in step 2.

    11. In the left navigation panel, navigate to the Entries page and click + New Entry to create a new entry for the above content type. Click Proceed.
      You will see the Shopify custom fields on your entry page as shown below:Shopify-Sample-Entry

      Note: In the new version of Shopify, you can select both products and collections in the same entry.

    12. Click the Add Product(s) button, select the products from your Shopify selector page, and add them to your entry.Shopify-Product-Selector-Page

      You can filter products based on your stores. By default, the store configured at the time of installation in step 2 is selected.

      Shopify-Product-Selector-Page-Store-Filter.png

      You can filter products based on your collections. Click the Select Collection drop-down and choose the collection to filter the products.

      Shopify-Product-Selector-Page-Collection-Filter.png

      You can also search and filter products in the Shopify selector page.

      Shopify-Product-Selector-Page-Search.png

      Hover over the product on the Shopify selector page, and you can see the View in Shopify option to go directly to the Shopify platform.

      Shopify-Product-Selector-Page-View-In-Shopify.png

      The products you selected are referenced within your entry in the thumbnail view.

      Shopify-Product-View-Thumbnail

      To view the products in list view, select the List view option from the dropdown.

      Shopify-Product-View-Options

      The products you selected are referenced within your entry in a list.

      Shopify-Product-View-List
    13. To reorder, open in Shopify, or remove the selected product, hover over the product to get the available options, then perform the following:
      1. Click the Reorder icon to drag and reorder the product.
      2. Click the Open in Shopify icon to open the image in the Shopify app.
      3. Click the Remove icon to delete the product.

      Thumbnail View

      Shopify-Product-View-Thumbnail-Features

      List View

      Shopify-Product-View-List-Features
    14. Click the Save button to save your entry.
      You can view more product details in the Sidebar Widget.

      Note: You must save your entry to get the product details in the Sidebar Widget.

    15. In the right navigation panel, select Widgets, and then select Shopify to view the product details.Shopify-Sidebar-Widget.png
      Note:
      • Deprecated version of the Shopify app does not support the Sidebar Widget.
      • When a product, which is referenced in the entry, gets deleted from the store, an error message is displayed in the Custom field and Sidebar widget.

      You can also search and view the product details.

      Shopify-Sidebar-Widget-Search.png
    16. Click the Add Collection(s) button, select the collections from your Shopify selector page, and add them to your entry.Shopify-Collection-Selector-Page

      You can filter collections based on your stores. By default, the store configured at the time of installation in step 2 is selected.

      Shopify-Collection-Selector-Page-Store-Filter

      You can also search and filter collections in the Shopify selector page.

      Shopify-Collection-Selector-Page-Search

      Hover over the collection on the Shopify selector page, and you can see the View in Shopify option to go directly to the Shopify platform.

      Shopify-Collection-Selector-Page-View-In-Shopify

      The collections you selected are referenced within your entry.

      Shopify-Collection-View-Thumbnail

      To view the collections in list view, select the List view option from the dropdown.

      Shopify-Collection-View-Options

      The collections you selected are referenced within your entry in a list.

      Shopify-Collection-View-List
    17. To reorder, open in Shopify, or remove the selected collection, hover over the product to get the available options, and then perform the following:
      1. Click the Reorder icon to drag and reorder the collection.
      2. Click the Open in Shopify icon to open the collection in the Shopify app.
      3. Click the Remove icon to delete the collection.

      Thumbnail View

      Shopify-Collection-View-Thumbnail-Features

      List View

      Shopify-Collection-View-List-Features
    18. You can continue to use the old version of the Shopify app in the current version by adding products(or collections) using the Shopify Deprecated custom field.Shopify-Deprecated-Product-Added
    19. Click the Save button to save your entry.
Was this article helpful?
^