Vielen Dank. Basierend auf Stefans Code von Gambio
Quelle: habe ich das ganze wie folgt gelöst:
In der Datei: /admin/html/compatibility/product/product_master_data.inc.php
Folgenden Code gesucht:
Code:
<div class="span6">
<?php echo xtc_draw_input_field('products_model', $pInfo->products_model); ?>
</div>
geändert in:
Code:
<div class="span6">
<?php
//set auto product_id if not already set - prefix can be changed
if(!$pInfo->products_model) {
$my_product_id_query = xtc_db_query("SELECT MAX(products_id)
AS products_id
FROM " . TABLE_PRODUCTS . "
");
$my_product_id = xtc_db_fetch_array($my_product_id_query);
$my_product_id = $my_product_id["products_id"] + 1;
$my_product_id = str_pad($my_product_id, 4 ,'0', STR_PAD_LEFT); //fill previouse positions of number with 0. i.e. 10 -> 0010
} else {
//product_id exists
$my_product_id = $pInfo->products_model;
}
//echo xtc_draw_input_field('products_model', $pInfo->products_model); //original code
echo xtc_draw_input_field('products_model', "A".$my_product_id);
?>
</div>
Getestet mit: Mit Gambio GX 3.11.2.0