Hi David,
Just wondering if its possible to have product mapping without the case sensitive part included? Is it an easy modification?
Thanks
Adrian
Hi David,
Thanks for looking at this. Just getting a chance to test this now.
Changed
if (isset($admin_importProductMappings[strtolower($record[$admin_importFeed["field_name"])]]))
to
if (isset($admin_importProductMappings[strtolower($record[$admin_importFeed["field_name"]])]))
as was getting syntax error.
When I import the feed with the new admin.php, I seem to have less products.
One of my products is Crash of the Titans and one merchants feed has it as Crash Of the Titans (with a Capital Of).
Should the code above allow that product name to be imported rather than having to manually put it in the product mapping.
Thanks
Adrian
Hi Adrian,
Yes - that should be how it works - so it would make sense that you have less unique products. The actual number of product records should be unaffected by the mapping...
Cheers,
David.
Hi David,
Hope you got over the Christmas OK.
Posted this thread in November but didn't work for me at the time and having a look at it again now. Still having problems with the product mapping tool and product name cases.
EG.
I have created a product map for "Call of Duty 4". Some feeds have the product name as
Call of Duty 4 Modern Warfare
Call Of Duty 4 Modern Warfare
Call of Duty 4 Modern warfare
So for my "Call of Duty 4" title I have to enter 3 alternate product names.
The above code with strtolower included doesn't seem to work, it removes the product mapping function and doesn't include my new title.
Any idea on how this can be done. Would make it a lot easier rather than having to include every version of the product name with upper and lowercase letters.
Hope this makes sense !!
Thanks
Adrian
Hi Adrian,
I think the error is in this section:
/* apply product mappings */
if (isset($admin_importProductMappings[strtolower($record[$admin_importFeed["field_name"])]]))
{
$record[$admin_importFeed["field_name"]] = $admin_importProductMappings[$record[strtolower($admin_importFeed["field_name"])]];
}
It should actually be:
/* 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"]])];
}
Fingers crossed that should work now...
Cheers,
David.
Hi David,
Thanks for taking a look. Still appears to be doing the same thing though. After modifying the code and re-importing all but one of the feeds. The new "Call of Duty4" title is only appearing for the one that hasn't been imported, the others have gone back to their original titles, so not too sure whats going on.
Thanks
Adrian
Hi Adrian,
Could you email me a copy of your latest includes/admin.php and i'll copy the modifications and try it out on my test server...
Cheers,
David.
Hi Adrian,
Yes - that's easy enough...! There are 3 places within includes/admin.php that will need to be strtolower()'d to make this work. Firstly, look for the following code starting at link 228 within the admin__importRecordHandler() function:
/* apply product mappings */
if (isset($admin_importProductMappings[$record[$admin_importFeed["field_name"]]]))
{
$record[$admin_importFeed["field_name"]] = $admin_importProductMappings[$record[$admin_importFeed["field_name"]]];
}
...and change this to:
/* apply product mappings */
if (isset($admin_importProductMappings[strtolower($record[$admin_importFeed["field_name"])]]))
{
$record[$admin_importFeed["field_name"]] = $admin_importProductMappings[$record[strtolower($admin_importFeed["field_name"])]];
}
And then lower down where the mappings are loaded on line 370 within the admin_import() function, change:
$admin_importProductMappings[$alternate] = $productsmap["name"];
...to:
$admin_importProductMappings[$alternate] = strtolower($productsmap["name"]);
Hope this helps!
Cheers,
David.