Documentation

Ucommerce includes full API reference documentation and lots of helpful articles to help you build your e-commerce site as effortlessly as possible.

Topics Payment Providers
v7.18

Catalog Library

The catalog Library is a friendly way of allowing you to grab the information you need in order to display catalog items in your webshop. You can either ask for something explicitly or you can have it resolve the data on it's own by leaving the optional parameters alone.

The Catalog library can be accessed under the following namespace:

    using Ucommerce.Api;

To resolve it use the following method or constructor inject the interface directly in your controller or web API route (requires you manually bridge the IOC with the MVC framework):

    
    var catalogLibrary = Ucommerce.Infrastructure.ObjectFactory.Instance.Resolve<Ucommerce.Api.ICatalogLibrary>();
    
    

Ucommerce.Api.ICatalogLibrary

Methods


GetCatalog

  • Description
    Gets the catalog in the current context.
  • Arguments
    • Guid? catalogId = null: If it is provided, it will look for the catalog with that specific Id
  • Return type Ucommerce.Search.Models.ProductCatalog

GetRootCategories

  • Description
    Gets the categories without a parent from the current context(cref).
  • Arguments
    • Guid? catalogId = null: If the catalog Id is passed in, it will return the root categories in the provided catalog
    • uint skip = 0: Skips over the first x values in the query result. Default: 0
    • uint take = 300: Takes x values from the query result. Default: 300
  • Return type Ucommerce.Search.ResultSet<Ucommerce.Search.Models.Category>

GetCategory

  • Description
    Gets the current category in the current catalog context.
  • Arguments
    • Guid? categoryId = null: If provided, will search for a specific category in the search index
  • Return type Ucommerce.Search.Models.Category

GetCategories

  • Description
    Gets categories based on the list of category guids passed
  • Arguments
    • IList<Guid> categoryIds: Provide a list of guids to get categories from the search index
    • uint skip = 0: Skips over the first x values in the query result. Default: 0
    • uint take = 300: Takes x values from the query result. Default: 300
  • Return type Ucommerce.Search.ResultSet<Ucommerce.Search.Models.Category>

GetProducts

  • Description
    Gets products in the current category.
  • Arguments
    • Guid? categoryId = null: If provided, will search for products in the specific category in the search index
    • uint skip = 0: Skips over the first x values in the query result. Default: 0
    • uint take = 300: Takes x values from the query result. Default: 300
  • Return type Ucommerce.Search.ResultSet<Ucommerce.Search.Models.Product>

GetProduct

  • Description
    Gets either a product with no variants or a product family. Does not get variants
  • Arguments
    • string sku: Product identifier
  • Return type Ucommerce.Search.Models.Product

CalculatePrices

  • Description
    Gives a list of prices for the products based on product and price group parameters.
  • Arguments
    • IList<Guid> productGuids: Provide a list of product ids to get their prices
    • IList<Guid> priceGroupGuids = null: If not provided, will default to the one on the current catalog
  • Return type Ucommerce.Catalog.Models.ProductPriceCalculationResult

ChangePriceGroup

  • Description
    Changes the current price group that is stored as a cookie
  • Arguments
    • Guid priceGroupGuid: Provide the price group you want to change to
    • Boolean changeBasketBillingCurrency = True: Will change the currency on the basket by default. If products do not have corresponding prices, they will be removed.
  • Return type Void

GetVariants

  • Description
    Gets variants of the product
  • Arguments
    • Ucommerce.Search.Models.Product product: Product that provides the variants
  • Return type Ucommerce.Search.ResultSet<Ucommerce.Search.Models.Product>

GetProducts

  • Description
    Queries products based on categories and search parameters.
  • Arguments
    • IList<Guid> categoryIds: Categories that contain the products
    • Ucommerce.Search.Facets.FacetDictionary facets: Dictionary list of facets
    • uint skip = 0
    • uint take = 300
  • Return type Ucommerce.Search.Facets.FacetResultSet<Ucommerce.Search.Models.Product>

GetProducts

  • Description
    Queries products based on a category and search parameters.
  • Arguments
    • Guid categoryId: Category that contains the products
    • Ucommerce.Search.Facets.FacetDictionary facets: Dictionary list of facets
    • uint skip = 0: Skips over the first x values in the query result. Default: 0
    • uint take = 300: Takes x values from the query result. Default: 300
  • Return type Ucommerce.Search.Facets.FacetResultSet<Ucommerce.Search.Models.Product>

GetFacets

  • Description
    Gets facets based on category and search parameters. Only use this implementation if you are on a category page with only one list of products
  • Arguments
    • Guid categoryId: Category that provides the products
    • Ucommerce.Search.Facets.FacetDictionary facets: Dictionary list of facets
    • uint skip = 0: Skips over the first x values in the query result. Default: 0
    • uint take = 300: Takes x values from the query result. Default: 300
  • Return type IList<Ucommerce.Search.Facets.Facet>

GetFacets

  • Description
    Gets facets based on categories and search parameters.
  • Arguments
    • IList<Guid> categoryIds: Categories that provides the products
    • Ucommerce.Search.Facets.FacetDictionary facets: Dictionary list of facets
    • uint skip = 0: Skips over the first x values in the query result. Default: 0
    • uint take = 300: Takes x values from the query result. Default: 300
  • Return type IList<Ucommerce.Search.Facets.Facet>