Skip to main content

Introduction

Manage e-commerce products with dynamic catalogs, filtering, and search.

🎯 What does this module do?​

The Products module (Catalog) is a standalone module that lets you create, retrieve, filter, and manage products in your online store or multimedia collections. It provides very flexible tools for creating product catalogs or multimedia galleries with powerful search, filters, and organization features.

The Catalog enables creating, uploading, editing, and filtering catalogs through an intuitive interface. Beyond e-commerce, it supports alternative applications like multimedia galleries, demonstrating its versatility as a content management tool.

Think of it as your digital warehouse - you manage your product inventory in OneEntry admin panel (Catalog > Products), and your app fetches products dynamically with powerful search, filters, and sorting.

πŸ“– Simple Explanation​

Imagine you're building an online store selling:

  • πŸ‘Ÿ Sneakers - with sizes, colors, prices
  • πŸ“± Electronics - with specs, images, reviews
  • πŸ‘• Clothing - with sizes, materials, variants
  • πŸ“š Books - with authors, prices, descriptions

βœ… Instead of hardcoding each product, you:

  • Add products in OneEntry admin panel (with all details)
  • Fetch products dynamically using this module
  • Filter by category, price range, availability
  • Search products by name or description
  • Sort by price, date, popularity
  • Update prices/stock without redeploying

Real-world example:

❌ Without Products Module (hardcoded):
- Add new product β†’ Change code β†’ Deploy
- Change price β†’ Code change β†’ Deploy
- 1000 products = massive code file

βœ… With Products Module (dynamic):
- Add new product β†’ Update in admin β†’ Live instantly
- Change price β†’ Update in admin β†’ Live instantly
- 10,000 products = simple API calls

✨ Key Concepts​

What is a Product?​

A product is an item you sell, containing:

  • Basic info - Name, description, SKU, price
  • Images - Product photos, gallery
  • Variants - Sizes, colors, options (e.g., "Red T-shirt Size M")
  • Inventory - Stock quantity, availability
  • Custom attributes - Any fields you define (brand, material, weight, etc.)
  • SEO - Meta title, description, keywords
  • Status - Active, draft, out of stock
  • Localization - Multi-language support

Product Structure​

Products can have different structures:

TypeDescriptionExample
Simple ProductSingle item, no variantsBook, Poster
Product with VariantsMultiple options (size, color)T-shirt (S/M/L, Red/Blue)
Digital ProductDownloadable itemsE-book, Software
BundleGroup of productsStarter Pack, Gift Set

Product Organization​

Products are organized through several key features:

  • Categories - Organize into sections (Categories are pages of the Catalog type created in Pages module)
  • Product Statuses - Create additional filtering conditions beyond existing attribute filters
  • Product Links - Establish connections between products based on attribute criteria
  • Product Filters - Quick searching using specified filter criteria
  • Custom attributes - Brand, Size, Color, Material, etc.

Example hierarchy:

πŸ“ Electronics
β”œβ”€ πŸ“± Smartphones
β”‚ β”œβ”€ iPhone 15 Pro
β”‚ └─ Samsung Galaxy S24
└─ πŸ’» Laptops
β”œβ”€ MacBook Pro
└─ Dell XPS

πŸ“ Clothing
β”œβ”€ πŸ‘• T-Shirts
└─ πŸ‘– Jeans

πŸ“‹ What You Need to Know​

Catalog Architecture​

Important: Categories of the catalog are pages of the Catalog type created through the Pages module. You need to create catalog categories first before adding products.

Catalog features:

  • Products Tab - Main workspace for creating and managing catalog items
  • Product Filters - Quick searching using specified criteria
  • Product Links - Connect products based on attribute criteria (e.g., all black phones)
  • Product Statuses - Additional filtering conditions for organization
  • Catalog Upload - Bulk importing catalog data
  • Settings - Configuration options with numeric input fields

Ways to Get Products​

MethodWhen to UseExample
getProducts()List products with filters/searchShop catalog page
getProductsByPageId()Products from specific category (by ID)Category page
getProductsByPageUrl()Products from specific category (by URL)Category page by URL
getProductById()Get single product by IDProduct detail page
getRelatedProductsById()Get related/similar products"You may also like" section
searchProduct()Search products by querySearch functionality

Pagination Explained Simply​

When you have 1000 products, you don't load all at once:

Offset formula: offset = (pageNumber - 1) * limit


Sorting Options​

Sort products by different fields:

sortKeyWhat It DoesExample Use
priceSort by priceShow cheapest first
dateSort by creation dateShow newest products
titleSort alphabeticallyA-Z product list
positionCustom order (default)Hand-picked order from admin
idSort by IDTechnical sorting

Sort order:

  • ASC (Ascending) - Low to high (Aβ†’Z, 0β†’9, cheapβ†’expensive)
  • DESC (Descending) - High to low (Zβ†’A, 9β†’0, expensiveβ†’cheap)

