File

projects/congarevenuecloud/elements/src/lib/mini-cart/services/mini-cart.service.ts

Description

Mini Cart Service involves business logic of mini cart component to show lineitems added to cart.

Usage

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

Index

Methods

Constructor

constructor(productConfigurationService: ProductConfigurationService, revalidateCartService: RevalidateCartService, cartItemService: CartItemService)
Parameters :
Name Type Optional
productConfigurationService ProductConfigurationService No
revalidateCartService RevalidateCartService No
cartItemService CartItemService No

Methods

checkForAmend
checkForAmend(item: CartItem)

This method checks if the given cart item can be Amended

Parameters :
Name Type Optional Description
item CartItem No

The cart item to check for Amended line status.

Returns : boolean

True if the item can be Amended, false otherwise.

checkForRenew
checkForRenew(item: CartItem)

This method checks if the given cart item can be Renewed

Parameters :
Name Type Optional Description
item CartItem No

The cart item to check for Renewed line status.

Returns : boolean

True if the item can be Renewed, false otherwise.

disableAction
disableAction()

Method by default returns false. But it returns true to disable cart actions on mini cart when configuring new product in product detail page.

Returns : Observable<boolean>

observable of boolean value.

getCartRevalidationFlag
getCartRevalidationFlag()

Method return the state of the revalidateFlag.If the value is true the revalidation message will be shown on the mini cart.

Returns : Observable<boolean>

observable of boolean value.

results matching ""

    No results matching ""