ShippingProfileService
Provides layer to manipulate profiles.
Implements
Properties
__configModule__Record<string, unknown>__container__anyRequired__moduleDeclaration__Record<string, unknown>manager_EntityManagerRequiredproductRepository_Repository<Product> & { _applyCategoriesQuery: Method _applyCategoriesQuery ; _findWithRelations: Method _findWithRelations ; bulkAddToCollection: Method bulkAddToCollection ; bulkRemoveFromCollection: Method bulkRemoveFromCollection ; findOneWithRelations: Method findOneWithRelations ; findWithRelations: Method findWithRelations ; findWithRelationsAndCount: Method findWithRelationsAndCount ; getCategoryIdsFromInput: Method getCategoryIdsFromInput ; getCategoryIdsRecursively: Method getCategoryIdsRecursively ; getFreeTextSearchResultsAndCount: Method getFreeTextSearchResultsAndCount ; isProductInSalesChannels: Method isProductInSalesChannels ; queryProducts: Method queryProducts ; queryProductsWithIds: Method queryProductsWithIds }RequiredshippingProfileRepository_Repository<ShippingProfile> & { findByProducts: Method findByProducts }RequiredtransactionManager_undefined | EntityManagerRequiredAccessors
activeManager_
Returns
EntityManagerEntityManagerRequiredMethods
addProduct
Parameters
profileIdstringRequiredproductIdstring | string[]RequiredReturns
Deprecated
use addProducts instead
addProducts
Adds a product or an array of products to the profile.
Parameters
profileIdstringRequiredproductIdstring | string[]RequiredReturns
addShippingOption
Adds a shipping option to the profile. The shipping option can be used to fulfill the products in the products field.
Parameters
profileIdstringRequiredoptionIdstring | string[]RequiredReturns
atomicPhase_
Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created.
Parameters
work(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>Returns
PromisePromise<TResult>Requiredcreate
Creates a new shipping profile.
Parameters
Returns
createDefault
Creates a default shipping profile, if this does not already exist.
Returns
createGiftCardDefault
Creates a default shipping profile, for gift cards if unless it already exists.
Returns
delete
Deletes a profile with a given profile id.
Parameters
profileIdstringRequiredReturns
PromisePromise<void>RequiredfetchCartOptions
Finds all the shipping profiles that cover the products in a cart, and validates all options that are available for the cart.
Parameters
cartanyRequiredReturns
getMapProfileIdsByProductIds
Parameters
productIdsstring[]RequiredReturns
PromisePromise<Map<string, string>>RequiredgetProfilesInCart
Returns a list of all the productIds in the cart.
Parameters
Returns
PromisePromise<string[]>Requiredlist
Parameters
selectorSelector<ShippingProfile>configFindConfig<ShippingProfile>Returns
removeProducts
Removes a product or an array of products from the profile.
Parameters
profileIdnull | stringRequiredproductIdstring | string[]RequiredReturns
retrieve
Gets a profile by id. Throws in case of DB Error and if profile was not found.
Parameters
profileIdstringRequiredoptionsFindConfig<ShippingProfile>Returns
retrieveDefault
Returns
retrieveForProducts
Parameters
productIdsstring | string[]RequiredReturns
retrieveGiftCardDefault
Retrieves the default gift card profile
Returns
shouldRetryTransaction_
Parameters
errRecord<string, unknown> | { code: string }RequiredReturns
booleanbooleanupdate
Updates a profile. Metadata updates and product updates should use
dedicated methods, e.g. setMetadata, addProduct, etc. The function
will throw errors if metadata or product updates are attempted.
Parameters
profileIdstringRequired