Kentico.Xperience.Shopify 0.1.0-prerelease-2

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
This is a prerelease version of Kentico.Xperience.Shopify.
dotnet add package Kentico.Xperience.Shopify --version 0.1.0-prerelease-2
NuGet\Install-Package Kentico.Xperience.Shopify -Version 0.1.0-prerelease-2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Kentico.Xperience.Shopify" Version="0.1.0-prerelease-2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Kentico.Xperience.Shopify --version 0.1.0-prerelease-2
#r "nuget: Kentico.Xperience.Shopify, 0.1.0-prerelease-2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Kentico.Xperience.Shopify as a Cake Addin
#addin nuget:?package=Kentico.Xperience.Shopify&version=0.1.0-prerelease-2&prerelease

// Install Kentico.Xperience.Shopify as a Cake Tool
#tool nuget:?package=Kentico.Xperience.Shopify&version=0.1.0-prerelease-2&prerelease

Xperience by Kentico Shopify integration

Kentico Labs CI: Build and Test

Description

This integration connects your Shopify store with the Xperience by Kentico application using Shopify Storefront and Shopify Admin APIs. It provides synchronization of products and e-commerce actions between the two platforms. Implemented features provide users with the options to:

  • Add, update and remove products in the shopping cart.
  • Manage discount coupons.
  • Proceed to checkout directly on the Shopify store page.

Limitations

Shopify API can return maximum of 250 items in one API request. For larger number of products, pagination needs to be implemented. More info can be found in the Usage-Guide.md.

Screenshots

Products in content hub   Product detail page   Shopping cart page

Library Version Matrix

Summary of libraries (NuGet packages) used by this integration and their Xperience by Kentico version requirements. To use this integration, your Xperience project must be upgraded to at least the highest version listed.

Library Xperience by Kentico Version Library Version
Kentico.Xperience.Ecommerce.Common >= 29.0.1 1.0.0
Kentico.Xperience.Shopify >= 29.0.2 1.0.0
Kentico.Xperience.Shopify.Rcl >= 29.0.2 1.0.0

Dependencies

Quick Start

  1. Generate Shopify API access tokens (see Generating Shopify API credentials for details).

    • Install the Headless channel into your Shopify admin. During the installation, select Create storefront and generate a private Storefront API token.
    • Install a custom application into your Shopify admin and generate a Shopify Admin API access token. Set following access scopes: write_product_listings, read_product_listings, write_products, read_products, read_inventory, write_orders, read_orders.
  2. Add these packages to your Xperience by Kentico application using the .NET CLI.

     dotnet add package Kentico.Xperience.Shopify
     dotnet add package Kentico.Xperience.Shopify.Rcl
    
  3. Configure your Xperience application to connect to your Shopify instance via the CMSShopifyConfig object. For development purposes, you can also configure these settings directly in the Xperience by Kentico administration via the Shopify integration application.

     {  
       "CMSShopifyConfig": {
     	"ShopifyUrl": "https://your-shopify-store-url.com/",
     	"AdminApiToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
     	"StorefrontApiToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
     	"StorefrontApiVersion": "YYYY-MM"
       }
     }
    

    Setting description | Setting | Description | | -------------------- | ------------------------------------------------------------------------------------- | | ShopifyUrl | URL of the Shopify store | | AdminApiToken | Access token for the Admin API calls | | StorefrontApiToken | Access token for the Storefront API calls | | StorefrontApiVersion | Storefront API version that will be used in API calls. Must use the format: YYYY-MM |

    Note: The StorefrontApiVersion refers to the version of the Shopify Storefront API you are using. You can find the available versions and their release dates in the Shopify API versioning documentation.

    You can also configure the integration via the Shopify integration application in the Xperience admin UI. However, note that this approach should only be used for development purposes. For the production, use one of the recommended configuration methods.

  4. Add services provided by the integration to the service container.

     // Program.cs
    
     // Registers Shopify services
     builder.Services.RegisterShopifyServices(builder.Configuration);
    
  5. Enable session state for the application.

     // Program.cs
    
     // Enable session state for appliation
     app.UseSession();
    
  6. Add Xperience objects used by the integration to your project using Continuous Integration. The integration's CI files are located under .\examples\DancingGoat-Shopify\App_Data\CIRepository\. This CI repository does not contain any other objects than objects related to Shopify integration so it can be merged into your existing CI repository. Copy these files to your Continuous Integration repository and run:

     dotnet run --no-build --kxp-ci-restore
    

    The command restores the following objects: - Page content types: Thank you page, Shopping cart page, Shopify product detail page, Store page, Shopify category page(more info in Usage-Guide.md. - Content types used for synchronization with Shopify: Shopify product, Shopify Product Variant, Shopify Image(more info in Usage-Guide.md. - Shopify integration module for setting API credentials and adding currency codes. - Custom activities: Product added to shopping cart, Product removed from shopping cart, Purchase, Purchased product.

    Using CD is not recommended for restoring Product detail, Category, Store pages and content items that were created by synchronization with Shopify. This is because the Shopify product content item is connected to Product detail page. Therefore, both Product detail page and Shopify product content item will be restored. However, the synchronization already created the same Shopify product content item, using CD restore will result in duplicate Shopify product content items. To filter these objects from continuous deployment, add following rule into repository.config:

    
     <ObjectFilters>
     	<ExcludedCodeNames>Shopify.Image;Shopify.StorePage;Shopify.Product;Shopify.ProductDetailPage;Shopify.ProductVariant;Shopify.CategoryPage</ExcludedCodeNames>
     </ObjectFilters>
    
  7. The integration uses a Products Page Builder widget to display products from your Shopify store. Since Page Builder widgets cannot be distributed as part of NuGet packages, you must copy the Products widget implementation from the example project in this repository to your project. The widget implementation is located in this folder.

  8. Run your Xperience application (e.g., using dotnet run).

  9. In the Xperience admin UI, open the Shopify integration application and on the Shopify currencies formats tab and add the required currencies for your store. For currency codes, use the values from CurrencyCodeEnum. To format the output, we recommend using custom numeric format strings.

Full Instructions

View the Usage Guide for more detailed instructions.

Shopify configuration module

The integration adds a new Shopify integration application to the admin UI. Using the application, administrators can set Shopify API credentials and add currency formats. If Shopify API credentials are provided both via this application and configuration providers (e.g., appsettings.json), values from the configuration will take precedence. The application is located under the Configuration category. Shopify integration module overview

Codebase overview

Repository contains solution with Xperience by Kentico integration to Shopify. It shows the connection to the Shopify headless API and shows the implementation of a simple e-shop on Xperience by Kentico (extended Dancing Goat sample site). The solution consists of these parts:

  • Kentico.Xperience.Shopify - class library that contains all services necessary for this integration.
  • Kentico.Xperience.Shopify.Rcl - razor class library for selector components(used in standalone product listing widget).
  • DancingGoat - Sample Dancing Goat site.
  • Kentico.Xperience.Ecommerce.Common - common library for e-commerce integrations.

Contributing

To see the guidelines for Contributing to Kentico open source software, please see Kentico's CONTRIBUTING.md for more information and follow the Kentico's CODE_OF_CONDUCT.

Instructions and technical details for contributing to this project can be found in Contributing Setup.

License

Distributed under the MIT License. See LICENSE.md for more information.

Support

This contribution has Kentico Labs limited support.

See SUPPORT.md for more information.

For any security issues see SECURITY.md.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Kentico.Xperience.Shopify:

Package Downloads
Kentico.Xperience.Shopify.Rcl The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0-prerelease-2 36 6/3/2024
0.1.0-prerelease-1 44 5/20/2024