ver. 0.322: fix custom_fields — jawne mapowanie kluczy w ProductRepository, spójne !empty w ProductsApiController
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -737,7 +737,16 @@ class ProductRepository
|
||||
|
||||
// Custom fields (Dodatkowe pola)
|
||||
$customFields = $this->db->select('pp_shop_products_custom_fields', ['name', 'type', 'is_required'], ['id_product' => $id]);
|
||||
$result['custom_fields'] = is_array($customFields) ? $customFields : [];
|
||||
$result['custom_fields'] = [];
|
||||
if (is_array($customFields)) {
|
||||
foreach ($customFields as $cf) {
|
||||
$result['custom_fields'][] = [
|
||||
'name' => $cf['name'],
|
||||
'type' => !empty($cf['type']) ? $cf['type'] : 'text',
|
||||
'is_required' => $cf['is_required'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Variants (only for parent products)
|
||||
if (empty($product['parent_id'])) {
|
||||
|
||||
Reference in New Issue
Block a user