File

projects/congarevenuecloud/ecommerce/src/lib/modules/catalog/services/product-information.service.ts

Description

The Product Information service is a way to find the attachments associated with a product

Usage

Example :
import { ProductInformationService, AObjectService } from '@congarevenuecloud/ecommerce';
constructor(private productInformationService: ProductInformationService) {
// or
export class MyService extends AObjectService {
private productInformationService: ProductInformationService = this.injector.get(ProductInformationService);
}

Extends

AObjectService

Index

Properties
Methods

Methods

Public downloadProductAttachment
downloadProductAttachment(attachmentUrl: string)

Method is used to download the attachement of product.

Example:

Example :
import { ProductInformationService, ProductInformation } from '@congarevenuecloud/ecommerce';

export class MyComponent implements OnInit{

constructor(private productInformationService: ProductInformationService){}

downloadProductAttachment(attachmentUrl: string){
this.productInformationService.downloadProductAttachment(attachmentUrl);
}
}

/** To download the attachment using the provided attachment URL.

Parameters :
Name Type Optional Description
attachmentUrl string No

The URL of the product attachment to be downloaded.

Returns : void
Public getAttachmentUrl
getAttachmentUrl(attachmentId: string)

Method is used to retrieve the URL for downloading an attachment based on the provided attachment ID..

Example:

Example :
import { ProductInformationService } from '@congarevenuecloud/ecommerce';
import { Observable } from 'rxjs/Observable';

export class MyComponent implements OnInit{
getUrl: string;

constructor(private productInformationService ProductInformationService){}

getAttachmentUrl(attachmentId: string){
this.fetUrl = this.productInformationService.getAttachmentUrl(attachmentId, productId);
}
}
Parameters :
Name Type Optional Description
attachmentId string No

The ID of the attachment to retrieve the URL for.

Returns : Observable<string>

An Observable that emits the URL as a string.

Public getProductInformation
getProductInformation(productId: string, memoizeOptions: MemoizeOptions)
Decorators :
@MemoizeWithHash()

Method is used to retrieve the list of production information items with attachments for a given product.

Example:

Example :
import { ProductInformationService, ProductInformation } from '@congarevenuecloud/ecommerce';
import { Observable } from 'rxjs/Observable';

export class MyComponent implements OnInit{
productInformationValue$: Observable<ProductInformation>;
productInformationValue: ProductInformation;

constructor(private productInformationValueService ProductInformationValueService){}

getProductInformation(productId: string){
this.productInformationService.getProductInformation(productId).subscribe(a => this.productInformationValue = a);
// or
this.productInformationValue$ = this.productInformationService.getProductInformation(productId);
}
}
Parameters :
Name Type Optional Default value Description
productId string No

string identifier representing the product to return the product information for.

memoizeOptions MemoizeOptions No null

an optional parameter to specify memoization options using MemoizeOptions interface. Defaults to null.

Returns : Observable<ProductInformation[]>

an observable containing the product information details for the given product.

Properties

type
Default value : ProductInformation

results matching ""

    No results matching ""