Elements
Pantry Element

Pantry Element

The pantry element allows the client to display the list of products in the user's pantry.

Elements.create(pantry,options)

elements.create('pantry',options?)

|Field|Parameter|Description| |type|pantry|The type of Element being created, which is payment in this case.| |options|Object|Options for creating the Payment Element.|

Option properties

FieldParameterDescription
layoutlist gridSpecify the layout for the Pantry Element. If you only pass a layout type (list or ‘grid) without any additional parameters, the Pantry Element renders using that layout and the default values associated with it.
searchbooleanSearch option is by default turned off in Pantry, you can turn it on by passing true parameter
categoriesarrayBy default, the Pantry Element will use standardized categorization for products bought in user account.You can override the default categorization in which categories are displayed by the needs of your organisation.
outOfStockbooleanDisplays out of stock element which shows what products are soon to be out of stock.
paginationpages load infiniteBy default, the Pantry Element will use infinite load, you can change that by passing values like pages or load.
ItemsObjectPass values like all out_of_stock out_of_date when you want to display different types of products in Pantry Element

Elements.update(options)

Updates the options the Payment Element was initialized with. Updates are merged into the existing configuration.

// Update a Pantry Element after creation
var pantryElement = elements.getElement('pantry');
pantryElement.update({items: “out_of_date”});

Option properties

FieldParameterDescription
layoutlistgrid Specify the layout for the Pantry Element. If you only pass a layout type (list or ‘grid) without any additional parameters, the Pantry Element renders using that layout and the default values associated with it.
searchbooleanSearch option is by default turned off in Pantry, you can turn it on by passing true parameter
categoriesarrayBy default, the Pantry Element will use standardized categorization for products bought in user account.You can override the default categorization in which categories are displayed by the needs of your organisation.
outOfStockbooleanDisplays out of stock element which shows what products are soon to be out of stock.
paginationpages load infiniteBy default, the Pantry Element will use infinite load, you can change that by passing values like pages or load.
ItemsObjectPass values like all out_of_stock out_of_date when you want to display different types of products in Pantry Element