Skip to content

JS API

Returns the script build timestamp and Git commit hash.

window.Convermax.version;
Thu, 12 Mar 2026 12:19:40 GMT (abc1234:Thu, 12 Mar 2026 11:56:52 GMT)

Returns the selected vehicle.

window.Convermax.getVehicle();
{
"Year": "2015",
"Make": "Ford",
"Model": "F-150"
}

Adds a vehicle to the garage and selects it. If the vehicle is already in the garage, it is not added twice.

window.Convermax.setVehicle({ Year: '2015', Make: 'Ford', Model: 'F-150' });

Clears the currently selected vehicle. If the vehicle exists in the garage, it remains saved but is no longer selected.

window.Convermax.discardVehicle();

Returns the garage vehicle list.

window.Convermax.getVehicleList();
[
{
"Year": "2015",
"Make": "Ford",
"Model": "F-150"
},
{
"Year": "2016",
"Make": "Ford",
"Model": "F-150"
}
]

Adds a list of vehicles to the garage. Existing vehicles are skipped.

window.Convermax.addVehicleList([
{ Year: '2015', Make: 'Ford', Model: 'F-150' },
{ Year: '2016', Make: 'Ford', Model: 'F-150' },
]);

Replaces the garage vehicle list. The last vehicle in the list is selected automatically.

window.Convermax.setVehicleList([
{ Year: '2015', Make: 'Ford', Model: 'F-150' },
{ Year: '2016', Make: 'Ford', Model: 'F-150' },
]);

Adds a vehicle to the garage without selecting it.

window.Convermax.addVehicle({ Year: '2015', Make: 'Ford', Model: 'F-150' });

Removes a vehicle from the garage.

window.Convermax.removeVehicle({ Year: '2015', Make: 'Ford', Model: 'F-150' });

window.Convermax.verifyFitmentAsync(productId?, vehicle?)

Section titled “window.Convermax.verifyFitmentAsync(productId?, vehicle?)”

Checks product compatibility with a vehicle.

await window.Convermax.verifyFitmentAsync();
await window.Convermax.verifyFitmentAsync({ Year: '2015', Make: 'Ford', Model: 'F-150' });
await window.Convermax.verifyFitmentAsync('3051');
await window.Convermax.verifyFitmentAsync('3051', { Year: '2015', Make: 'Ford', Model: 'F-150' });
yes
no
unknown
universal

window.Convermax.updateVerifyFitmentWidget(productId, variantId?)

Section titled “window.Convermax.updateVerifyFitmentWidget(productId, variantId?)”
window.Convermax.updateVerifyFitmentWidget(123412341234);
window.Convermax.updateVerifyFitmentWidget(123412341234, 456745674567);

window.Convermax.onVehicleSelected = (vehicle) => {}

Section titled “window.Convermax.onVehicleSelected = (vehicle) => {}”

Subscribes to the vehicle selection event.

window.Convermax.onVehicleSelected = (vehicle) => console.log(vehicle);
{
"Year": "2015",
"Make": "Ford",
"Model": "F-150"
}

window.Convermax.onVehicleRemoved = (vehicleList) => {}

Section titled “window.Convermax.onVehicleRemoved = (vehicleList) => {}”

Subscribes to the vehicle removal event.

window.Convermax.onVehicleRemoved = (vehicleList) => console.log(vehicleList);
[
{
"Year": "2016",
"Make": "Ford",
"Model": "F-150"
}
]

Checks whether a vehicle is currently selected.

window.Convermax.isVehicleSelected();
true
false

Returns the selected vehicle as a string. If no vehicle is selected, returns an empty string.

window.Convermax.getVehicleString();
2024 Ford F-150

Returns the selected vehicle as slash-delimited key/value pairs that can be appended to a search URL path.

window.Convermax.getVehicleSearchParams();
Year/2020/Make/Ford/Model/F-150
https://example-store.com/Year/2020/Make/Ford/Model/F-150

window.Convermax.getVehicleRequestParams()

Section titled “window.Convermax.getVehicleRequestParams()”
window.Convermax.getVehicleRequestParams();
facet.0.field=Year&facet.0.selection=2020&facet.1.field=Make&facet.1.selection=Ford&facet.2.field=Model&facet.2.selection=F-150
https://client.convermax.com/example-store/search.json?pagesize=30&facet.0.field=Year&facet.0.selection=2020&facet.1.field=Make&facet.1.selection=Ford&facet.2.field=Model&facet.2.selection=F-150

Returns the current search request object.

window.Convermax.getSearchRequest();
{
"selection": [],
"action": "set",
"catalog": "",
"filterQuery": "",
"maxCountByField": {},
"pageNumber": 0,
"pageSize": 36,
"query": "exhaust",
"sort": "relevance"
}

Returns the current search response object.

window.Convermax.getSearchResponse();
{
"error": null,
"messages": [],
"originalQuery": "exhaust",
"query": "exhaust",
"state": "normal",
"totalHits": 39
}

Response objects also include facets and items collections.

window.Convermax.clearCurrentRequest(doNotDiscardVehicle?)

Section titled “window.Convermax.clearCurrentRequest(doNotDiscardVehicle?)”

Clears the current search filters and query. Pass true to keep the selected vehicle.

window.Convermax.clearCurrentRequest();
window.Convermax.clearCurrentRequest(true);

Clears the current autocomplete query, search query, and filter query values when present.

window.Convermax.clearCurrentQuery();

Returns the current sort value.

window.Convermax.getSearchSort();
relevance

Sets the current sort value. Sort options are field names for ascending order, or field:desc for descending order.

window.Convermax.setSearchSort('price');
window.Convermax.setSearchSort('price:desc');
// Shopify default sort options:
[
'relevance',
'title',
'title:desc',
'collection_sort',
'price',
'price:desc',
'published_at',
'published_at:desc',
];
// BigCommerce default sort options:
['relevance', 'name', 'name:desc', 'price', 'price:desc', 'date_created', 'date_created:desc'];

window.Convermax.discardSearchFields(fields)

Section titled “window.Convermax.discardSearchFields(fields)”

Clears only the specified search fields. Other selected fields stay unchanged.

window.Convermax.discardSearchFields(['category', 'price', 'collections']);

window.Convermax.openDialog(dialogName, metadata?)

Section titled “window.Convermax.openDialog(dialogName, metadata?)”

Opens the dialog specified by dialogName. The optional metadata argument passes dialog-specific data.

Common dialog names in generic bundles include VehicleWidgetDialog, SearchBoxDialog, FacetDialog, SimpleColorPaletteDialog, and ColorExtractorDialog. Stores can also register custom dialog names.

window.Convermax.openDialog('VehicleWidgetDialog');
window.Convermax.openDialog('FacetDialog');
window.Convermax.openDialog('VehicleWidgetDialog', { withCurrentVehicle: true });

window.Convermax.getRelatedItemsAsync(id, count, sort?)

Section titled “window.Convermax.getRelatedItemsAsync(id, count, sort?)”

Returns a Promise that resolves to related items for the specified product; when a vehicle is selected, the related-items request uses the selection derived from that vehicle. The optional sort argument uses the same format as setSearchSort().

window.Convermax.getRelatedItemsAsync('112233445566', 2, 'price')
.then((items) => {
console.log(items);
})
.catch((err) => {
console.error(err);
});
[
{
"id": "123456789",
"title": "ARB Example Item",
"price": 0.95,
"url": "/products/arb-example-item",
"vendor": "ARB"
},
{
"id": "1011121314",
"title": "Hella Example Item",
"price": 5.58,
"url": "/products/hella-example-item",
"vendor": "Hella"
}
]