C# Class Nop.Services.Catalog.ProductService

Product service
Inheritance: IProductService
Mostrar archivo Open project: jimmy00784/nopCommerce-Linux-Mysql

Public Methods

Method Description
AdjustInventory ( Nop.Core.Domain.Catalog.ProductVariant productVariant, bool decrease, int quantity, string attributesXml ) : void

Adjusts inventory

DeleteCrossSellProduct ( Nop.Core.Domain.Catalog.CrossSellProduct crossSellProduct ) : void

Deletes a cross-sell product

DeleteProduct ( Product product ) : void

Delete a product

DeleteProductPicture ( Nop.Core.Domain.Catalog.ProductPicture productPicture ) : void

Deletes a product picture

DeleteProductVariant ( Nop.Core.Domain.Catalog.ProductVariant productVariant ) : void

Delete a product variant

DeleteRelatedProduct ( Nop.Core.Domain.Catalog.RelatedProduct relatedProduct ) : void

Deletes a related product

DeleteTierPrice ( Nop.Core.Domain.Catalog.TierPrice tierPrice ) : void

Deletes a tier price

GetAllProducts ( bool showHidden = false ) : IList

Gets all products

GetAllProductsDisplayedOnHomePage ( ) : IList

Gets all products displayed on the home page

GetCrossSellProductById ( int crossSellProductId ) : Nop.Core.Domain.Catalog.CrossSellProduct

Gets a cross-sell product

GetCrossSellProductsByProductId1 ( int productId1, bool showHidden = false ) : IList

Gets a cross-sell product collection by product identifier

GetCrosssellProductsByShoppingCart ( IList cart, int numberOfProducts ) : IList

Gets a cross-sells

GetLowStockProductVariants ( ) : IList

Get low stock product variants

GetProductById ( int productId ) : Product

Gets product

GetProductPictureById ( int productPictureId ) : Nop.Core.Domain.Catalog.ProductPicture

Gets a product picture

GetProductPicturesByProductId ( int productId ) : IList

Gets a product pictures by product identifier

GetProductVariantById ( int productVariantId ) : Nop.Core.Domain.Catalog.ProductVariant

Gets a product variant

GetProductVariantBySku ( string sku ) : Nop.Core.Domain.Catalog.ProductVariant

Gets a product variant by SKU

GetProductVariantsByProductId ( int productId, bool showHidden = false ) : IList

Gets product variants by product identifier

GetProductVariantsByProductIds ( int productIds, bool showHidden = false ) : IList

Get product variants by product identifiers

GetProductsByIds ( int productIds ) : IList

Get products by identifiers

GetRelatedProductById ( int relatedProductId ) : Nop.Core.Domain.Catalog.RelatedProduct

Gets a related product

GetRelatedProductsByProductId1 ( int productId1, bool showHidden = false ) : IList

Gets a related product collection by product identifier

GetTierPriceById ( int tierPriceId ) : Nop.Core.Domain.Catalog.TierPrice

Gets a tier price

InsertCrossSellProduct ( Nop.Core.Domain.Catalog.CrossSellProduct crossSellProduct ) : void

Inserts a cross-sell product

InsertProduct ( Product product ) : void

Inserts a product

InsertProductPicture ( Nop.Core.Domain.Catalog.ProductPicture productPicture ) : void

Inserts a product picture

InsertProductVariant ( Nop.Core.Domain.Catalog.ProductVariant productVariant ) : void

Inserts a product variant

InsertRelatedProduct ( Nop.Core.Domain.Catalog.RelatedProduct relatedProduct ) : void

Inserts a related product

InsertTierPrice ( Nop.Core.Domain.Catalog.TierPrice tierPrice ) : void

Inserts a tier price

ProductService ( ICacheManager cacheManager, IRepository productRepository, IRepository productVariantRepository, IRepository relatedProductRepository, IRepository crossSellProductRepository, IRepository tierPriceRepository, IRepository productPictureRepository, IRepository localizedPropertyRepository, IRepository productSpecificationAttributeRepository, IProductAttributeService productAttributeService, IProductAttributeParser productAttributeParser, ILanguageService languageService, IWorkflowMessageService workflowMessageService, IDataProvider dataProvider, IDbContext dbContext, Nop.Core.Domain.Localization.LocalizationSettings localizationSettings, CommonSettings commonSettings, IEventPublisher eventPublisher ) : System

