Store Recent Products API

The Store Recent Products API allows you to pull in products that have been recently published into different parts of the website.


Minimum Tag
{ap_api:store:recentProducts templateId="1"}

Example Tags

{ap_api:store:recentProducts templateId="1" limit="5" random="yes"}
This will return 5 products in a random display order.

{ap_api:store:recentProducts templateId="1" sort[productName]="asc" limit="10"}
This will return 10 products sorted by published date first and then in ascending order (A - Z) by their product names.

Tag Parameters

ParameterDescription
allInstances Type: String
Description: Whether or not to query accross all instances of this app.
Accepted values: true, false, 1, 0, yes, no
Default Value: false
Example: allInstances="true"
attr Type: Array
Description: List of attribute layout keys and the values that the filter should match.
Example: attr[layoutKey]="value"
categoryId Type: Integer
Description: The ID of a single category to get products for
Example: categoryId="3"
keys Type: String
Description: Comma separated list of layout keys that will be used to only return that data.
Example: keys="layoutKey1, layoutKey2"
instanceKey Type: String
Description: The key for the instance to get results in. If nothing is passed then the current instance will be used if this is called within the same app.
Example: instanceKey="appInstanceKey"
limit Type: Integer
Description: The number of results to return. Defaults to return all matching results (no limit).
Example: limit="5"
match Type: String
Description: Whether or not to match all conditions or any of the conditions. 'any' or 'all'. Defaults to 'all'.
Example: match="any"
responseFormat Type: String
Description: Sets how the API response will be returned.
Accepted Values:
template - The default value. This tells the system to use a Content Template to build the API response.
ui - This is used if the data from the API call will used in the administration as a UI form component.  A Content Template will be used to structure the data correctly to build the form component HTML.
Example: responseFormat="ui"
sort Type: Array
Description: Array of layout keys and the direction to sort those keys. If this is not used then sortDirection and sortKey will be used * if they are set.
asc = Ascending order (A - Z or 1 - 10)
desc = Descending order (Z - A or 10 - 1)
Example: sort[layoutKey]='asc' sort[layoutKey2]='desc'
startAt Type: Integer
Description: Where to start in the results. Defaults to 0.
Example: startAt="2"
templateId Type: Integer
Description: Required if responseFormat is not 'data'. The id of the content template to use. If this is not passed when it's required then nothing will be returned.
Example: templateId="3"
unique Type: String
Description: Specifies whether or not the result should have unique values. This is really only useful if one layout key is returned for each item. Accepted values: true, false, 1, 0, yes, no
Example: unique="yes"


/layouts/branch-code