Product configuration configurator on website

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Product configuration configurator on website
Complex
~5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Product Configuration Wizard Development

Configurator lets a buyer assemble products to their requirements: choose processor, RAM, storage and laptop case color; select jewelry size, material and engraving; outfit a furniture set from compatible elements. Result—unique configuration with calculated final price and optional visualization.

Configurator Types

Type Examples Features
Linear Laptop: CPU → RAM → SSD Each choice independent, price summed
Dependent PC: motherboard → compatible CPU Next step depends on previous
Visual Kitchen, furniture, car Image changes on selection
Modular Wardrobe: width + sections + inserts Arbitrary combinations within limits

Data Schema

CREATE TABLE configurators (
    id              BIGSERIAL PRIMARY KEY,
    product_id      BIGINT REFERENCES products(id),
    name            VARCHAR(255),
    base_price      NUMERIC(12,2) DEFAULT 0,
    image_base_url  TEXT,
    is_active       BOOLEAN DEFAULT TRUE
);

CREATE TABLE config_groups (
    id              BIGSERIAL PRIMARY KEY,
    configurator_id BIGINT REFERENCES configurators(id) ON DELETE CASCADE,
    name            VARCHAR(255) NOT NULL,
    slug            VARCHAR(100) NOT NULL,
    type            VARCHAR(20) NOT NULL,    -- 'radio', 'checkbox', 'quantity', 'text'
    is_required     BOOLEAN DEFAULT TRUE,
    sort_order      SMALLINT DEFAULT 0,
    depends_on_group_id  BIGINT REFERENCES config_groups(id),
    depends_on_option_id BIGINT
);

CREATE TABLE config_options (
    id              BIGSERIAL PRIMARY KEY,
    group_id        BIGINT REFERENCES config_groups(id) ON DELETE CASCADE,
    name            VARCHAR(255) NOT NULL,
    sku_suffix      VARCHAR(100),
    price_modifier  NUMERIC(12,2) DEFAULT 0,
    weight_modifier INT DEFAULT 0,
    image_layer     VARCHAR(500),
    stock           INT DEFAULT 9999,
    is_default      BOOLEAN DEFAULT FALSE,
    sort_order      SMALLINT DEFAULT 0
);

CREATE TABLE config_compatibility (
    id              BIGSERIAL PRIMARY KEY,
    option_a_id     BIGINT REFERENCES config_options(id),
    option_b_id     BIGINT REFERENCES config_options(id),
    type            VARCHAR(20) NOT NULL,    -- 'required', 'forbidden', 'recommended'
    message         TEXT
);

Backend: Price Calculation and Validation

class ConfiguratorEngine
{
    public function calculate(int $configuratorId, array $selectedOptions): ConfigResult
    {
        $configurator = Configurator::with([
            'groups.options',
            'compatibilityRules',
        ])->findOrFail($configuratorId);

        $errors      = [];
        $totalPrice  = $configurator->base_price;
        $totalWeight = 0;
        $skuParts    = [];
        $imageLayers = [];

        foreach ($configurator->groups as $group) {
            $selected = collect($selectedOptions)->where('group_id', $group->id)->first();

            if ($group->is_required && !$selected) {
                $errors[] = "Not selected: {$group->name}";
                continue;
            }

            if (!$selected) continue;

            $option = $group->options->find($selected['option_id']);
            if (!$option) {
                $errors[] = "Invalid option for {$group->name}";
                continue;
            }

            $totalPrice  += $option->price_modifier;
            $totalWeight += $option->weight_modifier;

            if ($option->sku_suffix)  $skuParts[]    = $option->sku_suffix;
            if ($option->image_layer) $imageLayers[]  = $option->image_layer;
        }

        // Check compatibility
        $compatErrors = $this->checkCompatibility($selectedOptions, $configurator->compatibilityRules);
        $errors = array_merge($errors, $compatErrors);

        return new ConfigResult(
            isValid:     empty($errors),
            errors:      $errors,
            totalPrice:  $totalPrice,
            totalWeight: $totalWeight,
            configSku:   implode('-', $skuParts),
            imageLayers: $imageLayers,
        );
    }