Ctor

SearchProductVariants ( int categoryId, int manufacturerId, string keywords, bool searchDescriptions, int pageIndex, int pageSize, bool showHidden = false ) : IPagedList

Search product variants

SearchProducts ( IList categoryIds, int manufacturerId, bool featuredProducts, decimal priceMin, decimal priceMax, int productTagId, string keywords, bool searchDescriptions, bool searchProductTags, int languageId, IList filteredSpecs, ProductSortingEnum orderBy, int pageIndex, int pageSize, bool loadFilterableSpecificationAttributeOptionIds, IList &filterableSpecificationAttributeOptionIds, bool showHidden = false ) : IPagedList

Search products

SearchProducts ( int categoryId, int manufacturerId, bool featuredProducts, decimal priceMin, decimal priceMax, int productTagId, string keywords, bool searchDescriptions, bool searchProductTags, int languageId, IList filteredSpecs, ProductSortingEnum orderBy, int pageIndex, int pageSize, bool loadFilterableSpecificationAttributeOptionIds, IList &filterableSpecificationAttributeOptionIds, bool showHidden = false ) : IPagedList

Search products

UpdateCrossSellProduct ( Nop.Core.Domain.Catalog.CrossSellProduct crossSellProduct ) : void

Updates a cross-sell product

UpdateHasDiscountsApplied ( Nop.Core.Domain.Catalog.ProductVariant productVariant ) : void

Update HasDiscountsApplied property (used for performance optimization)

UpdateHasTierPricesProperty ( Nop.Core.Domain.Catalog.ProductVariant productVariant ) : void

Update HasTierPrices property (used for performance optimization)

UpdateProduct ( Product product ) : void

Updates the product

UpdateProductPicture ( Nop.Core.Domain.Catalog.ProductPicture productPicture ) : void

Updates a product picture

UpdateProductReviewTotals ( Product product ) : void

Update product review totals

UpdateProductVariant ( Nop.Core.Domain.Catalog.ProductVariant productVariant ) : void

Updates the product variant

UpdateRelatedProduct ( Nop.Core.Domain.Catalog.RelatedProduct relatedProduct ) : void

Updates a related product

UpdateTierPrice ( Nop.Core.Domain.Catalog.TierPrice tierPrice ) : void

Updates the tier price

Method Details

AdjustInventory() public method

Adjusts inventory
public AdjustInventory ( Nop.Core.Domain.Catalog.ProductVariant productVariant, bool decrease, int quantity, string attributesXml ) : void
productVariant Nop.Core.Domain.Catalog.ProductVariant Product variant
decrease bool A value indicating whether to increase or descrease product variant stock quantity
quantity int Quantity
attributesXml string Attributes in XML format
return void

DeleteCrossSellProduct() public method

Deletes a cross-sell product
public DeleteCrossSellProduct ( Nop.Core.Domain.Catalog.CrossSellProduct crossSellProduct ) : void
crossSellProduct Nop.Core.Domain.Catalog.CrossSellProduct Cross-sell identifier
return void

DeleteProduct() public method

Delete a product
public DeleteProduct ( Product product ) : void
product Nop.Core.Domain.Catalog.Product Product
return void

DeleteProductPicture() public method

Deletes a product picture
public DeleteProductPicture ( Nop.Core.Domain.Catalog.ProductPicture productPicture ) : void
productPicture Nop.Core.Domain.Catalog.ProductPicture Product picture
return void

DeleteProductVariant() public method

Delete a product variant
public DeleteProductVariant ( Nop.Core.Domain.Catalog.ProductVariant productVariant ) : void
productVariant Nop.Core.Domain.Catalog.ProductVariant Product variant
return void

DeleteRelatedProduct() public method

Deletes a related product
public DeleteRelatedProduct ( Nop.Core.Domain.Catalog.RelatedProduct relatedProduct ) : void
relatedProduct Nop.Core.Domain.Catalog.RelatedProduct Related product
return void

DeleteTierPrice() public method

Deletes a tier price
public DeleteTierPrice ( Nop.Core.Domain.Catalog.TierPrice tierPrice ) : void
tierPrice Nop.Core.Domain.Catalog.TierPrice Tier price
return void

