You are here:  » How to make brand mapping case insensative?


How to make brand mapping case insensative?

Submitted by sirmanu on Sat, 2019-03-02 14:57 in

Hi David.
How do you recommend to make admin_importBrandMappings case insensitive?
I mean, Philips and philips, for instance, map to the same.
Thanks

Submitted by support on Sun, 2019-03-03 10:29

Hi,

Sure - to make Brand Mapping case insensitive, edit includes/admin.php and look for the following code at line 367:

  if (strpos($importRecord["brand"],$word) !== FALSE) $found++;

...and REPLACE with:

  if (stripos($importRecord["brand"],$word) !== FALSE) $found++;

Cheers,
David.
--
PriceTapestry.com

Submitted by sirmanu on Sun, 2019-03-03 20:03

Thanks! In fact, I wanted to say exact match (with equal and docs says), sorry:

=philips matches Philips and philips

Submitted by support on Mon, 2019-03-04 09:13

Hi,

Sure - it can be made exact (whole word match and case insensitive) using preg_match - have a go with in place of the above replacement:

  if (preg_match("/\\b".preg_quote($word)."\\b/i",$importRecord["brand"]) $found++;

Cheers,
David.
--
PriceTapestry.com