I've confirmed that the $realcode is correct (12345-A)
function nfp_add_id_to_product($title){
$code = substr($_SERVER['QUERY_STRING'],5,12);
$realcode = str_replace(array('-0', '-1'),array('-A', '-B'), $code);
$title = $title . '-' . $realcode ;
return $title;
}
Seems like this should change the title of the product throughout - for instance "Keychain" should now become "Keychain-12345-A" but it isn't doing anything.