1 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.
Your Answer
Login to answer this question
Login