Skip to main content

Overview

The Manufacturers API allows you to retrieve manufacturer (brand) information and filter products by manufacturer. Manufacturers help organize products by brand and enable customers to browse products from specific brands.

Get Manufacturer

Retrieve detailed information about a specific manufacturer.

Method

$this->load->model('catalog/manufacturer');
$manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($manufacturer_id);

Parameters

manufacturer_id
integer
required
The unique identifier of the manufacturer

Response

manufacturer_id
integer
Unique manufacturer identifier
name
string
Manufacturer name
description
string
Manufacturer description
image
string
Manufacturer logo/image path
sort_order
integer
Display sort order
meta_title
string
SEO meta title
meta_description
string
SEO meta description
meta_keyword
string
SEO meta keywords

Example Response

{
  "manufacturer_id": 8,
  "name": "Apple",
  "description": "<p>Apple Inc. is an American multinational technology company...</p>",
  "image": "catalog/manufacturers/apple-logo.jpg",
  "sort_order": 1,
  "meta_title": "Apple Products | Your Store",
  "meta_description": "Browse all Apple products including iPhones, iPads, MacBooks...",
  "meta_keyword": "apple, iphone, ipad, macbook, ios"
}

Get Manufacturers

Retrieve a list of all manufacturers with optional sorting and pagination.

Method

$this->load->model('catalog/manufacturer');
$manufacturers = $this->model_catalog_manufacturer->getManufacturers($data);

Parameters

sort
string
default:"name"
Sort field: name or sort_order
order
string
default:"ASC"
Sort order: ASC or DESC
start
integer
default:0
Offset for pagination
limit
integer
default:20
Number of manufacturers to return

Example Request

$this->load->model('catalog/manufacturer');

$data = [
    'sort'  => 'name',
    'order' => 'ASC',
    'start' => 0,
    'limit' => 20
];

$manufacturers = $this->model_catalog_manufacturer->getManufacturers($data);

Example Response

[
  {
    "manufacturer_id": 8,
    "name": "Apple",
    "image": "catalog/manufacturers/apple-logo.jpg",
    "sort_order": 1
  },
  {
    "manufacturer_id": 9,
    "name": "Canon",
    "image": "catalog/manufacturers/canon-logo.jpg",
    "sort_order": 2
  },
  {
    "manufacturer_id": 5,
    "name": "HTC",
    "image": "catalog/manufacturers/htc-logo.jpg",
    "sort_order": 3
  },
  {
    "manufacturer_id": 7,
    "name": "Hewlett-Packard",
    "image": "catalog/manufacturers/hp-logo.jpg",
    "sort_order": 4
  },
  {
    "manufacturer_id": 6,
    "name": "Palm",
    "image": "catalog/manufacturers/palm-logo.jpg",
    "sort_order": 5
  },
  {
    "manufacturer_id": 10,
    "name": "Sony",
    "image": "catalog/manufacturers/sony-logo.jpg",
    "sort_order": 6
  }
]

Get Total Manufacturers

Get the total count of manufacturers.

Method

$this->load->model('catalog/manufacturer');
$total = $this->model_catalog_manufacturer->getTotalManufacturers();

Response

Returns an integer representing the total number of manufacturers.
// Example: 25

Get Products by Manufacturer

Retrieve products from a specific manufacturer.

Method

$this->load->model('catalog/product');

$data = [
    'filter_manufacturer_id' => 8,
    'sort' => 'pd.name',
    'order' => 'ASC',
    'start' => 0,
    'limit' => 20
];

$products = $this->model_catalog_product->getProducts($data);

Parameters

filter_manufacturer_id
integer
required
Manufacturer ID to filter products
sort
string
Product sort field
order
string
Sort order: ASC or DESC
start
integer
Pagination offset
limit
integer
Number of products to return

Example Response

[
  {
    "product_id": 40,
    "name": "iPhone 15 Pro",
    "model": "IPHONE-15-PRO",
    "price": 999.00,
    "special": 899.00,
    "manufacturer_id": 8,
    "manufacturer": "Apple",
    "image": "catalog/products/iphone-15-pro.jpg"
  },
  {
    "product_id": 41,
    "name": "MacBook Pro 14\"",
    "model": "MBP-14-M3",
    "price": 1999.00,
    "manufacturer_id": 8,
    "manufacturer": "Apple",
    "image": "catalog/products/macbook-pro-14.jpg"
  }
]

Manufacturer Directory Example

