Hello David, I am using the category mapping for mapping brands mod from http://www.pricetapestry.com/node/169 and I am wondering is the category mapping case sensitive?
I have BLUE in the filter and for some reason Blue did not get mapped...
Thanks a lot.
Hi David
Was trying to do this mod to my installation, but my code looks like this
/* apply category mappings */
if (isset($admin_importCategoryMappings["=".$importRecord["category"]]))
{
$importRecord["category"] = $admin_importCategoryMappings["=".$importRecord["category"]];
}
What would I need to do here?
Thanks
Hi,
For the latest distribution, replace that section with
/* apply category mappings */
if (isset($admin_importCategoryMappings["=".strtolower($importRecord["category"])]))
{
$importRecord["category"] = $admin_importCategoryMappings["=".strtolower($importRecord["category"])];
}
Cheers,
David.
Hi,
Yes - as it stands it will be case sensitive, but easily changed.
In includes/admin.php; firstly where the mappings are loaded into an array; look for this code; around about line 351 (but will have moved if you have added the brand mapping mod!):
$admin_importCategoryMappings[$alternate] = $category["name"];
Replace this with:
$admin_importCategoryMappings[strtolower($alternate)] = $category["name"];
Then, in the section where the mappings are applied, you would have added this code to apply category mappings to brands:
/* apply category mappings to brands */
if (isset($admin_importCategoryMappings[$brand]))
{
$brand = $admin_importCategoryMappings[$brand];
}
Replace this as follows:
/* apply category mappings to brands */
if (isset($admin_importCategoryMappings[strtolower($brand)]))
{
$brand = $admin_importCategoryMappings[strtolower($brand)];
}
...and similarly in the section above where almost identical code is used to apply the category mappings:
/* apply category mappings */
if (isset($admin_importCategoryMappings[$category]))
{
$category = $admin_importCategoryMappings[$category];
}
...replace this with:
/* apply category mappings */
if (isset($admin_importCategoryMappings[strtolower($category)]))
{
$category = $admin_importCategoryMappings[strtolower($category)];
}
Cheers,
David.