Ajax Library Guide

This guide describes what can be accessed by way of Aurora's Ajax Library and how.

Using this guide you should be able to start to make use of Aurora's Ajax/RPC methods to make your site more dynamic and responsive.

👍

New Ajax Documentation!

For the latest Ajax documentation, please see the V1 and V2 Ajax sections under the Reference area.

All new and recently adjusted endpoints will now be documented there and all older documentation migrated as time allows.

🚧

This guide is a work in progress and while every effort is made to ensure all methods available are gradually added, there may still be a great many undocumented features in the Aurora Ajax Library.

If you require information regarding any of the Ajax methods described (or not described) here, then please contact your Aurora Commerce Account Manager for more details.

Glossary of Terms

Before we begin, please see the following list of terms used in this document (and throughout the Aurora documentation) to describe different aspects of Aurora and it's systems:

  • Aurora Core: This refers to anything that is common to ALL instances of Aurora and belongs to Aurora Commerce. This includes anything in the Back-end and most scripts driving the Front-end (not the Front-end templates).
  • Aurora Demo: This refers to the globally accessible demonstration website that Aurora Commerce provide and can be found here: https://demo.auroracommerce.com/
  • Back-end: This refers to the administration area of Aurora, which is any Page, Code or System found in or controlled by the "/aurora/" section of your site.
  • Front-end: This refers to the customer facing area of your website, i.e. the website in general, which your customers can see.
  • Templates: These are files (usually HTML, but can also include some images, JavaScript and CSS) that control how your site looks and is structured. Back-end Templates refer to the 'look' of the pages in the '/aurora/' section and belong editing wise to Aurora Commerce while Front-end templates refer to the 'look' of the main customer facing website and editing wise belong to you and your Agency.

Introduction

The Aurora Ajax Library is a collection of logically grouped methods allowing a client to perform common tasks or request common data for use on a website. This is usually used for setting or retrieving data on the fly between page loads while a user views the Front-end.

This document is laid out with the flowing details for each method described (where possible):

  • Permissions Required: Some features in Aurora are only available in the Back-end and even then, only available to user with particular permissions. Where this is the case, this field will describe what permissions are required so that the client making use of said method can be sure to have these issued to it.
  • Method Call: An example of the exact call required to access the Method by URL.

Ajax Structure & Calls

All Ajax methods follow the same structure and can be accessed via the "/ajax/" URL of any Aurora domain. The URL structure for any typical Ajax call is as follows.

/ajax/Ajax_Method_Group/ajaxMethod

Common Method Return Values

find

The find command typically returns an array of items and a few other variables intended to allow you to generate paging and any other related UI when listing items of any kind.

The following fields are found in a range of Ajax interfaces, as noted in each individual Method's documentation.

VariableValuesDescription
more_availableBooleanIf there are more Content Items to be returned after the current record set that were not return due to paging or some other limit, then this will be true. Otherwise it is false.

This is commonly used for deciding whether or not to show the "Next Page" link when listing Content Items.
total_itemsNon-negative IntegerThe total number of Content Items that matched the request made, regardless of any paging or limits in force.

This is commonly used for showing how many results there are matching a particular query/search when paging, e.g. "1-20 of 650" where 650 is the value returned within the total_items variable.
number_of_pagesNon-negative IntegerThe total number of pages of results based on the current settings used for the original request.

This is most useful when simply using the default value for items_per_page, so that your calling script(s) can generate their paging as needed, without the need to know the specifics about the limits in play.