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
Field | Parameter | Description |
---|---|---|
layout | list grid | 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. |
search | boolean | Search option is by default turned off in Pantry, you can turn it on by passing true parameter |
categories | array | By 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. |
outOfStock | boolean | Displays out of stock element which shows what products are soon to be out of stock. |
pagination | pages load infinite | By default, the Pantry Element will use infinite load, you can change that by passing values like pages or load. |
Items | Object | Pass 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
Field | Parameter | Description |
---|---|---|
layout | list | grid 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. |
search | boolean | Search option is by default turned off in Pantry, you can turn it on by passing true parameter |
categories | array | By 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. |
outOfStock | boolean | Displays out of stock element which shows what products are soon to be out of stock. |
pagination | pages load infinite | By default, the Pantry Element will use infinite load, you can change that by passing values like pages or load. |
Items | Object | Pass values like all out_of_stock out_of_date when you want to display different types of products in Pantry Element |