Ajax Products
This section describes all the methods available within the "Products" family of Ajax methods. From these methods you can access product data in a variety of formats.
Ajax Method Group: Ajax_Products
search
Overview
Permission Required: None
Method Call: /ajax/Ajax_Products/search
Aurora Demo Example URL: https://demo.auroracommerce.com/clothes/
Aurora Demo Example JavaScript:
- templates/example.com/_js/product_list_filters.js
- templates/example.com/_js/product_list_filters_sliders.js
The Product Search allows you to request a list of products matching a range of supported Filters (as configured in the Aurora Back-end).
Method Description
Request Parameters
Parameter | Values | Description | Required |
---|---|---|---|
path | String URL Path | The URL Path to be used for filtering the product to be returned. This is where the bulk of the important information is passed, such as the category you are requesting, what filters are applied and if a search is being performed. | Yes |
products_only | 1 or 0 | If this value is set to 1 (one) then the filter information will be excluded from the return data. | No |
current_nav_item | String | This is the abbreviation of the Filter currently being selected/modified. This is sometimes used by Aurora to help decide what filter values should be returned along side the products for further filtering/refinement. | No |
order_by | Integer | This must be one of the pre-configured integer 'Order By' values as configured in the Aurora Back-end under Merchandising > Settings > Sort Order. | No |
page_number | Integer | The number of the page of results to be returned. | No |
items_per_page | Integer | The number of products per page of results to be returned. | No |
view_type | grid or list | This controls which template in the Front-end Templates directory is used, namely "products/listings-grid.tpl.html" or "products/listings-list.tpl.html". | No |
lang | Language ISO String | This can be provided as any of the configured Language ISO strings, as set in the Aurora back-end, e.g. "EN-GB". | No |
Response Variables
Variable | Values | Description | products_only? |
---|---|---|---|
filters | Array | No | |
product_list | String HTML | Yes | |
paging | Array | A Container holding the paging Information. | Yes |
paging.numbers | String | The paging HTML listing the available pages. | Yes |
paging.info | String | A short text description of the current page, e.g. "20-60 of 300". | Yes |
pathURL | String URL | The new and 'clean' URL for the products requested. | Yes |
price_data | Array | A Container holding the legacy Price Filter Slider information. | No |
price_data.min_price | Float | The minimum price that can be applied as a filter to the current selection of products (i.e. the cheapest product that can be found). | No |
price_data.max_price | Float | The maximum price that can be applied as a filter to the current selection of products (i.e. the most expensive product that can be found). | No |
price_data.selected_min_price | Float | The currently selected minimum price. | No |
price_data.selected_min_price | Float | The currently selected maximum price. | No |
slider_data | Array | A Container holding the Filter Slider information (min and max values). This array uses an associative array index to describe which filter each set of data is describing. | No |
slider_data.size slider_data.price slider_data.etc | Array | This is just one example, but there will be one entry in the array for each Slider in use | No |
slider_data.etc.min_value | Float | The minimum value that can be applied as a filter to the current selection of products for the filter in question. | No |
slider_data.etc.max_value | Float | The maximum value that can be applied as a filter to the current selection of products for the filter in question. | No |
slider_data.etc.min_value_selected | Float | The currently selected minimum value for the filter in question. | No |
slider_data.etc.max_value_selected | Float | The currently selected maximum value for the filter in question. | No |
breadcrumbs | String | The new breadcrumb HTML for the products requested. | No |
page_title | String | The new Page Title HTML for the products requested. | Yes |
meta_title | String | The new Page Meta Title for the products requested. | Yes |
category_counts | Array | An Indexed array of Category IDs (the index) and Product Counts (the value) to describe how many products have been found in each of the product categories matching the requests parameters. | No |
filter_header | Array | A Container holding the Filter Header information if there is any configured for the filters being applied. | No |
filter_header.header | String | The HTML code set to be used for the header of product lists requesting the applied filter combination. | No |
filter_header.footer | String | The HTML code set to be used for the footer of product lists requesting the applied filter combination. | No |
getProduct
Overview
Permission Required: None
Method Call: /ajax/Ajax_Products/getProduct
Aurora Demo Example URL: https://demo.auroracommerce.com/clothes/
Aurora Demo Example JavaScript:
- templates/example.com/_js/product_list.js
The Product Get method allows you to request details of any published product.
Method Description
Request Parameters
Parameter | Values | Description | Required |
---|---|---|---|
id | Integer | The Internal ID Aurora uses to identify a Product. | Yes |
image_width | Integer | The desired maximum height to return the product images in (image_url & image_url_atl). | No |
image_height | Integer | The desired maximum width to return the product images in (image_url & image_url_atl). | No |
Response Variables
Variable | Values | Currency | Description |
---|---|---|---|
product | Container | Holds all the Product details. | |
product.id | Integer | The Internal ID Aurora uses to identify a Product Category. | |
product.display_date_created | String | A string representation of the date the product was created, e.g. 30th May 2012. This date format cannot presently be customised. | |
product.product_reference | String | The Product Reference value (usually an SKU) configured for the product being requested. | |
product.product_filename | String | The product's URL safe 'filename'. The product 'filename' can be used to build a direct URL to the product's details page. Simply add the filename to the site's domain name. | |
product.product_name | String | The language sensitive name of the Product. | |
product.product_price | Float | Selected | The raw numeric price for the 'main' product. If the product has variations, this price will usually be set to that of the cheapest available variation. |
product.display_product_price | Float | Selected | The 'display' price is the price including any necessary currency formatting for display, e.g. currency symbols. |
product.product_price_rrp | String | Selected | The raw numeric recommended retail price for the 'main' product. |
product.display_product_price_rrp | String | Selected | The 'display' RRP is the RRP including any necessary currency formatting for display, e.g. currency symbols. |
product.product_ean | String | The EAN set for the product. | |
product.product_upc | String | The UPC set for the product. | |
product.product_stock | Integer | The total stock available for the product. If the product has variations, this will be the total stock of all active variations. | |
product.product_stock_status | instock | preorder | outofstock | This is the 'stock status' for the product as it is considered to be by Aurora. This is provided to allow 3rd parties to 'defer' to Aurora's automated handling of these states, saving similar logic being distributed across template logic unless absolutely necessary. | |
product.product_stock_message | String | Some statuses have additional messages to accompany them, e.g. if something is out of stock, but due to return soon, a date may be included here: "Due on the 1st of March" | |
product.pick_location | String | The BIN number of the product. | |
product.restock_date | String (yyyy-mm-dd) | The date the product is due to come back into stock. | |
product.sent_to_ebay | 0 | 1 | Is this product being sent to eBay by Aurora? This value is only included where the client wishes to advertise the presence of a product on eBay. | |
product.sent_to_amazon | 0 | 1 | Is this product being sent to Amazon by Aurora? This value is only included where the client wishes to advertise the presence of a product on Amazon. | |
product.product_category_name | String | The name of the main Category to which the product belongs. | |
product.image_url | String | The main image to be used for the product. | |
product.image_url_alt | String | The main alternate image to be used for the product. This is often used as the 'mouse over' effect. | |
product.being_compared | Boolean | If the product in question is currently included in the customer's list of compared products, then this will be TRUE, otherwise it will be FALSE. | |
product.variations | Array | An array of variations that belong to the product. | |
product.variations.x.variation_name | String | This field is presently not used by Aurora and so will always be blank. This may change, but for the foreseeable future, the 'name' of a variation should be generated from its list of Attributes. | |
product.variations.x.variation_reference | String | The Product Variation Reference value (usually a SKU) configured for the product. | |
product.variations.x.variation_stock | Integer | The stock available for the product variation. | |
product.variations.x.variation_pick_location | String | The BIN number of the product variation. | |
product.variations.x.variation_attributes | Array | An array of attributes applicable to the product variation, e.g. Size: 6. |
getVariationData
Overview
Permission Required: None
Method Call: /ajax/Ajax_Products/getVariationData
Aurora Demo Example URL: https://demo.auroracommerce.com/ajax/Ajax_Products/getVariationData?ajax-true&product_id=1&attributes=attributes%5B1%5D%5B15%5D%3D3
Aurora Demo Example JavaScript:
- templates/example.com/_js/product_attributes.js
Method Description
Request Parameters
Parameter | Values | Description | Required |
---|---|---|---|
product_id | Integer | The Internal ID Aurora uses to identify a Product. | Yes |
attributes | String | This is a serialised string of the following array values: attributes[123][456]=789 Where 123 is the Product ID, 456 is the Attribute ID and 789 is the Attribute Value ID. | No |
updateattributes | Boolean | When provided and true (or 1) Aurora will return an additional array element called "attributes" which will contain a completely regenerated copy of the "products/attributes.tpl.html" Front-end Template. This is very handy for updating the entire attribute section when the customer is selecting attributes and you would like to include a price or stock consideration using the attributes template. | No |
includes | array | Values include "variation_additional_fields" - when provided the given data will be returned in the response. | No |
Updated over 1 year ago