You are here:  » Product Mapping with special characters

Support Forum



Product Mapping with special characters

Submitted by Alastair on Wed, 2008-03-12 23:42 in

Hello David

Becasue my product names have hyphens (though some merchants omit them) I want to modify the product mapping to allow my to create a hyphenated product name and map both the correct and incorrect ones to it. e.g make

SONY BDP-S500 the product with alternates
SONY BDSPS500
SONY BDP-S500

I can't see how to modify the product mapping script to allow hyphens however. It doesn't seem to be quite the same logic as the tapestry normalise function in the includes/admin.php

Thank you

Submitted by support on Thu, 2008-03-13 09:07

Hi Alastair,

Yes - it uses a standard regular expression check rather than the tapestry_normalise() function. Look for the following code beginning at line 16 of admin/productsmap.php:

      if(!ereg("^[0-9a-zA-Z\. ]{0,255}$",widget_posted($_POST["name"])))
      {
        widget_errorSet("name","product name contains invalid characters");
      }

...and change this as follows (simply add - infront if 0-9)

      if(!ereg("^[-0-9a-zA-Z\. ]{0,255}$",widget_posted($_POST["name"])))
      {
        widget_errorSet("name","product name contains invalid characters");
      }

Cheers,
David.

Submitted by Alastair on Thu, 2008-03-13 15:57

Great thanks!