    private function checkCompatibility(array $selected, Collection $rules): array
    {
        $errors       = [];
        $selectedIds  = array_column($selected, 'option_id');

        foreach ($rules as $rule) {
            $hasA = in_array($rule->option_a_id, $selectedIds);
            $hasB = in_array($rule->option_b_id, $selectedIds);

            if ($rule->type === 'forbidden' && $hasA && $hasB) {
                $errors[] = $rule->message ?? 'Incompatible components';
            }

            if ($rule->type === 'required' && $hasA && !$hasB) {
                $option = ConfigOption::find($rule->option_b_id);
                $errors[] = $rule->message ?? "This option requires: {$option->name}";
            }
        }

        return $errors;
    }
}

API Endpoints

Route::get('/configurators/{id}', [ConfiguratorController::class, 'show']);
Route::post('/configurators/{id}/calculate', [ConfiguratorController::class, 'calculate']);
Route::post('/configurators/{id}/add-to-cart', [ConfiguratorController::class, 'addToCart']);

class ConfiguratorController extends Controller
{
    public function calculate(Request $request, int $id): JsonResponse
    {
        $data = $request->validate([
            'options'            => 'required|array',
            'options.*.group_id' => 'required|integer',
            'options.*.option_id' => 'required|integer',
        ]);

        $result = $this->engine->calculate($id, $data['options']);

        return response()->json([
            'valid'        => $result->isValid,
            'errors'       => $result->errors,
            'total_price'  => $result->totalPrice,
            'total_weight' => $result->totalWeight,
            'config_sku'   => $result->configSku,
            'image_layers' => $result->imageLayers,
        ]);
    }
}

Frontend Component

interface ConfigGroup {
  id: number;
  name: string;
  type: 'radio' | 'checkbox';
  options: ConfigOption[];
  depends_on_group_id?: number;
  depends_on_option_id?: number;
}

const Configurator: React.FC<{ configuratorId: number }> = ({ configuratorId }) => {
  const { data: config }  = useQuery(['configurator', configuratorId], fetchConfigurator);
  const [selections, setSelections] = useState<Record<number, number>>({});
  const [result, setResult] = useState<CalcResult | null>(null);

  const updateSelection = async (groupId: number, optionId: number) => {
    const newSelections = { ...selections, [groupId]: optionId };
    setSelections(newSelections);

    const options = Object.entries(newSelections).map(([gId, oId]) => ({
      group_id: Number(gId), option_id: oId,
    }));
    const res = await api.post(`/configurators/${configuratorId}/calculate`, { options });
    setResult(res.data);
  };

  const visibleGroups = config?.groups.filter(g => {
    if (!g.depends_on_group_id) return true;
    return selections[g.depends_on_group_id] === g.depends_on_option_id;
  });

  return (
    <div className="space-y-6">
      {visibleGroups?.map(group => (
        <ConfigGroupWidget
          key={group.id}
          group={group}
          selected={selections[group.id]}
          onSelect={(optId) => updateSelection(group.id, optId)}
        />
      ))}

      {result && (
        <div className="border-t pt-4">
          <p className="text-2xl font-bold">{formatPrice(result.total_price)}</p>
          {result.errors.map((e, i) => (
            <p key={i} className="text-red-500 text-sm">{e}</p>
          ))}
          <button
            disabled={!result.valid}
            onClick={() => addToCart(configuratorId, selections)}
            className="btn-primary mt-3 disabled:opacity-50"
          >
            Add to Cart
          </button>
        </div>
      )}
    </div>
  );
};

Visual Configurator (Image Layers)

const ProductVisualizer: React.FC<{ baseSrc: string; layers: string[] }> = ({ baseSrc, layers }) => (
  <div className="relative w-full aspect-square">
    <img src={baseSrc} className="absolute inset-0 w-full h-full object-contain" alt="base" />
    {layers.map((src, i) => (
      <img
        key={i}
        src={src}
        className="absolute inset-0 w-full h-full object-contain"
        alt={`layer-${i}`}
      />
    ))}
  </div>
);

Saving Configuration to Cart

CartItem::create([
    'cart_id'       => $cart->id,
    'product_id'    => $configurator->product_id,
    'configurator_id' => $configurator->id,
    'config_options'  => json_encode($selectedOptions),
    'config_sku'      => $result->configSku,
    'unit_price'      => $result->totalPrice,
    'quantity'        => 1,
]);

Timeline

  • Data schema + ConfiguratorEngine (no dependencies): 2 days
  • Dependent groups + compatibility rules: +1 day
  • API endpoints: 0.5 days
  • Frontend radio/checkbox configurator: 2 days
  • Visual configurator (layers): +1–2 days
  • Admin interface for creating configurators: 2 days

Total without visualization: 6–7 days. With visualization: 8–9 days.