Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fe2a77e995 | |||
| f0b1152ab1 |
@@ -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'])) {
|
||||
|
||||
@@ -507,7 +507,7 @@ class ProductsApiController
|
||||
continue;
|
||||
}
|
||||
$d['custom_field_name'][] = (string)$cf['name'];
|
||||
$d['custom_field_type'][] = isset($cf['type']) ? (string)$cf['type'] : 'text';
|
||||
$d['custom_field_type'][] = !empty($cf['type']) ? (string)$cf['type'] : 'text';
|
||||
$d['custom_field_required'][] = !empty($cf['is_required']) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
BIN
updates/0.30/ver_0.321.zip
Normal file
BIN
updates/0.30/ver_0.321.zip
Normal file
Binary file not shown.
23
updates/0.30/ver_0.321_manifest.json
Normal file
23
updates/0.30/ver_0.321_manifest.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"changelog": "NEW - API: obsługa custom_fields w create/update produktu",
|
||||
"version": "0.321",
|
||||
"files": {
|
||||
"added": [
|
||||
|
||||
],
|
||||
"deleted": [
|
||||
|
||||
],
|
||||
"modified": [
|
||||
"autoload/api/Controllers/ProductsApiController.php"
|
||||
]
|
||||
},
|
||||
"checksum_zip": "sha256:a04ac9975618bc3b21d80a8e449f98e5bc825ce49a37142e1e621a2ef34a19f1",
|
||||
"sql": [
|
||||
|
||||
],
|
||||
"date": "2026-02-24",
|
||||
"directories_deleted": [
|
||||
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
<?
|
||||
$current_ver = 321;
|
||||
$current_ver = 322;
|
||||
|
||||
for ($i = 1; $i <= $current_ver; $i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user