GetAllProducts() public method

Gets all products
public GetAllProducts ( bool showHidden = false ) : IList
showHidden bool A value indicating whether to show hidden records
return IList

GetAllProductsDisplayedOnHomePage() public method

Gets all products displayed on the home page
public GetAllProductsDisplayedOnHomePage ( ) : IList
return IList

GetCrossSellProductById() public method

Gets a cross-sell product
public GetCrossSellProductById ( int crossSellProductId ) : Nop.Core.Domain.Catalog.CrossSellProduct
crossSellProductId int Cross-sell product identifier
return Nop.Core.Domain.Catalog.CrossSellProduct

GetCrossSellProductsByProductId1() public method

Gets a cross-sell product collection by product identifier
public GetCrossSellProductsByProductId1 ( int productId1, bool showHidden = false ) : IList
productId1 int The first product identifier
showHidden bool A value indicating whether to show hidden records
return IList

GetCrosssellProductsByShoppingCart() public method

Gets a cross-sells
public GetCrosssellProductsByShoppingCart ( IList cart, int numberOfProducts ) : IList
cart IList Shopping cart
numberOfProducts int Number of products to return
return IList

GetLowStockProductVariants() public method

Get low stock product variants
public GetLowStockProductVariants ( ) : IList
return IList

GetProductById() public method

Gets product
public GetProductById ( int productId ) : Product
productId int Product identifier
return Nop.Core.Domain.Catalog.Product

GetProductPictureById() public method

Gets a product picture
public GetProductPictureById ( int productPictureId ) : Nop.Core.Domain.Catalog.ProductPicture
productPictureId int Product picture identifier
return Nop.Core.Domain.Catalog.ProductPicture

GetProductPicturesByProductId() public method

Gets a product pictures by product identifier
public GetProductPicturesByProductId ( int productId ) : IList
productId int The product identifier
return IList

GetProductVariantById() public method

Gets a product variant
public GetProductVariantById ( int productVariantId ) : Nop.Core.Domain.Catalog.ProductVariant
productVariantId int Product variant identifier
return Nop.Core.Domain.Catalog.ProductVariant

GetProductVariantBySku() public method

Gets a product variant by SKU
public GetProductVariantBySku ( string sku ) : Nop.Core.Domain.Catalog.ProductVariant
sku string SKU
return Nop.Core.Domain.Catalog.ProductVariant

GetProductVariantsByProductId() public method

Gets product variants by product identifier
public GetProductVariantsByProductId ( int productId, bool showHidden = false ) : IList
productId int The product identifier
showHidden bool A value indicating whether to show hidden records
return IList

GetProductVariantsByProductIds() public method

Get product variants by product identifiers
public GetProductVariantsByProductIds ( int productIds, bool showHidden = false ) : IList
productIds int Product identifiers
showHidden bool A value indicating whether to show hidden records
return IList

GetProductsByIds() public method

Get products by identifiers
public GetProductsByIds ( int productIds ) : IList
productIds int Product identifiers
return IList

GetRelatedProductById() public method

Gets a related product
public GetRelatedProductById ( int relatedProductId ) : Nop.Core.Domain.Catalog.RelatedProduct
relatedProductId int Related product identifier
return Nop.Core.Domain.Catalog.RelatedProduct

GetRelatedProductsByProductId1() public method

Gets a related product collection by product identifier
public GetRelatedProductsByProductId1 ( int productId1, bool showHidden = false ) : IList
productId1 int The first product identifier
showHidden bool A value indicating whether to show hidden records
return IList

GetTierPriceById() public method

Gets a tier price
public GetTierPriceById ( int tierPriceId ) : Nop.Core.Domain.Catalog.TierPrice
tierPriceId int Tier price identifier
return Nop.Core.Domain.Catalog.TierPrice

InsertCrossSellProduct() public method

Inserts a cross-sell product
public InsertCrossSellProduct ( Nop.Core.Domain.Catalog.CrossSellProduct crossSellProduct ) : void
crossSellProduct Nop.Core.Domain.Catalog.CrossSellProduct Cross-sell product
return void

InsertProduct() public method

Inserts a product
public InsertProduct ( Product product ) : void
product Nop.Core.Domain.Catalog.Product Product
return void

InsertProductPicture() public method

