feat: custom labels toggle and inline editing in product list
Adds session-based show/hide toggle for custom labels in admin product list, inline editable fields for custom_label_0..4, and label suggestions with custom entry support. Includes repository/controller updates, UI fixes, tests, and PAUL docs release updates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2205,6 +2205,44 @@ class ProductRepository
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobiera nazwy etykiet custom_label_0..4 z bazy ustawien.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function customLabelNames(): array
|
||||
{
|
||||
$names = [];
|
||||
for ( $index = 0; $index < 5; $index++ ) {
|
||||
$fieldName = 'custom_label_' . $index;
|
||||
$names[$fieldName] = 'Custom label ' . $index;
|
||||
}
|
||||
|
||||
$settingsKeys = [];
|
||||
for ( $index = 0; $index < 5; $index++ ) {
|
||||
$settingsKeys[] = 'custom_label_' . $index . '_name';
|
||||
$settingsKeys[] = 'google_custom_label_' . $index . '_name';
|
||||
}
|
||||
|
||||
$settingsRows = $this->db->select( 'pp_settings', [ 'param', 'value' ], [ 'param' => $settingsKeys ] );
|
||||
if ( is_array( $settingsRows ) ) {
|
||||
foreach ( $settingsRows as $settingRow ) {
|
||||
$param = (string) ( $settingRow['param'] ?? '' );
|
||||
$value = trim( (string) ( $settingRow['value'] ?? '' ) );
|
||||
|
||||
if ( $value === '' ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( preg_match( '/^(?:google_)?custom_label_([0-4])_name$/', $param, $match ) ) {
|
||||
$names[ 'custom_label_' . $match[1] ] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobiera sugestie custom label.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user