Sunday, November 10, 2019

Sitecore XC 9.2 - Merchandising products and how they are mapped with CatalogItemsScope Solr Index.

Sitecore XC manages all Merchandising product data in Solr CatalogItemsScope Index.

Here are the details.


Solr Index -


If you see all the fields in Solr Index like variantid,variantdisplayname,displayname, name are coming from the CatalogItemsScope  Index.

Sitecore XC 9.2 - Add a custom view in order detail page.

Sitecore XC has provided and extended feature where the author can define a custom view template and can define a few fields to provide more details about the product.

Here are the simple steps

Step 1 - Add a new view section


Step 2 - Define some new fields for the view.



Step 3 - Add the comments and instruction and it will be attached to the order,  you can also define this change as a template.


It's very easy to add a new view and useful during order processing.

Sitecore XC 9.2 - Place a new order and data flow.


Step 1 - Search for a product.




Step 2 - Select a product.



Step 3 - Add to cart and view cart.



Step 4 - Add to cart and view cart.


Step 5 - Billing Information.



Step 6 - Validate Card. You can use sample value from the Braintreepayment Here, Sample value
Card Number 4217651111111119 
Expire Date 01/2022 

Payment review - 



Step 6 - Order confirmation.




Step 6 - Verify order in Order Dashboard -



The Default order is in the pending stat -



Let's check what's is inside the DB and Solr Index at this time.



Order Summary -



Line Item details- 





Saturday, November 9, 2019

Sitecore XC 9.2 - Customer data flow.

It's a very important part to understand how and were Sitecore XC stores the customer data.

Here is the high-level flow -

Step 1 -

Register a new customer in Sitecore XC.



Step 2

We can see the data in Sitecore authoring --> Business tools --> customer data section


Step 3

As per the Sitecore documentation for the customer registration data here, they have mentioned that the new registered customer data will be stored in core database.


you can run the below script to see all tables in core and web database for the customer data reference.

Declare @SearchStr nvarchar(100)

SET  @SearchStr='jitusonijk@gmail.com' BEGIN

CREATE TABLE #Results3 (ColumnName nvarchar(370), ColumnValue nvarchar(3630))

SET NOCOUNT ON

DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128),
 @SearchStr2 nvarchar(110)  SET  @TableName = ''    SET @SearchStr2 =
 QUOTENAME('%' + @SearchStr + '%','''')

WHILE @TableName IS NOT NULL    
BEGIN       
  SET @ColumnName = ''      
  SET @TableName =  (
    SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' +
    QUOTENAME(TABLE_NAME)) FROM INFORMATION_SCHEMA.TABLES 
    WHERE
    TABLE_TYPE = 'BASE TABLE'
    AND QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName
    AND OBJECTPROPERTY(
      OBJECT_ID(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)),
        'IsMSShipped') = 0)

  WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)      
  BEGIN
    SET @ColumnName = (
      SELECT MIN(QUOTENAME(COLUMN_NAME))
      FROM INFORMATION_SCHEMA.COLUMNS
      WHERE TABLE_SCHEMA = PARSENAME(@TableName, 2)
        AND TABLE_NAME = PARSENAME(@TableName, 1)
      AND DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar')
      AND QUOTENAME(COLUMN_NAME) > @ColumnName)
      IF @ColumnName IS NOT NULL            
      BEGIN
      INSERT INTO #Results3
      EXEC
      (
        'SELECT ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + 
          ', 3630) FROM ' + @TableName + ' (NOLOCK) ' +
        ' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2
      )             
      END       
    END     
  END


  SELECT ColumnName, ColumnValue FROM #Results3 END



Core database - Tables-

Table - [aspnet_Membership]

ApplicationId UserId Password PasswordFormat PasswordSalt MobilePIN Email LoweredEmail PasswordQuestion PasswordAnswer IsApproved IsLockedOut CreateDate LastLoginDate LastPasswordChangedDate LastLockoutDate FailedPasswordAttemptCount FailedPasswordAttemptWindowStart FailedPasswordAnswerAttemptCount FailedPasswordAnswerAttemptWindowStart Comment
D1A11AC5-63B0-40A7-9320-3C88981A590C 004A77C7-7751-423C-A21D-1A472015F4DE 7Ai3EHC83gQbeuVZQdnr6tOTBlk= 1 gFFL5GuWSj8B8nvZHRtu3g== NULL jitusonijk@gmail.com jitusonijk@gmail.com NULL NULL 1 0 2019-10-29 07:00:57.000 2019-10-29 07:00:58.910 2019-10-29 07:00:57.000 1754-01-01 00:00:00.000 0 1754-01-01 00:00:00.000 0 1754-01-01 00:00:00.000

Table [dbo].[aspnet_Users]

ApplicationId UserId UserName LoweredUserName MobileAlias IsAnonymous LastActivityDate
D1A11AC5-63B0-40A7-9320-3C88981A590C 004A77C7-7751-423C-A21D-1A472015F4DE Storefront\jitusonijk@gmail.com storefront\jitusonijk@gmail.com NULL 0 2019-11-10 06:51:30.047

Table [dbo].[EventQueue]  

Id EventType InstanceType InstanceData InstanceName RaiseLocally RaiseGlobally UserName Stamp Created

648A35AF-19C0-4C76-8FED-72D3EEE35CBD Sitecore.Eventing.Remote.UserUpdatedRemoteEvent, Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null Sitecore.Eventing.Remote.UserUpdatedRemoteEvent, Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null {"UserName":"Storefront\\jitusonijk@gmail.com"} sitecore-SC921sc.dev.local 0 1 Storefront\jitusonijk@gmail.com 0x0000000000047CA8 2019-11-10 06:51:28.600


I didn't see any reference in the Web database.

The minion servie should pick the update from the database and update these data in Solr CustomersScope Index.


For the initial registration, You wouldn't see data in  CustomersScope Index


and finally, how customer manages the orders. A newly registered customer will be login and the CD role authenticates the customer against the ASP.NET membership tables in the core database.

Sitecore flow -




 I'm excited to see data in Solr and what all are the OOTB option to customize the data and integration with third party customer data managment systme like Gigya.

Desc


Monday, November 4, 2019

Sitecore Experience Commerce 9.2 how to protect the Solr admin page





Sitecore commerce latest release 9.2 does support the authentication plugin for the Solr, It's very interesting and I'm very excited to see this option there and would thanks to Sitecore for including this option :)

Here is the full context.

If you first-time setup the Solr - Standalone or Solr cloud there wouldn't be any by default security option available, you have to explicitly turn on this feature. and to do that there are a few options -

Available Authentication Plugins within Solr

Solr has the following implementations of authentication plugins:
Available Authorization Plugins within Solr
Solr has one implementation of an authorization plugin:
Now, How we can use this option in Sitecore Commerce 9.2, I have been using and extending Solr.Net for more than 4 years now and happy to see that you can extend this within Sitecore. Basically, we can control how Sitecore communicates with Solr by specifying the implementation of the IHttpWebRequestFactory interface of SolrNet that Sitecore uses.
We can specify the implementation by patching the Sitecore.ContentSearch.DefaultSolrConfiguration.config file. 

The factory class for Solr HTTP requests is in the  node.
for example, If we want to support basic authentication for accessing Solr, We must specify the solrHttpWebRequestFactory value in the following way:


solrHttpWebRequestFactory type="HttpWebAdapters.BasicAuthHttpWebRequestFactory, SolrNet">
  USERNAME
  PASSWORD




That's easy right :)

Sitecore XC 9.2-Installation tips and simple steps for resolution.



Sitecore XC 9.2 - Quick installation steps for On-premise

I'm trying to explain an easy way to resolve all possible errors while installing Sitecore XC 9.2, I can promise it's very easy :)

Below is the list of errors (Please ignore the long list, It's easy to resolve them in one go)

• Error 1 SQL72014: .Net SqlClient MERGE statement attempted to UPDATE or DELETE the same row more than once. This happens when a target row 
• Error 2 creating SolrCore 'SC92_xdb': non legacy mode coreNodeName missing {update.autoCreateFields=false}
• Error 3 SQL72018: Database Scoped Credential could not be imported but one or more of these objects exist in your source.
• Error 4 Failed to start service 'Sitecore XConnect Search Indexer - SC92xconnect.dev.local-IndexWorker (SC92xconnect.dev.local-IndexWorker)'.
• Error 5 https://localhost:8993/solr - Unable to connect to the remote server
• Error 6 Install-SitecoreConfiguration : Cannot find path
• Error 7 Related to timeout during the installation.
• Error 8 The service cannot accept control messages at this time. (Exception from HRESULT: 0x80070425)
• Error 9 Cannot bind argument to parameter 'MergeTool' because it is an empty string.
• Error 10 Exception of type 'System.OutOfMemoryException' was thrown at Invoke-CommandTask.ps1:31 char:13
• Error 11 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
• Error 12 The property 'Value' cannot be found on this object. Verify that the property.

Let's start the installation and will cover all solution here:-


First, it's mandatory to set up the Sitecore, Here are the quick steps for that.
Please refer to this document for Sitecore 9.2 

For complete flow, Please check my article here 



Saturday, November 2, 2019

SItecore (SC) and Sitecore experience commerce (SXC) - Databases, Sites and Solr Indexes.

Here are the high-level details for the Sitecore and Sitecore commerce databases, Sites in IIS and Solr indexes.

In my view, It's very important to understand all required/needed backed storage system to understand the data flow.

I have tried to draw a line for Sitecore and Sitecore commerce, In future, if you want to customize/change in DB or Solr Index you should have a complete understanding of that.

As a next step, I will try to explain schema details for all solr indexes and how you can review or change if needed like adding a new custom filter, introducing a new field etc.

Component Diagram


The Sitecore Experience Platform has three search frameworks:


  1. Content Search, which is used by various components primarily to search and index Sitecore items. Sitecore provides you with several options for configuring search results and indexing for content search.
  2. xConnect Search, which is used to search and index experience data.
  3. Commerce Search, which is used to search and index customers and orders.


Reference -  Sitecore documents