Posts

Showing posts from September, 2023

Sitecore OrderCloud SDK Client Library for .NET

Image
The Sitecore OrderCloud is an API-first and headless eCommerce platform, so developing OrderCloud based application is very different compared to the traditional Sitecore development.  The Sitecore OrderCloud SDK for .NET is a client library for building solutions targeting the eCommerce platform using C# or other .NET language.  You will probably always need this .NET SDK library in order to build any OrderCloud based application. In this blog, I'll walk you through the use of this SDK for development using .NET Console application where we'll try to fetch the orders from OrderCloud portal. Let's get started. Assumptions -  You have already setup your OrderCloud sandbox environment and configured Admin and Buyer users security profiles. Like this -  You have also created one API Client and have the access to the Sellers and Buyers. Please refer this screenshot -  Now, let's create some dummy orders in OrderCloud using API Console or Postman. We'll fetch these orde

Fetch component-level data in Next.js app using GraphQL - Sitecore Headless Development

Image
When we develop headless application in Next Js, we need to fetch the data from Sitecore for our components. Mostly, we do this by implementing and exporting getStaticProps for static generation ( SG ), or getServerSideProps for server-side rendering ( SSR ). The SitecorePagePropsFactory class uses an instance of the ComponentPropsService class that helps to identify which components require retrieval of data. The ComponentPropsService is provided by the NPM package @sitecore-jss/sitecore-jss-nextjs. For more details please refer this link . Use GraphQL to fetch component-level data in JSS Next.js apps GraphQL queries are very helpful when we need to fetch specific content for the components. It provides the flexibility to combine multiple data sources in a single query, and receive the requested data in a single response.  Let's try to implement one use case of this where we'll fetch the State List for our Next.js component from Sitecore using GraphQL query.  These are the st