Skip to content

Vendors & Vendor Pages

Flow ID: CF-19 | Module(s): eshop, Product domain | Complexity: Medium

Business Overview

Vendors (brands) are a core catalog dimension. The storefront provides vendor listing, product pages with filtering, and exclusive vendor detail pages with sliders/videos/builder blocks.

What customers experience:

  • /vendors page showing all brands with active products
  • /vendors/{slug} product listing page for a specific brand (with tag/category/variation filters)
  • /vendors/{slug}/{category} category-filtered product listing within a vendor
  • /vendors/{slug}/{line-slug} product line listing within a vendor
  • /vendors/{slug}/details exclusive vendor page with rich content (sliders, videos, builder blocks)

Key business behaviors:

  • Only vendors with active products (price > 0, stock > 0 or negative_stock) are shown
  • Tag filter on vendor pages sets dofollow = false (SEO nofollow for filtered pages)
  • Category-filtered vendor pages canonical to base vendor URL
  • is_exclusive = 1 enables /vendors/{slug}/details page with rich content
  • Vendor product pages support tag, variation, and attribute filters via query string
  • _remap() dispatcher routes all vendor URLs through a single entry point
  • Per-language vendor slugs with lang_uri switcher support

API Reference

REST Endpoints

MethodPathAuthDescription
GET/rest/product/vendorGuestList vendors (filter by isPromo, isExclusive, name.{locale})
GET/rest/product/vendor/{id}GuestGet vendor with relations
POST/rest/product/vendorBackend (Products)Create vendor (multipart -- logo, banners)
POST/rest/product/vendor/{id}Backend (Products)Update vendor
DELETE/rest/product/vendor/{id}Backend (Products)Delete vendor

Relations: translations, products, supplier File fields: logo, vendor_banner, vendor_medium_banner, vendor_small_banner

Legacy Storefront

URLController MethodDescription
/vendorsindex()All vendors listing page
/vendors/{vendor-slug}vendors($slug)Vendor product listing
/vendors/{vendor-slug}/{category}vendors($slug, $suffix)Vendor + category filter
/vendors/{vendor-slug}/{line-slug}lines_list($vendorSlug, $lineSlug)Product line within vendor
/vendors/{vendor-slug}/detailsvendorsDetails($vendorSlug)Exclusive vendor page

Code Flow

Step 1: URL Routing via _remap()

File: ecommercen/eshop/controllers/Adv_vendors.php

  1. Index: Direct call to index() for bare /vendors
  2. Canonical check: If useCanonical enabled, checks for canonical URL redirect
  3. Vendor lookup: Fetches vendor by slug via vendors_model->get_records() (cached via pscache)
  4. Exclusive check: If suffix is details, routes to vendorsDetails()
  5. Line check: If suffix matches a product line slug, routes to lines_list()
  6. Category check: If suffix matches a category slug, routes to vendors() with category filter
  7. Fallback: 404 if no route matches

Step 2: Vendor Index (All Brands)

File: ecommercen/eshop/controllers/Adv_vendors.php::index()

  1. Fetch vendors: vendors_model->getVendorsWithActiveProductsAndValidPrices() (cached)
  2. SEO: Generate meta tags via seo_lib->create_metatags()
  3. Breadcrumbs: Home > Vendors
  4. Hook: indexExtras() — empty by default, override in client
  5. Render: vendorsAll layout template

Step 3: Vendor Product Listing

File: ecommercen/eshop/controllers/Adv_vendors.php::vendors()

  1. Vendor data: Fetch by slug from cache
  2. Category parsing: Extract category slug and pagination offset from URL suffix
  3. Filter initialization: Tag filters from query string (filterQueryStringVar), variation filters, attribute filters
  4. Tag validation: Verify all filter slugs exist in tag records; 404 on invalid tags
  5. Product query: Fetch products with vendor + optional category + active filters
  6. SEO: dofollow = false when tag filters active; canonical to base vendor URL
  7. Hreflang: Per-language vendor URLs via renderVendorUrls()
  8. Builder blocks: blockBuilder->frontRender() for vendorDescription position
  9. Hook: vendorsExtras() — override in client for custom content
  10. Render: Product grid with filters, pagination, breadcrumbs

Step 4: Exclusive Vendor Details Page

File: ecommercen/eshop/controllers/Adv_vendors.php::vendorsDetails()

  1. Vendor check: Fetch vendor data; 404 if not found or is_exclusive=0
  2. Slider: Load slider if slider_id is set via sliders_model->getFrontMasterRecord()
  3. Videos: Fetch assigned videos via video_model->getAllVideosAssignedToVendor()
  4. Builder block: Render vendorExclusive position using exclusive_builder_block_id
  5. Rich content: fulltext from MUI table for vendor description
  6. Breadcrumbs: Home > Vendors > {Vendor Name} > Details
  7. Hook: vendorsDetailsExtra() — override in client
  8. Render: vendorDetails layout template

Domain Layer

ComponentPath
Servicesrc/Domains/Product/Vendor/Service.php
WriteServicesrc/Domains/Product/Vendor/WriteService.php
Validatorsrc/Domains/Product/Vendor/Validator.php
Entitysrc/Domains/Product/Vendor/Repository/Entity.php
REST Controllersrc/Rest/Product/Controllers/Vendor.php (HandlesUploadActions)
Legacy Controllerecommercen/eshop/controllers/Adv_vendors.php
Admin Controllerecommercen/eshop/controllers/Adv_vendors_admin.php
Legacy Modelecommercen/eshop/models/Adv_vendors_model.php

Data Model

shop_vendor

ColumnTypeDescription
idint (PK, AI)Vendor ID
logotextLogo image path
vendor_bannervarchar(255)Main banner image
vendor_medium_bannervarchar(254)Medium banner image
vendor_small_bannervarchar(254)Small banner image
is_promotinyint(1)Whether vendor is promoted
is_exclusiveint(2)Whether vendor has exclusive detail page
orderintDisplay sort order
slider_idint (FK, nullable)Linked slider for exclusive page
supplier_idint (FK, nullable)Linked supplier reference

shop_vendor_mui

ColumnTypeDescription
idint (PK, AI)MUI entry ID
vendor_idint (FK)Parent vendor
namevarchar(255)Vendor display name
vendor_slugvarchar(255)URL slug
fulltexttextVendor description (product listing page)
exclusive_fulltexttextDescription for exclusive detail page
langvarchar(2)Language code
main_banner_urlvarchar(255)Click-through URL for main banner
middle_banner_urlvarchar(255)Click-through URL for medium banner
small_banner_urlvarchar(255)Click-through URL for small banner

shop_vendor_video_lp

ColumnTypeDescription
idint (PK, AI)Lookup ID
video_idint (FK)Video reference
vendor_idint (FK)Vendor reference

Client Extension Points

  • vendorsExtras() hook: Add custom content to vendor product pages
  • vendorsDetailsExtra() hook: Customize exclusive vendor detail page
  • indexExtras() hook: Vendor listing page customizations
  • Upload fields: Override uploadFieldsConfig() for custom image fields in REST controller
  • DI override: Replace Vendor WriteService/Validator via container alias
  • Builder blocks: vendorDescription and vendorExclusive positions for page builder content
  • Views: {client_views}/vendors/ — vendor listing, product listing, details templates