GitHub

DaffCartStorageService

Service

import { DaffCartStorageService } from '@daffodil/cart'

The DaffCartStorageService is responsible for storing the cart id of a customer in storage when necessary. For some ecommerce platforms, where cart information is stored in a cookie instead of storage accessible via javsacript, this service isn't explicitly necessary, so be sure to use this service only in the driver layer for platforms that require it.

@Injectable()
class DaffCartStorageService {
  getCartId(): string
  setCartId(value: string): void
  removeCartId(): void
}

() Methods

getCartId
string

Retrieves the cart ID from storage.

setCartId
void

Stores the cart ID in storage.

Parameters
Parametervalue: string
Description
removeCartId
void

Removes the cart ID from storage.