projects/congarevenuecloud/ecommerce/src/lib/modules/catalog/services/product.service.ts
Products are the goods for buy/sell with its detailed information. The service provides methods for interacting with the products.
import { ProductService, AObjectService } from '@congarevenuecloud/ecommerce';
constructor(private productService: ProductService) {}
// or
export class MyService extends AObjectService {
private productService: ProductService = this.injector.get(ProductService);
}
AObjectService
Properties |
|
Methods |
fetch | |||||||||||||||||||||||||
fetch(id: string, memoizeOptions: MemoizeOptions, relatedRecords: string, additionalQueryParams: QueryParams)
|
|||||||||||||||||||||||||
Decorators :
@MemoizeWithHash()
|
|||||||||||||||||||||||||
This method can be used to get the fetch the product details for a given product identifier. It will return all the configurations of a bundle including option and attribute groups. For bundle products it will return upto 6 level option group configurations. Example:Example :
Parameters :
Returns :
Observable<AObject>
Observable |
getFieldPickList | ||||||||||
getFieldPickList(fieldName: string)
|
||||||||||
This method returns the picklist values for a given field from product object. Example:Example :
Parameters :
Returns :
Observable<Array<string>>
observable containing list of string picklist values. |
getProductAggregate | ||||||||||||||||||||
getProductAggregate(aggregateFields?: Array<AggregateFields>, queryFields: Array
|
||||||||||||||||||||
Parameters :
Returns :
Observable<AggregateResultSet>
|
getProducts | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
getProducts(categories: Array
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Decorators :
@MemoizeWithHash()
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This method can be used to get the fetch the list of ProductResults including total product count, for a given price list and category. Example:Example :
Parameters :
Returns :
Observable<ProductResult>
Observable<Array |
getProductsByCode | ||||||||
getProductsByCode(productCodeList: Array
|
||||||||
This method can be used to fetch the list of products by product code. Example:Example :
Parameters :
Returns :
Observable<Array<Product>>
observable list of product records macthing the product codes. |
getProductsById | ||||||||
getProductsById(productIds: Array
|
||||||||
This method can be used to fetch the list of products by product Ids. Example:Example :
Parameters :
Returns :
Observable<Array<Product>>
returns an observable list of product records matching the product identifiers. |
getProductsWithFeatureValues | |||||||||||||||
getProductsWithFeatureValues(productList: Array<Product> | Array<string>, memoizeOptions: MemoizeOptions)
|
|||||||||||||||
Decorators :
@MemoizeWithHash()
|
|||||||||||||||
This method is responsible for fetching the product details with feature values for a given set of products. Example:Example :
Parameters :
Returns :
Observable<Array<Product>>
Observable<Array |
Static getValue | ||||
getValue(key)
|
||||
The Static method fetches the values from the local storage. Example:Example :
Parameters :
Returns :
string
|
publish | ||||||
publish(pagestates: PreviousState)
|
||||||
This method records the prevoius state of the catalog page and updates the state. Example:Example :
Parameters :
Returns :
void
|
searchProducts | |||||||||||||||||||||||||
searchProducts(searchString: string, limit: number, fetchTranslations: boolean, memoizeOptions: MemoizeOptions)
|
|||||||||||||||||||||||||
Decorators :
@MemoizeWithHash()
|
|||||||||||||||||||||||||
This method is used to search products by search string ###Example : Example :
Parameters :
Returns :
Observable<Array<Product>>
returns an observable list of product records matching the search string. |
Static setValue |
setValue(key: string, pageValue: string)
|
The Static method updates the values such as page size, view etc in local storage. Example:Example :
Returns :
void
|
Protected accountService |
Default value : this.injector.get(AccountService)
|
Protected assetService |
Type : AssetService
|
Default value : this.injector.get(AssetService)
|
Protected categoryService |
Type : CategoryService
|
Default value : this.injector.get(CategoryService)
|
eventback |
Type : BehaviorSubject<boolean>
|
Default value : new BehaviorSubject(false)
|
isDetailsPage |
Type : BehaviorSubject<boolean>
|
Default value : new BehaviorSubject<boolean>(false)
|
Protected pliService |
Type : PriceListItemService
|
Default value : this.injector.get(PriceListItemService)
|
Protected plService |
Type : PriceListService
|
Default value : this.injector.get(PriceListService)
|
Protected productCategoryService |
Default value : this.injector.get(ProductCategoryService, 'productCategoryService')
|
Protected queryParamsHandlerService |
Default value : this.injector.get(QueryParamsHandlerService)
|
state |
Type : BehaviorSubject<PreviousState>
|
Default value : new BehaviorSubject<PreviousState>(null)
|
Protected translatorService |
Type : TranslatorLoaderService
|
Default value : this.injector.get(TranslatorLoaderService)
|
type |
Default value : Product
|
Protected userService |
Type : UserService
|
Default value : this.injector.get(UserService)
|