Get product from DB and API/ERP



DB
var loadOptions = ObjectFactory.Create<IProductLoadOptions>();
 var product = CommerceFrameworkBase.Products.GetProduct(line.ProductId, options);



API
var product = ShopApi.Catalog.GetProduct(line.ProductId);



DB
protected virtual IList<IProduct> GetProducts(IList<string> productIds)
        {
            var options = CreateLoadOptions();
            return CommerceFrameworkBase.Products.GetProductsByIdList(productIds, options);
        }

        /// <summary>
        /// Creates the load options for getting products' general info.
        /// </summary>
        /// <returns>Load options.</returns>
        protected virtual IProductLoadOptions CreateLoadOptions()
        {
            var loadOptions = ObjectFactory.Create<IProductLoadOptions>();
            loadOptions.LoadRelatedSkus = true;
            loadOptions.VisibleOnly = false;
            loadOptions.CalculateInventory = false;
            loadOptions.CalculatePrices = false;
            loadOptions.CalculateSkuInventory = false;
            loadOptions.CalculateSkuPrices = false;
            loadOptions.LoadImages = false;
            return loadOptions;
        }