Filtering Products​

Use filters to narrow down results:

Condition markers:

MarkerMeaningExample
eqEqual (exact match)Price = $50
neqNot equalStatus β‰  "sold out"
inContains (one of)Color in ["red", "blue"]
ninNot containsCategory not in ["archived"]
mthGreater thanPrice > $100
lthLess thanPrice < $50
exsExists (has value)Has discount
nexsDoes not exist (empty)No discount

Product Statuses create additional filtering conditions beyond existing attribute filters for more sophisticated product organization.

Product Links allow establishing connections between products based on attribute criteria. For example, you can link all products with the same color attribute (e.g., all black phones together).


πŸ“Š Quick Reference Table - Common Methods​

MethodDescriptionUse Case
getProducts()Get all products with filtering/sortingMain catalog page
getProductById()Get single product by IDProduct detail page
getProductsByPageId()Get products from category by page IDCategory page
getProductsByPageUrl()Get products from category by page URLCategory page by URL
getRelatedProductsById()Get related/similar products"You may also like" section
searchProduct()Search products by querySearch functionality
getProductsCount()Get total products countPagination info
getProductsCountByPageId()Get products count by category IDCategory pagination
getProductsCountByPageUrl()Get products count by category URLCategory pagination
getProductBlockById()Get product block by IDProduct content blocks
getProductsEmptyPage()Get products empty page structureEmpty state handling
getProductsPriceByPageUrl()Get product prices by page URLPrice filtering

❓ Common Questions (FAQ)​

Can I filter by multiple criteria at once?​

Yes! Combine multiple filters in array.


How do I handle product variants (sizes, colors)?​

Product variants are stored in attributeValues.


How do I implement "Load More" button?​

Use offset to load more products.


Can I show products from multiple categories?​

Yes, use category in condition marker.


How do I implement "New Arrivals" section?​

Sort by creation date or use parent category for manually sorting.


πŸ’‘ Important Notes​

Catalog Categories Setup​

Important: Before adding products, you must create catalog categories through the Pages module. Categories of the catalog are pages of the Catalog type.

Workflow:

  1. Go to Pages module in admin panel
  2. Create pages with "Catalog" type
  3. These pages become your product categories
  4. Add products to these categories via Catalog > Products

Catalog Features​

The Catalog module provides comprehensive tools:

  • Products Tab - Main workspace for creating/managing catalog items
  • Product Filters - Enable quick searching using specified criteria
  • Product Links - Connect related products based on attributes
  • Product Statuses - Create custom filtering conditions
  • Catalog Upload - Bulk import products
  • Settings - Configure catalog behavior

Beyond E-commerce​

The Catalog isn't limited to products - it can be used for:

  • Multimedia Galleries - Photos, videos, artwork collections
  • Portfolio Items - Design work, case studies
  • Document Libraries - Resources, downloads
  • Event Catalogs - Conferences, webinars
  • Recipe Collections - Food, drinks, cooking

Performance Optimization​

Cache frequently accessed products to reduce API calls and improve load times.


Always Filter Active Products​

In production, always show only active products by filtering with statusId: 1.


Handle Missing Images​

Provide fallback images for products without images to maintain consistent UI.


πŸŽ“ Best Practices​

  • Always use pagination (limit + offset)
  • Filter by statusId: 1 in production
  • Cache product lists to reduce API calls
  • Handle "out of stock" gracefully
  • Provide fallback images
  • Use markers for featured products (not IDs)
  • Implement search with debouncing
  • Add loading states in UI

More information about the Catalog in the OneEntry admin panel: https://doc.oneentry.cloudhttps://doc.oneentry.cloud/docs/category/catalog


Definition of the Products module​


const { Products } = defineOneEntry(
"your-project-url", {
"token": "your-app-token"
}
);


This module accepts a set of user parameters called userQuery. If the parameters are not passed to the method, the default value will be applied. Some methods accept the body as a parameter for filtering. If you don't want to set up sorting, pass an empty array or don't pass anything.

Parameters:


const userQuery = {
offset: 0,
limit: 30,
sortOrder: 'DESC',
sortKey: 'id',
}

Schema

offset: number
Pagination parameter. Default 0
example: 0

limit: number
pagination parameter. Default 30
example: 30

sortKey: string
Field for sorting (default not set - sorting by position, possible values: id, title, date, price, position)
Available values: id, position, title, date, price

sortOrder: string
sorting order DESC | ASC (default DESC)
example: "DESC"

By default, you can retrieve 10 objects. This is due to the record limit in the module's permissions settings.
For pagination to work correctly, you need to configure Module permissions according to your needs in the corresponding section.

"conditionMarker" by which values are filtered (not set by default), possible values:

'in' - Contains,
'nin' - Does not contain,
'eq' - Equal,
'neq' - Not equal,
'mth' - Greater than,
'lth' - Less than,
'exs' - Exists,
'nexs' - Does not exist