Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

ICategoryService.cs

using Nop.Core;
using Nop.Core.Domain.Catalog;
using Nop.Core.Domain.Customers;
using Nop.Core.Domain.Discounts;

namespace Nop.Services.Catalog;

/// 
/// Category service interface
/// 
public partial interface ICategoryService
{
    /// 
    /// Clean up category references for a specified discount
    /// 
    /// Discount
    /// A task that represents the asynchronous operation
    Task ClearDiscountCategoryMappingAsync(Discount discount);

    /// 
    /// Delete category
    /// 
    /// Category
    /// A task that represents the asynchronous operation
    Task DeleteCategoryAsync(Category category);

    /// 
    /// Gets all categories
    /// 
    /// Store identifier; 0 if you want to get all records
    /// A value indicating whether to show hidden records
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the categories
    /// 
    Task> GetAllCategoriesAsync(int storeId = 0, bool showHidden = false);

    /// 
    /// Gets all categories
    /// 
    /// Category name
    /// Store identifier; 0 if you want to get all records
    /// Page index
    /// Page size
    /// A value indicating whether to show hidden records
    /// 
    /// null - process "Published" property according to "showHidden" parameter
    /// true - load only "Published" products
    /// false - load only "Unpublished" products
    /// 
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the categories
    /// 
    Task> GetAllCategoriesAsync(string categoryName, int storeId = 0,
        int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false, bool? overridePublished = null);

    /// 
    /// Gets all categories filtered by parent category identifier
    /// 
    /// Parent category identifier
    /// A value indicating whether to show hidden records
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the categories
    /// 
    Task> GetAllCategoriesByParentCategoryIdAsync(int parentCategoryId, bool showHidden = false);

    /// 
    /// Gets all categories displayed on the home page
    /// 
    /// A value indicating whether to show hidden records
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the categories
    /// 
    Task> GetAllCategoriesDisplayedOnHomepageAsync(bool showHidden = false);

    /// 
    /// Get category identifiers to which a discount is applied
    /// 
    /// Discount
    /// Customer
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the category identifiers
    /// 
    Task> GetAppliedCategoryIdsAsync(Discount discount, Customer customer);

    /// 
    /// Gets child category identifiers
    /// 
    /// Parent category identifier
    /// Store identifier; 0 if you want to get all records
    /// A value indicating whether to show hidden records
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the category identifiers
    /// 
    Task> GetChildCategoryIdsAsync(int parentCategoryId, int storeId = 0, bool showHidden = false);

    /// 
    /// Gets a category
    /// 
    /// Category identifier
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the category
    /// 
    Task GetCategoryByIdAsync(int categoryId);

    /// 
    /// Get categories for which a discount is applied
    /// 
    /// Discount identifier; pass null to load all records
    /// A value indicating whether to load deleted categories
    /// Page index
    /// Page size
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the list of categories
    /// 
    Task> GetCategoriesByAppliedDiscountAsync(int? discountId = null,
        bool showHidden = false, int pageIndex = 0, int pageSize = int.MaxValue);

    /// 
    /// Inserts category
    /// 
    /// Category
    /// A task that represents the asynchronous operation
    Task InsertCategoryAsync(Category category);

    /// 
    /// Updates the category
    /// 
    /// Category
    /// A task that represents the asynchronous operation
    Task UpdateCategoryAsync(Category category);

    /// 
    /// Delete a list of categories
    /// 
    /// Categories
    /// A task that represents the asynchronous operation
    Task DeleteCategoriesAsync(IList categories);

    /// 
    /// Deletes a product category mapping
    /// 
    /// Product category
    /// A task that represents the asynchronous operation
    Task DeleteProductCategoryAsync(ProductCategory productCategory);

    /// 
    /// Get a discount-category mapping record
    /// 
    /// Category identifier
    /// Discount identifier
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the result
    /// 
    Task GetDiscountAppliedToCategoryAsync(int categoryId, int discountId);

    /// 
    /// Inserts a discount-category mapping record
    /// 
    /// Discount-category mapping
    /// A task that represents the asynchronous operation
    Task InsertDiscountCategoryMappingAsync(DiscountCategoryMapping discountCategoryMapping);

    /// 
    /// Deletes a discount-category mapping record
    /// 
    /// Discount-category mapping
    /// A task that represents the asynchronous operation
    Task DeleteDiscountCategoryMappingAsync(DiscountCategoryMapping discountCategoryMapping);

    /// 
    /// Gets product category mapping collection
    /// 
    /// Category identifier
    /// Page index
    /// Page size
    /// A value indicating whether to show hidden records
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the product a category mapping collection
    /// 
    Task> GetProductCategoriesByCategoryIdAsync(int categoryId,
        int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false);

    /// 
    /// Gets a product category mapping collection
    /// 
    /// Product identifier
    /// A value indicating whether to show hidden records
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the product category mapping collection
    /// 
    Task> GetProductCategoriesByProductIdAsync(int productId, bool showHidden = false);

    /// 
    /// Gets a product category mapping 
    /// 
    /// Product category mapping identifier
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the product category mapping
    /// 
    Task GetProductCategoryByIdAsync(int productCategoryId);

    /// 
    /// Inserts a product category mapping
    /// 
    /// >Product category mapping
    /// A task that represents the asynchronous operation
    Task InsertProductCategoryAsync(ProductCategory productCategory);

    /// 
    /// Updates the product category mapping 
    /// 
    /// >Product category mapping
    /// A task that represents the asynchronous operation
    Task UpdateProductCategoryAsync(ProductCategory productCategory);

    /// 
    /// Returns a list of names of not existing categories
    /// 
    /// The names and/or IDs of the categories to check
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the list of names and/or IDs not existing categories
    /// 
    Task GetNotExistingCategoriesAsync(string[] categoryIdsNames);

    /// 
    /// Get category IDs for products
    /// 
    /// Products IDs
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the category IDs for products
    /// 
    Task> GetProductCategoryIdsAsync(int[] productIds);

    /// 
    /// Gets categories by identifier
    /// 
    /// Category identifiers
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the categories
    /// 
    Task> GetCategoriesByIdsAsync(int[] categoryIds);

    /// 
    /// Returns a ProductCategory that has the specified values
    /// 
    /// Source
    /// Product identifier
    /// Category identifier
    /// A ProductCategory that has the specified values; otherwise null
    ProductCategory FindProductCategory(IList source, int productId, int categoryId);

    /// 
    /// Get formatted category breadcrumb 
    /// Note: ACL and store mapping is ignored
    /// 
    /// Category
    /// All categories
    /// Separator
    /// Language identifier for localization
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the formatted breadcrumb
    /// 
    Task GetFormattedBreadCrumbAsync(Category category, IList allCategories = null,
        string separator = ">>", int languageId = 0);

    /// 
    /// Get category breadcrumb 
    /// 
    /// Category
    /// All categories
    /// A value indicating whether to load hidden records
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the category breadcrumb 
    /// 
    Task> GetCategoryBreadCrumbAsync(Category category, IList allCategories = null, bool showHidden = false);
}