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

ParameterValuesDescriptionRequired
pathString URL PathThe 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_only1 or 0If this value is set to 1 (one) then the filter information will be excluded from the return data.No
current_nav_itemStringThis 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_byIntegerThis 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_numberIntegerThe number of the page of results to be returned.No
items_per_pageIntegerThe number of products per page of results to be returned.No
view_typegrid or listThis controls which template in the Front-end Templates directory is used, namely "products/listings-grid.tpl.html" or "products/listings-list.tpl.html".No
langLanguage ISO StringThis 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

VariableValuesDescriptionproducts_only?
filtersArrayNo
product_listString HTMLYes
pagingArrayA Container holding the paging Information.Yes
paging.numbersStringThe paging HTML listing the available pages.Yes
paging.infoStringA short text description of the current page, e.g. "20-60 of 300".Yes
pathURLString URLThe new and 'clean' URL for the products requested.Yes
price_dataArrayA Container holding the legacy Price Filter Slider information.No
price_data.min_priceFloatThe 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_priceFloatThe 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_priceFloatThe currently selected minimum price.No
price_data.selected_min_priceFloatThe currently selected maximum price.No
slider_dataArrayA 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
ArrayThis is just one example, but there will be one entry in the array for each Slider in useNo
slider_data.etc.min_valueFloatThe 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_valueFloatThe 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_selectedFloatThe currently selected minimum value for the filter in question.No
slider_data.etc.max_value_selectedFloatThe currently selected maximum value for the filter in question.No
breadcrumbsStringThe new breadcrumb HTML for the products requested.No
page_titleStringThe new Page Title HTML for the products requested.Yes
meta_titleStringThe new Page Meta Title for the products requested.Yes
category_countsArrayAn 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_headerArrayA Container holding the Filter Header information if there is any configured for the filters being applied.No
filter_header.headerStringThe HTML code set to be used for the header of product lists requesting the applied filter combination.No
filter_header.footerStringThe 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

ParameterValuesDescriptionRequired
idIntegerThe Internal ID Aurora uses to identify a Product.Yes
image_widthIntegerThe desired maximum height to return the product images in (image_url & image_url_atl).No
image_heightIntegerThe desired maximum width to return the product images in (image_url & image_url_atl).No

Response Variables

VariableValuesCurrencyDescription
productContainerHolds all the Product details.
product.idIntegerThe Internal ID Aurora uses to identify a Product Category.
product.display_date_createdStringA string representation of the date the product was created, e.g. 30th May 2012.

This date format cannot presently be customised.
product.product_referenceStringThe Product Reference value (usually an SKU) configured for the product being requested.
product.product_filenameStringThe 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_nameStringThe language sensitive name of the Product.
product.product_priceFloatSelectedThe 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_priceFloatSelectedThe 'display' price is the price including any necessary currency formatting for display, e.g. currency symbols.
product.product_price_rrpStringSelectedThe raw numeric recommended retail price for the 'main' product.
product.display_product_price_rrpStringSelectedThe 'display' RRP is the RRP including any necessary currency formatting for display, e.g. currency symbols.
product.product_eanStringThe EAN set for the product.
product.product_upcStringThe UPC set for the product.
product.product_stockIntegerThe total stock available for the product.

If the product has variations, this will be the total stock of all active variations.
product.product_stock_statusinstock | preorder | outofstockThis 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_messageStringSome 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_locationStringThe BIN number of the product.
product.restock_dateString (yyyy-mm-dd)The date the product is due to come back into stock.
product.sent_to_ebay0 | 1Is 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_amazon0 | 1Is 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_nameStringThe name of the main Category to which the product belongs.
product.image_urlStringThe main image to be used for the product.
product.image_url_altStringThe main alternate image to be used for the product.

This is often used as the 'mouse over' effect.
product.being_comparedBooleanIf 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.variationsArrayAn array of variations that belong to the product.
product.variations.x.variation_nameStringThis 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_referenceStringThe Product Variation Reference value (usually a SKU) configured for the product.
product.variations.x.variation_stockIntegerThe stock available for the product variation.
product.variations.x.variation_pick_locationStringThe BIN number of the product variation.
product.variations.x.variation_attributesArrayAn 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

ParameterValuesDescriptionRequired
product_idIntegerThe Internal ID Aurora uses to identify a Product.Yes
attributesStringThis 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
updateattributesBooleanWhen 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
includesarrayValues include "variation_additional_fields" - when provided the given data will be returned in the response.No