Search.../

queryCheckoutTemplates( )

Developer Preview

Creates a query to retrieve a list of checkout templates.

Description

The queryCheckoutTemplates() function builds a query to retrieve a list of checkout templates and returns a CheckoutTemplatesQueryBuilder object.

The returned object contains the query definition, which is typically used to run the query using the find() function.

You can refine the query by chaining CheckoutTemplatesQueryBuilder functions onto the query. CheckoutTemplatesQueryBuilder functions enable you to sort, filter, and control the results that queryCheckoutTemplates() returns.

queryCheckoutTemplates() runs with the following CheckoutTemplatesQueryBuilder default that you can override:

  • ascending("_id")

The functions that are chained to queryCheckoutTemplates() are applied in the order they are called. For example, if you apply ascending("status") and then ascending("_id"), the results are sorted first by the "status", and then, if there are multiple results with the same "status", the items are sorted by "_id".

The following CheckoutTemplatesQueryBuilder functions are supported for the queryCheckoutTemplates() function. For a full description of the checkout template object, see the object returned for the items property in CheckoutTemplatesQueryResult.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),exists(),in(),hasSome(),startsWith(),ascending(),descending()
statuseq(),ne(),exists(),in(),hasSome(),ascending(),descending()
Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function queryCheckoutTemplates(): CheckoutTemplatesQueryBuilder

queryCheckoutTemplates Parameters

This function does not take any parameters.

Was this helpful?

queryCheckoutTemplates example

Copy Code
1import { checkoutTemplates } from 'wix-ecom-backend';
2
3 async function queryCheckoutTemplates() {
4 const { items } = checkoutTemplates.queryCheckoutTemplates().find();
5 }
6