No results found

Try a different search query

Popular searches:

Add to Cart

Cart

You have no purchases yet

Browse Marketplace
Solved

How to add custom fields to product card?

Потрібно додати додаткові поля в картку товару:

  • Розмірна сітка
  • Склад матеріалу
  • Країна виробник

Як це зробити без хаків core?

a
admin4eg
· 736 views · 0 followers · 4 bookmarked
2

1 answer

21 січня 2026 (16:59)
Accepted Answer

There are several ways to add custom fields:

1. Via attributes (simplest)

  • Create attribute group "Specifications"
  • Add attributes: Size chart, Composition, Country
  • Assign to products

2. Via module (more flexible)

// Add columns to oc_product table
ALTER TABLE oc_product 
  ADD size_chart TEXT,
  ADD material VARCHAR(255),
  ADD country_id INT;

3. Via Events for display

public function eventProductView(&$route, &$data): void {
    $data['custom_fields'] = $this->getCustomFields($data['product_id']);
}

Recommend trying attributes first - it's the least invasive approach.

0

Your Answer

Login to answer this question

Login

Report

We use cookies

We use cookies and similar technologies to improve your experience, analyse traffic, and show personalised ads. Read our Cookie Policy for details.