Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 44ac25b063 | |||
| ee8459ca2a |
@@ -497,6 +497,21 @@ class ProductsApiController
|
|||||||
$d['products_related'] = $body['products_related'];
|
$d['products_related'] = $body['products_related'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Custom fields (Dodatkowe pola)
|
||||||
|
if (isset($body['custom_fields']) && is_array($body['custom_fields'])) {
|
||||||
|
$d['custom_field_name'] = [];
|
||||||
|
$d['custom_field_type'] = [];
|
||||||
|
$d['custom_field_required'] = [];
|
||||||
|
foreach ($body['custom_fields'] as $cf) {
|
||||||
|
if (!is_array($cf) || empty($cf['name'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$d['custom_field_name'][] = (string)$cf['name'];
|
||||||
|
$d['custom_field_type'][] = isset($cf['type']) ? (string)$cf['type'] : 'text';
|
||||||
|
$d['custom_field_required'][] = !empty($cf['is_required']) ? 1 : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $d;
|
return $d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -302,11 +302,15 @@ Content-Type: application/json
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"categories": [1, 5],
|
"categories": [1, 5],
|
||||||
"products_related": [10, 20]
|
"products_related": [10, 20],
|
||||||
|
"custom_fields": [
|
||||||
|
{"name": "Napis na koszulce", "type": "text", "is_required": 1}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Wymagane: `languages` (min. 1 jezyk z `name`) oraz `price_brutto`.
|
Wymagane: `languages` (min. 1 jezyk z `name`) oraz `price_brutto`.
|
||||||
|
`custom_fields` — opcjonalne; kazdy element wymaga `name`, `type` (domyslnie `text`), `is_required` (0/1).
|
||||||
|
|
||||||
Odpowiedz (HTTP 201):
|
Odpowiedz (HTTP 201):
|
||||||
```json
|
```json
|
||||||
|
|||||||
BIN
updates/0.30/ver_0.320.zip
Normal file
BIN
updates/0.30/ver_0.320.zip
Normal file
Binary file not shown.
26
updates/0.30/ver_0.320_manifest.json
Normal file
26
updates/0.30/ver_0.320_manifest.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"changelog": "NEW - API: endpoint ensure_producer (znajdź lub utwórz producenta); GET product zwraca producer_name",
|
||||||
|
"version": "0.320",
|
||||||
|
"files": {
|
||||||
|
"added": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"deleted": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"modified": [
|
||||||
|
"autoload/Domain/Producer/ProducerRepository.php",
|
||||||
|
"autoload/Domain/Product/ProductRepository.php",
|
||||||
|
"autoload/api/ApiRouter.php",
|
||||||
|
"autoload/api/Controllers/DictionariesApiController.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"checksum_zip": "sha256:eb38b6f260768c25d331de60098eba647a897972c211b37b39314c8a3f954bf3",
|
||||||
|
"sql": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"date": "2026-02-24",
|
||||||
|
"directories_deleted": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
|||||||
<?
|
<?
|
||||||
$current_ver = 320;
|
$current_ver = 321;
|
||||||
|
|
||||||
for ($i = 1; $i <= $current_ver; $i++)
|
for ($i = 1; $i <= $current_ver; $i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user