Hi Nicolas,
Thanks for the quick response.
I've tried the suggested line of code. As it stands it causes white screens. I edited it to
" SELECT CONCAT(" .$p_code. ", LPAD(CONCAT(" .implode(',', $concat). "),2,'0')) AS c_product_code, p.product_id, " .$t. ", " .$t. ", 0, 0, " .implode(', ', $fields).
Note : I generally use double quotes (") in strings when single quotes (') are also used on the line as I find it easier to read, especially when the single quotes would otherwise need escaping.
The result is as in the attached image
The '_'s persist and the sub-codes _xx are not as required.
I see that there are quite a few instances of the underscore in the products.php file, I'm guessing that maybe one or more of these are having some effect on the result:
902: $data = 'CONCAT(`product_code`,\'_\')';
904: $data = 'REPLACE('.$data.',\'_'.$default.'_\',\'_\')';
907: ' SET `product_code` = TRIM(TRAILING \'_\' FROM '.$data.')'.
1049: $p_code = 'p.product_code, \'_\'';
1051: $p_code = 'CONCAT(`product_code`,\'_\')';
1053: $p_code = 'REPLACE('.$p_code.',\'_'.$r.'_\',\'_\')';
1058: ' SELECT CONCAT('.$p_code.', '.implode(',\'_\',', $concat).') AS c_product_code, p.product_id, '.$t.', '.$t.', 0, 0, '.implode(', ', $fields).
1104: ' SELECT CONCAT('.$p_code.', '.implode(',\'_\',', $concat).') as c_product_code, '. $this->database->Quote('variant') .','. (int)$product_id . ',1,' . $t . ',' . $t . ',' . $this->database->Quote(@$element->product_group_after_purchase) .
The full product code should consist of the code (888884) with a two digit number (01, 02, through 18 [there will never be more than 18 sub codes]. In the attached image the 888884_76 should be 888884
01 (size 2 being the 1st size in the scale), 888884_77 should be 888884
02 (2.5 is the 2nd size in the scale) etc. 888884_85 should be 88888410.
In the previous mod it is the $i variable that is setting the last two digits of the product code. In the new code it looks as though the last two digits are the variant code id - correct me if I'm wrong.
A product, in my case, will only ever have one characteristic.
Is what I require easily, and quickly achievable?
Regards,
Martyn