Inserts a product picture
public InsertProductPicture ( Nop.Core.Domain.Catalog.ProductPicture productPicture ) : void
productPicture Nop.Core.Domain.Catalog.ProductPicture Product picture
return void

InsertProductVariant() public method

Inserts a product variant
public InsertProductVariant ( Nop.Core.Domain.Catalog.ProductVariant productVariant ) : void
productVariant Nop.Core.Domain.Catalog.ProductVariant The product variant
return void

InsertRelatedProduct() public method

Inserts a related product
public InsertRelatedProduct ( Nop.Core.Domain.Catalog.RelatedProduct relatedProduct ) : void
relatedProduct Nop.Core.Domain.Catalog.RelatedProduct Related product
return void

InsertTierPrice() public method

Inserts a tier price
public InsertTierPrice ( Nop.Core.Domain.Catalog.TierPrice tierPrice ) : void
tierPrice Nop.Core.Domain.Catalog.TierPrice Tier price
return void

ProductService() public method

Ctor
public ProductService ( ICacheManager cacheManager, IRepository productRepository, IRepository productVariantRepository, IRepository relatedProductRepository, IRepository crossSellProductRepository, IRepository tierPriceRepository, IRepository productPictureRepository, IRepository localizedPropertyRepository, IRepository productSpecificationAttributeRepository, IProductAttributeService productAttributeService, IProductAttributeParser productAttributeParser, ILanguageService languageService, IWorkflowMessageService workflowMessageService, IDataProvider dataProvider, IDbContext dbContext, Nop.Core.Domain.Localization.LocalizationSettings localizationSettings, CommonSettings commonSettings, IEventPublisher eventPublisher ) : System
cacheManager ICacheManager Cache manager
productRepository IRepository Product repository
productVariantRepository IRepository Product variant repository
relatedProductRepository IRepository Related product repository
crossSellProductRepository IRepository Cross-sell product repository
tierPriceRepository IRepository Tier price repository
productPictureRepository IRepository Product picture repository
localizedPropertyRepository IRepository Localized property repository
productSpecificationAttributeRepository IRepository Product specification attribute repository
productAttributeService IProductAttributeService Product attribute service
productAttributeParser IProductAttributeParser Product attribute parser service
languageService ILanguageService Language service
workflowMessageService IWorkflowMessageService Workflow message service
dataProvider IDataProvider Data provider
dbContext IDbContext Database Context
localizationSettings Nop.Core.Domain.Localization.LocalizationSettings Localization settings
commonSettings Nop.Core.Domain.Common.CommonSettings Common settings
eventPublisher IEventPublisher Event published
return System

SearchProductVariants() public method

Search product variants
public SearchProductVariants ( int categoryId, int manufacturerId, string keywords, bool searchDescriptions, int pageIndex, int pageSize, bool showHidden = false ) : IPagedList
categoryId int Category identifier; 0 to load all records
manufacturerId int Manufacturer identifier; 0 to load all records
keywords string Keywords
searchDescriptions bool A value indicating whether to search in descriptions
pageIndex int Page index
pageSize int Page size
showHidden bool A value indicating whether to show hidden records
return IPagedList

SearchProducts() public method

Search products
public SearchProducts ( IList categoryIds, int manufacturerId, bool featuredProducts, decimal priceMin, decimal priceMax, int productTagId, string keywords, bool searchDescriptions, bool searchProductTags, int languageId, IList filteredSpecs, ProductSortingEnum orderBy, int pageIndex, int pageSize, bool loadFilterableSpecificationAttributeOptionIds, IList &filterableSpecificationAttributeOptionIds, bool showHidden = false ) : IPagedList
categoryIds IList Category identifiers
manufacturerId int Manufacturer identifier; 0 to load all records
featuredProducts bool A value indicating whether loaded products are marked as featured (relates only to categories and manufacturers). 0 to load featured products only, 1 to load not featured products only, null to load all products
priceMin decimal Minimum price; null to load all records
priceMax decimal Maximum price; null to load all records
productTagId int Product tag identifier; 0 to load all records
keywords string Keywords
searchDescriptions bool A value indicating whether to search by a specified "keyword" in product descriptions
searchProductTags bool A value indicating whether to search by a specified "keyword" in product tags
languageId int Language identifier
filteredSpecs IList Filtered product specification identifiers
orderBy ProductSortingEnum Order by
pageIndex int Page index
pageSize int Page size
loadFilterableSpecificationAttributeOptionIds bool A value indicating whether we should load the specification attribute option identifiers applied to loaded products (all pages)
filterableSpecificationAttributeOptionIds IList The specification attribute option identifiers applied to loaded products (all pages)
showHidden bool A value indicating whether to show hidden records
return IPagedList

