Hi David,
Apologies, second question of the night! I have a bit of a dilema - I've recently had a program written for me to carry out various data manipulation tasks on my feeds, as part of the processing the program needs to change all product names to have the same case, however I've just realised that as a result of this my product mapping no longer works. It would be quite a mammoth task for me to go back and add the case variations to the product mapping table and so I was wondering if there's a way to alter the code so that product mapping is case insensitive?
Also, when the feeds are initially imported and the "automatic matching" takes place...is this also case sensitive?
Thanks for your help, it's much appreciated,
Laura
Hi David,
Thanks for these tips, I've made the changes and imported my feeds again but it doesn't seem to work. It looks like the mapping isn't working at all? I've made a number of file changes recently so not sure if this is as a result of the above changes or something I've done previously?!! Sorry not much help? Can you suggest where to start to look to find the issue?
Thanks again for your help,
Kind Regards,
Laura
Hi Laura,
Could you email me your modified includes/admin.php and i'll check it over for you - reply to your reg code or forum registration email is the easiest way to get me...
Cheers,
David.
Hi Laura,
Yes - this is easy to do. In includes/admin.php, look for the following code beginning on line 233:
/* apply product mappings */
if (isset($admin_importProductMappings[$record[$admin_importFeed["field_name"]]]))
{
$record[$admin_importFeed["field_name"]] = $admin_importProductMappings[$record[$admin_importFeed["field_name"]]];
}
To make the product mapping case insensitive, change this as follows:
/* apply product mappings */
if (isset($admin_importProductMappings[strtolower($record[$admin_importFeed["field_name"]])]))
{
$record[$admin_importFeed["field_name"]] = $admin_importProductMappings[strtolower($record[$admin_importFeed["field_name"]])];
}
...and then find the following code on line 368:
$alternate = trim($alternate);
...and change this to:
$alternate = strtolower(trim($alternate));
This won't affect the case of the actual mapped product name (it will be whatever the master product name you have provided) - just the comparison against original product name and the list of alternative names will now be case insensitive (by converting both to lower case).
Cheers,
David.