Book a call

Fill out the form and we will call you back as soon as possible

Emergency situation

In case of emergencies or breakdowns, you can send an SMS to our emergency hotline

On-call phone (SMS only)

+45 29 70 15 95

Send an SMS with the following information:

  • Your name and webshop
  • Description of the problem
  • Your callback phone number

Notes: This service is only for critical situations where your webshop is down or has serious problems. For regular support, please use our normal support channels.

Ajax filtering

Technical documentation for Shoporama's /ajax endpoint for filtering products. For developers.

Reading time: approx. {eight} minutes
Developer

All Shoporama stores have an /ajax endpoint that returns products in JSON format. This makes it possible to dynamically fetch and filter products with JavaScript - without reloading the entire page.

What is the /ajax endpoint?

The /ajax endpoint returns products based on the parameters you submit with. You can filter by category, extra fields, price, tags and more.

Basic usage

A simple AJAX call to fetch products from a category:

fetch('/ajax?category_id=123') .then(response => response.json()) .then(data => { // data.products contains the products // data.count contains the total number });

Available parameters

Parameter Description of the parameter
category_idFilter by category ID
tagFilter by tag
extra_field[field]=valueFilter by extra fields
price_from / price_toPrice range
sortSorting (e.g. price_asc, price_desc, name)
limit / offsetPagination

Example: Filtering with additional fields

// Fetch red products in category 123, sorted by price fetch('/ajax?category_id=123&extra_field[color]=red&sort=price_asc') .then(response => response.json()) .then(data => { data.products.forEach(product => { console.log(product.name, product.price); }); });

Implementation in your theme

To build a complete filtering experience, your developer needs to:

  1. Create filter UI with checkboxes/dropdowns based on available extra fields
  2. Listen to changes in the filters
  3. Call /ajax with the selected parameters
  4. Dynamically update the product list with the returned data

Tips for filtering

Read more about filtering in general in our article Filtering on your online shop.

Do you need help? Contact us at support@shoporama.dk.