SearchProducts() public method

Search products
public SearchProducts ( int categoryId, int manufacturerId, bool featuredProducts, decimal priceMin, decimal priceMax, int productTagId, string keywords, bool searchDescriptions, bool searchProductTags, int languageId, IList filteredSpecs, ProductSortingEnum orderBy, int pageIndex, int pageSize, bool loadFilterableSpecificationAttributeOptionIds, IList &filterableSpecificationAttributeOptionIds, bool showHidden = false ) : IPagedList
categoryId int Category identifier; 0 to load all records
manufacturerId int Manufacturer identifier; 0 to load all records
featuredProducts bool A value indicating whether loaded products are marked as featured (relates only to categories and manufacturers). 0 to load featured products only, 1 to load not featured products only, null to load all products
priceMin decimal Minimum price; null to load all records
priceMax decimal Maximum price; null to load all records
productTagId int Product tag identifier; 0 to load all records
keywords string Keywords
searchDescriptions bool A value indicating whether to search by a specified "keyword" in product descriptions
searchProductTags bool A value indicating whether to search by a specified "keyword" in product tags
languageId int Language identifier
filteredSpecs IList Filtered product specification identifiers
orderBy ProductSortingEnum Order by
pageIndex int Page index
pageSize int Page size
loadFilterableSpecificationAttributeOptionIds bool A value indicating whether we should load the specification attribute option identifiers applied to loaded products (all pages)
filterableSpecificationAttributeOptionIds IList The specification attribute option identifiers applied to loaded products (all pages)
showHidden bool A value indicating whether to show hidden records
return IPagedList

UpdateCrossSellProduct() public method

Updates a cross-sell product
public UpdateCrossSellProduct ( Nop.Core.Domain.Catalog.CrossSellProduct crossSellProduct ) : void
crossSellProduct Nop.Core.Domain.Catalog.CrossSellProduct Cross-sell product
return void

UpdateHasDiscountsApplied() public method

Update HasDiscountsApplied property (used for performance optimization)
public UpdateHasDiscountsApplied ( Nop.Core.Domain.Catalog.ProductVariant productVariant ) : void
productVariant Nop.Core.Domain.Catalog.ProductVariant Product variant
return void

UpdateHasTierPricesProperty() public method

Update HasTierPrices property (used for performance optimization)
public UpdateHasTierPricesProperty ( Nop.Core.Domain.Catalog.ProductVariant productVariant ) : void
productVariant Nop.Core.Domain.Catalog.ProductVariant Product variant
return void

UpdateProduct() public method

Updates the product
public UpdateProduct ( Product product ) : void
product Nop.Core.Domain.Catalog.Product Product
return void

UpdateProductPicture() public method

Updates a product picture
public UpdateProductPicture ( Nop.Core.Domain.Catalog.ProductPicture productPicture ) : void
productPicture Nop.Core.Domain.Catalog.ProductPicture Product picture
return void

UpdateProductReviewTotals() public method

Update product review totals
public UpdateProductReviewTotals ( Product product ) : void
product Nop.Core.Domain.Catalog.Product Product
return void

UpdateProductVariant() public method

Updates the product variant
public UpdateProductVariant ( Nop.Core.Domain.Catalog.ProductVariant productVariant ) : void
productVariant Nop.Core.Domain.Catalog.ProductVariant The product variant
return void

UpdateRelatedProduct() public method

Updates a related product
public UpdateRelatedProduct ( Nop.Core.Domain.Catalog.RelatedProduct relatedProduct ) : void
relatedProduct Nop.Core.Domain.Catalog.RelatedProduct Related product
return void

UpdateTierPrice() public method

Updates the tier price
public UpdateTierPrice ( Nop.Core.Domain.Catalog.TierPrice tierPrice ) : void
tierPrice Nop.Core.Domain.Catalog.TierPrice Tier price
return void