Every CXA Module - Foundation Common

6/21/2020 CXA Sitecore Sitecore Commerce Foundation Common Commerce Engine

It is the foundation of the foundation layer agnostic to the rest of the site and what your are building

OMG look how many ppl have commented

The basic design of the Helix architecture is that it is built upon layers - the project layer sits on the feature layer which sits on the foundation layer. With the project and feature layers unable to reference one another (one project layer item cannot reference another project layer and a feature cannot reference another feature), the foundation is the only layer where modules can reference one another. 

Because of this design concept, layers within the foundation begin to develop creating a "meta-layer." And within this meta-layer, sits the core of it all - the Common Foundation project. It is the foundation of the foundation layer agnostic to the rest of the site and what your are building (and it is intended that way). It contains the basic building blocks and helper classes for the other Foundation and Feature layers to reference.

When you are creating your one CXA Storefront site, it would be wise to create your own Common project to put your basic building blocks for the rest of your site to reference from. However, one takeaway I must give you is to not make this project a dumping ground for random items.

This module contains (but not limited to)...

  • String Constants to use throughout your site such as (but not limited to):
    • Item Cache Keys
    • Configuration Field Names
    • Api Routes
    • Base Sitecore Data Template IDs
  • Common Attributes you may use in your development process such as RequireLogin, StorefrontSessionState, or ValidateHttpPostHandler
  • SiteContext
    • You will defiantly use this one. This class enables you to get the current catalog item (as in, if you are developing a module for the product page, you would call SiteContext.CurrentCatalogItem to get the product). This works with Product Items and Categories
  • StorefrontContext
    • This is another big one you will likely use. Here, you can get the CurrentStorefrontSite to get basic configuration information you setup in your site such as pricing, allowed languages, currency and such
  • StorefrontControllerFactory
  • BaseCommerceStandardController
    • Used to inherit from in your own custom commerce controller
  • Basic Exceptions
  • Extension Methods
  • BaseCommerceRenderingModel
  • BaseCommerceModelRepository
    • Use this to inherit from in your own custom model repository. The model repository is used to create an instance of your CXA model
  • Search Helpers

References

  • Sitecore.Commerce.Connect.Core
  • Sitecore.XA.Foundation.Multisite
  • Sitecore.XA.Feature.CreativeExchange
  • Sitecore.XA.Foundation.SitecoreExtensions
  • Sitecore.XA.Foundation.Search
  • Sitecore.Commerce.Engine.Connect.Caching
  • Sitecore.ContentSearch.Linq
  • Sitecore.Commerce.Engine.Connect
  • Sitecore.XA.Foundation.Mvc
  • Sitecore.XA.Foundation.RenderingVariants
  • Sitecore.XA.Foundation.Variants.Abstractions
  • Sitecore.ContentSearch
  • Sitecore.Mvc
  • Sitecore.XA.Foundation.Theming

Referenced by

  • Sitecore.Commerce.XA.Foundation.SiteMetadata
  • Sitecore.Commerce.XA.Foundation.Scafolding
  • Sitecore.Commerce.XA.Foundation.Connect
  • Sitecore.Commerce.XA.Foundation.Catalog
  • Sitecore.Commerce.XA.Feature.TopBarLinks
  • Sitecore.Commerce.XA.Feature.SearchBar
  • Sitecore.Commerce.XA.Feature.MessageSummary
  • Sitecore.Commerce.XA.Feature.LanguageSelection
  • Sitecore.Commerce.XA.Feature.Emails
  • Sitecore.Commerce.XA.Feature.CategoryNavigation
  • Sitecore.Commerce.XA.Feature.Catalog
  • Sitecore.Commerce.XA.Feature.Cart
  • Sitecore.Commerce.XA.Feature.Account