Build an alphabetical manufacturer directory.
function getManufacturerDirectory() {
    $this->load->model('catalog/manufacturer');
    
    $manufacturers = $this->model_catalog_manufacturer->getManufacturers([
        'sort' => 'name',
        'order' => 'ASC'
    ]);
    
    $directory = [];
    
    foreach ($manufacturers as $manufacturer) {
        $first_letter = strtoupper(substr($manufacturer['name'], 0, 1));
        
        if (!isset($directory[$first_letter])) {
            $directory[$first_letter] = [];
        }
        
        $directory[$first_letter][] = $manufacturer;
    }
    
    return $directory;
}

$directory = getManufacturerDirectory();

Example Directory Output

{
  "A": [
    {
      "manufacturer_id": 8,
      "name": "Apple",
      "image": "catalog/manufacturers/apple-logo.jpg"
    }
  ],
  "C": [
    {
      "manufacturer_id": 9,
      "name": "Canon",
      "image": "catalog/manufacturers/canon-logo.jpg"
    }
  ],
  "H": [
    {
      "manufacturer_id": 5,
      "name": "HTC",
      "image": "catalog/manufacturers/htc-logo.jpg"
    },
    {
      "manufacturer_id": 7,
      "name": "Hewlett-Packard",
      "image": "catalog/manufacturers/hp-logo.jpg"
    }
  ],
  "S": [
    {
      "manufacturer_id": 10,
      "name": "Sony",
      "image": "catalog/manufacturers/sony-logo.jpg"
    }
  ]
}

Manufacturer Landing Page

Create a complete manufacturer page with products.
$this->load->model('catalog/manufacturer');
$this->load->model('catalog/product');

$manufacturer_id = 8;

// Get manufacturer details
$manufacturer = $this->model_catalog_manufacturer->getManufacturer($manufacturer_id);

if ($manufacturer) {
    // Get products by manufacturer
    $products = $this->model_catalog_product->getProducts([
        'filter_manufacturer_id' => $manufacturer_id,
        'sort' => 'p.sort_order',
        'order' => 'ASC',
        'start' => 0,
        'limit' => 20
    ]);
    
    // Get total product count
    $product_count = $this->model_catalog_product->getTotalProducts([
        'filter_manufacturer_id' => $manufacturer_id
    ]);
    
    $response = [
        'manufacturer' => $manufacturer,
        'products' => $products,
        'product_count' => $product_count
    ];
}

Paginated Manufacturer List

$this->load->model('catalog/manufacturer');

$page = 1;
$limit = 20;
$start = ($page - 1) * $limit;

// Get manufacturers for current page
$manufacturers = $this->model_catalog_manufacturer->getManufacturers([
    'sort' => 'name',
    'order' => 'ASC',
    'start' => $start,
    'limit' => $limit
]);

// Get total count for pagination
$total = $this->model_catalog_manufacturer->getTotalManufacturers();

$response = [
    'manufacturers' => $manufacturers,
    'total' => $total,
    'page' => $page,
    'limit' => $limit,
    'total_pages' => ceil($total / $limit)
];

Combine Category and Manufacturer Filters

Filter products by both category and manufacturer.
$this->load->model('catalog/product');

$data = [
    'filter_category_id' => 20,        // Electronics category
    'filter_manufacturer_id' => 8,     // Apple manufacturer
    'filter_sub_category' => true,
    'sort' => 'p.price',
    'order' => 'ASC',
    'start' => 0,
    'limit' => 20
];

$products = $this->model_catalog_product->getProducts($data);
$total = $this->model_catalog_product->getTotalProducts($data);

// Results: Apple products in Electronics category
Manufacturer data is cached to improve performance. The cache key is generated using an MD5 hash of the SQL query.

Use Cases

Display an alphabetical list of all manufacturers/brands available in your store.
Create dedicated pages for each manufacturer showing their logo, description, and products.
Allow customers to filter products by manufacturer/brand in category or search pages.
Feature specific manufacturers on homepage or promotional pages.

Complete Example

// Get all manufacturers
$this->load->model('catalog/manufacturer');
$all_manufacturers = $this->model_catalog_manufacturer->getManufacturers();

foreach ($all_manufacturers as $manufacturer) {
    // Get manufacturer details
    $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer(
        $manufacturer['manufacturer_id']
    );
    
    // Count products
    $this->load->model('catalog/product');
    $product_count = $this->model_catalog_product->getTotalProducts([
        'filter_manufacturer_id' => $manufacturer['manufacturer_id']
    ]);
    
    echo $manufacturer_info['name'] . ': ' . $product_count . ' products';
}

Next Steps

Products API

Retrieve product information

Categories API

Browse product categories

Cart API

Add products to cart

Orders API

Create and manage orders